-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmca.html
More file actions
797 lines (711 loc) · 36.1 KB
/
dmca.html
File metadata and controls
797 lines (711 loc) · 36.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BadgeForge Pro - Advanced GitHub Badge Generator</title>
<meta name="description" content="Create professional, dynamic badges for your GitHub repositories with real-time preview and analytics. The most advanced badge generator for developers.">
<meta name="keywords" content="GitHub badges, shield.io, repository badges, markdown badges, development tools">
<!-- Styles -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
'primary': '#0366d6',
'primary-dark': '#044289',
'secondary': '#2ea44f',
'accent': '#f6f8fa',
}
}
}
}
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
* { font-family: 'Inter', sans-serif; }
.gradient-bg {
background: linear-gradient(135deg, #ffffff 0%, #f6f8fa 50%, #ffffff 100%);
position: relative;
overflow: hidden;
}
.gradient-bg::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: radial-gradient(
circle at 50% 50%,
rgba(3, 102, 214, 0.1) 0%,
transparent 50%
);
animation: pulse 8s ease-in-out infinite;
}
.glass-card {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border: 1px solid rgba(3, 102, 214, 0.1);
transition: all 0.3s ease;
}
.floating {
animation: floating 3s ease-in-out infinite;
}
@keyframes floating {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
.badge-preview-card {
background: rgba(246, 248, 250, 0.8);
border: 1px dashed rgba(3, 102, 214, 0.2);
}
.feature-card {
transition: all 0.3s ease;
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.custom-scrollbar::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #0366d6;
border-radius: 3px;
}
/* Add to your existing styles */
.custom-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
padding-bottom: 5px;
}
.custom-scrollbar::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}
/* Add shadow indicators for scroll */
.custom-scrollbar {
position: relative;
}
.custom-scrollbar::after {
content: '';
position: absolute;
right: 0;
top: 0;
bottom: 5px;
width: 40px;
background: linear-gradient(to left, white, transparent);
pointer-events: none;
}
.custom-scrollbar::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 5px;
width: 40px;
background: linear-gradient(to right, white, transparent);
pointer-events: none;
z-index: 1;
}
</style>
</head>
<body class="bg-white text-gray-800">
<!-- Announcement Bar -->
<div class="bg-primary text-white py-2" id="announcement-bar">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between text-sm">
<div class="flex items-center">
<span class="hidden sm:inline">🎉 New: Custom Badge Templates & Dark Mode Now Available!</span>
<span class="sm:hidden">🎉 New Features Available!</span>
</div>
<button class="hover:text-gray-200 transition-colors" id="close-announcement">
<i class="fas fa-times"></i>
</button>
</div>
</div>
</div>
<!-- Navigation -->
<nav class="bg-white shadow-sm sticky top-0 left-0 right-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<!-- Logo and Brand -->
<div class="flex items-center">
<a href="/" class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
<i class="fas fa-certificate text-2xl text-white"></i>
</div>
<div>
<h1 class="text-xl font-bold text-gray-900">BadgeForge</h1>
<p class="text-xs text-gray-500">Professional Badge Generator</p>
</div>
</a>
</div>
<!-- Navigation Links -->
<div class="hidden md:flex md:items-center md:space-x-6">
<a href="#features" class="text-gray-500 hover:text-gray-900">Features</a>
<a href="#templates" class="text-gray-500 hover:text-gray-900">Templates</a>
<a href="#pricing" class="text-gray-500 hover:text-gray-900">Pricing</a>
<a href="#docs" class="text-gray-500 hover:text-gray-900">Docs</a>
<button id="theme-toggle" class="p-2 rounded-lg bg-gray-100 hover:bg-gray-200">
<i class="far fa-moon"></i>
</button>
</div>
<!-- Mobile Menu Button -->
<div class="md:hidden flex items-center">
<button class="p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary">
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
</nav>
<!-- Mobile Navigation Menu -->
<div class="hidden md:hidden bg-white border-b border-gray-200" id="mobile-menu">
<div class="px-2 pt-2 pb-3 space-y-1">
<a href="#features" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Features</a>
<a href="#templates" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Templates</a>
<a href="#pricing" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Pricing</a>
<a href="#docs" class="block px-3 py-2 rounded-md text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-50">Documentation</a>
</div>
</div>
<style>
.github-blue {
background-color: #0366d6;
}
.github-blue-text {
color: #0366d6;
}
.legal-list li {
margin-bottom: 1rem;
padding-left: 1.5rem;
position: relative;
}
.legal-list li::before {
content: "•";
position: absolute;
left: 0;
color: #0366d6;
font-weight: bold;
}
</style>
</head>
<body class="bg-gray-50">
<!-- Your existing header goes here -->
<main>
<!-- Hero Section -->
<section class="relative github-blue py-20">
<div class="absolute inset-0">
<div class="absolute inset-0 bg-black opacity-10"></div>
<svg class="absolute inset-0 h-full w-full" xmlns="http://www.w3.org/2000/svg">
<pattern id="hero-pattern" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse">
<path d="M0 40V0H40" fill="none" stroke="currentColor" stroke-opacity="0.1"></path>
</pattern>
<rect width="100%" height="100%" fill="url(#hero-pattern)"></rect>
</svg>
</div>
<div class="relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<h1 class="text-4xl font-extrabold tracking-tight text-white sm:text-5xl">
DMCA Policy
</h1>
<p class="mt-6 text-xl text-gray-100 max-w-3xl mx-auto">
Our commitment to protecting intellectual property rights
</p>
<p class="mt-4 text-sm text-gray-200">
Last Updated: 2025-04-15
</p>
</div>
</section>
<!-- Main Content -->
<section class="py-16 bg-white">
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
<!-- Introduction -->
<div class="prose max-w-none">
<p class="text-lg text-gray-700 mb-8">
This Digital Millennium Copyright Act (DMCA) policy outlines the procedures for notifying GitHub Badge Generator of copyright infringement and how we handle such notifications in accordance with the DMCA.
</p>
<!-- Filing a DMCA Notice -->
<div class="mb-12">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Filing a DMCA Notice</h2>
<div class="bg-gray-50 rounded-lg p-6 mb-6">
<p class="text-gray-700 mb-4">
If you believe that content on GitHub Badge Generator infringes your copyright, please send a detailed DMCA notice to:
</p>
<div class="github-blue-text font-medium">
<p>Email: dmca@githubbadgegenerator.com</p>
<p>Address: [Your Company Address]</p>
</div>
</div>
<h3 class="text-xl font-semibold text-gray-900 mb-4">Your notice must include:</h3>
<ul class="legal-list text-gray-700 mb-6">
<li>A physical or electronic signature of the copyright owner or authorized agent</li>
<li>Identification of the copyrighted work claimed to be infringed</li>
<li>Identification of the infringing material and its location</li>
<li>Your contact information (address, telephone number, email)</li>
<li>A statement of good faith belief that the use is not authorized</li>
<li>A statement under penalty of perjury that the information is accurate and you are authorized to act on behalf of the copyright owner</li>
</ul>
</div>
<!-- Counter Notice -->
<div class="mb-12">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Filing a Counter Notice</h2>
<p class="text-gray-700 mb-4">
If you believe your content was wrongly removed due to a DMCA notice, you may file a counter notice containing:
</p>
<ul class="legal-list text-gray-700 mb-6">
<li>Your physical or electronic signature</li>
<li>Identification of the removed material and its previous location</li>
<li>A statement under penalty of perjury that you have a good faith belief the material was removed by mistake or misidentification</li>
<li>Your consent to local federal court jurisdiction</li>
<li>Your contact information</li>
</ul>
</div>
<!-- Repeat Infringers -->
<div class="mb-12">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Repeat Infringer Policy</h2>
<div class="bg-gray-50 rounded-lg p-6">
<p class="text-gray-700 mb-4">
We maintain a strict policy for dealing with repeat copyright infringers:
</p>
<ul class="legal-list text-gray-700">
<li>Account holders who receive multiple DMCA notices may have their accounts terminated</li>
<li>We track repeated violations to identify patterns of abuse</li>
<li>Terminated accounts may not create new accounts without explicit permission</li>
</ul>
</div>
</div>
<!-- Modifications -->
<div class="mb-12">
<h2 class="text-2xl font-bold text-gray-900 mb-4">Modifications to Policy</h2>
<p class="text-gray-700">
We reserve the right to modify this DMCA policy at any time. Changes will be effective immediately upon posting to our website. Your continued use of GitHub Badge Generator after modifications indicates your acceptance of the updated policy.
</p>
</div>
<!-- DMCA Form -->
<div class="mt-12 bg-gray-50 rounded-lg p-8">
<h2 class="text-2xl font-bold text-gray-900 mb-6">Submit DMCA Notice</h2>
<form id="dmca-form" class="space-y-6">
<div>
<label for="name" class="block text-sm font-medium text-gray-700">Full Name</label>
<input type="text" id="name" name="name" required
class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-md shadow-sm
focus:ring-[#0366d6] focus:border-[#0366d6] focus:outline-none">
</div>
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email Address</label>
<input type="email" id="email" name="email" required
class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-md shadow-sm
focus:ring-[#0366d6] focus:border-[#0366d6] focus:outline-none">
</div>
<div>
<label for="work" class="block text-sm font-medium text-gray-700">Original Work Description</label>
<textarea id="work" name="work" rows="3" required
class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-md shadow-sm
focus:ring-[#0366d6] focus:border-[#0366d6] focus:outline-none"></textarea>
</div>
<div>
<label for="location" class="block text-sm font-medium text-gray-700">Infringing Content Location</label>
<input type="url" id="location" name="location" required
class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-md shadow-sm
focus:ring-[#0366d6] focus:border-[#0366d6] focus:outline-none"
placeholder="https://">
</div>
<div>
<label for="statement" class="block text-sm font-medium text-gray-700">Statement of Good Faith</label>
<textarea id="statement" name="statement" rows="4" required
class="mt-1 block w-full px-4 py-3 border border-gray-300 rounded-md shadow-sm
focus:ring-[#0366d6] focus:border-[#0366d6] focus:outline-none"></textarea>
</div>
<div class="flex items-start">
<input type="checkbox" id="agreement" name="agreement" required
class="mt-1 h-4 w-4 text-[#0366d6] focus:ring-[#0366d6] border-gray-300 rounded">
<label for="agreement" class="ml-2 block text-sm text-gray-700">
I declare under penalty of perjury that the information in this notice is accurate and that I am authorized to act on behalf of the copyright owner.
</label>
</div>
<button type="submit"
class="w-full github-blue text-white px-6 py-3 rounded-md hover:bg-blue-700
transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#0366d6]">
Submit DMCA Notice
</button>
</form>
</div>
</div>
</div>
</section>
<!-- Help Section -->
<section class="py-16 bg-gray-50">
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<h2 class="text-2xl font-bold text-gray-900 mb-6">Need Help?</h2>
<p class="text-gray-700 mb-8">
If you have questions about our DMCA policy or need assistance with a copyright issue, please contact our support team.
</p>
<a href="/contact"
class="inline-flex items-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white github-blue hover:bg-blue-700 transition-colors duration-200">
Contact Support
<svg class="ml-2 -mr-1 w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"/>
</svg>
</a>
</div>
</section>
</main>
<!-- Your existing footer goes here -->
<script>
// Form submission handling
document.getElementById('dmca-form').addEventListener('submit', async (e) => {
e.preventDefault();
const form = e.target;
const submitButton = form.querySelector('button[type="submit"]');
const originalButtonText = submitButton.textContent;
// Show loading state
submitButton.disabled = true;
submitButton.innerHTML = `
<svg class="animate-spin -ml-1 mr-3 h-5 w-5 text-white inline" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
Submitting...
`;
try {
// Simulate API call
await new Promise(resolve => setTimeout(resolve, 1500));
// Show success message
form.innerHTML = `
<div class="text-center success-animation">
<svg class="w-16 h-16 mx-auto text-green-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<h3 class="text-xl font-bold text-gray-900 mb-2">Notice Submitted Successfully</h3>
<p class="text-gray-600">We will review your DMCA notice and take appropriate action.</p>
</div>
`;
} catch (error) {
// Show error message
submitButton.disabled = false;
submitButton.textContent = originalButtonText;
alert('Failed to submit DMCA notice. Please try again.');
}
});
</script>
<!-- Footer -->
<footer class="bg-gray-900 text-white pt-20 pb-10">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<!-- Footer Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12 mb-16">
<!-- Company Info -->
<div class="space-y-6">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-lg bg-white/10 flex items-center justify-center">
<i class="fas fa-certificate text-2xl text-white"></i>
</div>
<div>
<h3 class="text-xl font-bold">BadgeForge</h3>
<p class="text-sm text-gray-400">Professional Badge Generator</p>
</div>
</div>
<p class="text-gray-400">
Creating professional GitHub badges has never been easier. Join thousands of developers using BadgeForge.
</p>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-white transition-colors">
<i class="fab fa-github text-xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition-colors">
<i class="fab fa-twitter text-xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition-colors">
<i class="fab fa-discord text-xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition-colors">
<i class="fab fa-linkedin text-xl"></i>
</a>
</div>
</div>
<!-- Quick Links -->
<div>
<h3 class="text-lg font-semibold mb-6">Quick Links</h3>
<ul class="space-y-4">
<li><a href="#features" class="text-gray-400 hover:text-white transition-colors">Features</a></li>
<li><a href="#templates" class="text-gray-400 hover:text-white transition-colors">Templates</a></li>
<li><a href="#pricing" class="text-gray-400 hover:text-white transition-colors">Pricing</a></li>
<li><a href="#docs" class="text-gray-400 hover:text-white transition-colors">Documentation</a></li>
<li><a href="#blog" class="text-gray-400 hover:text-white transition-colors">Blog</a></li>
</ul>
</div>
<!-- Resources -->
<div>
<h3 class="text-lg font-semibold mb-6">Resources</h3>
<ul class="space-y-4">
<li><a href="#" class="text-gray-400 hover:text-white transition-colors">API Reference</a></li>
<li><a href="#" class="text-gray-400 hover:text-white transition-colors">Status Page</a></li>
<li><a href="#" class="text-gray-400 hover:text-white transition-colors">GitHub Integration</a></li>
<li><a href="#" class="text-gray-400 hover:text-white transition-colors">Support Center</a></li>
<li><a href="#" class="text-gray-400 hover:text-white transition-colors">Custom Solutions</a></li>
</ul>
</div>
<!-- Newsletter -->
<div>
<h3 class="text-lg font-semibold mb-6">Stay Updated</h3>
<p class="text-gray-400 mb-4">
Subscribe to our newsletter for the latest updates and features.
</p>
<form class="space-y-4">
<input type="email" placeholder="Enter your email"
class="w-full px-4 py-2 rounded-md bg-gray-800 border border-gray-700 text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary">
<button type="submit" class="w-full px-4 py-2 bg-primary text-white rounded-md hover:bg-primary-dark transition-colors">
Subscribe
</button>
</form>
</div>
</div>
<!-- Bottom Bar -->
<div class="pt-8 border-t border-gray-800">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<!-- Copyright -->
<div class="text-gray-400 text-sm">
© 2025 BadgeForge. All rights reserved.
<div class="current-time mt-1">
Current Time (UTC): <span id="footer-time">2025-04-14 10:55:04</span>
</div>
</div>
<!-- Legal Links -->
<div class="flex space-x-6 md:justify-end text-sm">
<a href="#" class="text-gray-400 hover:text-white transition-colors">Privacy Policy</a>
<a href="#" class="text-gray-400 hover:text-white transition-colors">Terms of Service</a>
<a href="#" class="text-gray-400 hover:text-white transition-colors">Cookie Policy</a>
</div>
</div>
</div>
</div>
</footer>
<!-- Toast Notifications -->
<div id="toast-container" class="fixed bottom-4 right-4 z-50 space-y-4"></div>
<script>
class BadgeGenerator {
constructor() {
this.baseUrl = 'https://img.shields.io';
this.currentCategory = 'build';
this.init();
}
init() {
this.setupTimeUpdate();
this.setupCategoryNavigation();
this.setupEventListeners();
// Show initial category
this.showCategory('build');
}
setupTimeUpdate() {
const updateTime = () => {
const now = new Date();
const timeString = now.toISOString().replace('T', ' ').substring(0, 19);
document.getElementById('current-time').textContent = timeString;
};
updateTime();
setInterval(updateTime, 1000);
}
setupCategoryNavigation() {
const buttons = document.querySelectorAll('.category-btn');
buttons.forEach(button => {
button.addEventListener('click', () => {
// Remove active class from all buttons
buttons.forEach(btn => {
btn.classList.remove('bg-indigo-600', 'text-white');
btn.classList.add('bg-gray-200', 'hover:bg-gray-300');
});
// Add active class to clicked button
button.classList.remove('bg-gray-200', 'hover:bg-gray-300');
button.classList.add('bg-indigo-600', 'text-white');
// Update category
const category = button.dataset.category;
this.currentCategory = category;
this.showCategory(category);
});
});
}
setupEventListeners() {
document.getElementById('generate-badge').addEventListener('click', () => this.generateBadge());
document.getElementById('copy-markdown').addEventListener('click', () => this.copyToClipboard('markdown'));
document.getElementById('copy-html').addEventListener('click', () => this.copyToClipboard('html'));
document.getElementById('reset-form').addEventListener('click', () => this.resetForm());
// Handle logo selection
document.getElementById('badge-logo').addEventListener('change', (e) => {
const customLogoInput = document.getElementById('custom-logo');
customLogoInput.style.display = e.target.value === 'custom' ? 'block' : 'none';
});
}
showCategory(category) {
// Update form fields based on category
const typeSelect = document.getElementById('badge-type');
const labelInput = document.getElementById('badge-label');
const messageInput = document.getElementById('badge-message');
switch(category) {
case 'build':
this.updateBuildOptions();
break;
case 'testing':
this.updateTestingOptions();
break;
case 'package':
this.updatePackageOptions();
break;
case 'version':
this.updateVersionOptions();
break;
case 'license':
this.updateLicenseOptions();
break;
case 'tech':
this.updateTechOptions();
break;
case 'stats':
this.updateStatsOptions();
break;
case 'quality':
this.updateQualityOptions();
break;
case 'social':
this.updateSocialOptions();
break;
}
}
updateBuildOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="workflow">GitHub Actions Workflow</option>
<option value="travis">Travis CI</option>
<option value="circle">CircleCI</option>
<option value="jenkins">Jenkins</option>
<option value="azure">Azure Pipelines</option>
`;
document.getElementById('badge-label').value = 'build';
document.getElementById('badge-message').value = 'passing';
}
updateTestingOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="tests">Tests</option>
<option value="coverage">Code Coverage</option>
<option value="codecov">Codecov</option>
<option value="coveralls">Coveralls</option>
<option value="codeclimate">Code Climate Coverage</option>
`;
document.getElementById('badge-label').value = 'coverage';
document.getElementById('badge-message').value = '100%';
}
updatePackageOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="npm">npm Package</option>
<option value="pypi">PyPI Package</option>
<option value="composer">Composer Package</option>
<option value="nuget">NuGet Package</option>
<option value="maven">Maven Package</option>
`;
document.getElementById('badge-label').value = 'version';
document.getElementById('badge-message').value = '1.0.0';
}
updateVersionOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="release">GitHub Release</option>
<option value="tag">Latest Tag</option>
<option value="pre-release">Pre-release</option>
<option value="manifest">Manifest Version</option>
`;
document.getElementById('badge-label').value = 'version';
document.getElementById('badge-message').value = 'v1.0.0';
}
updateLicenseOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="github-license">GitHub License</option>
<option value="npm-license">npm License</option>
<option value="custom-license">Custom License</option>
`;
document.getElementById('badge-label').value = 'license';
document.getElementById('badge-message').value = 'MIT';
}
updateTechOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="language">Programming Language</option>
<option value="framework">Framework</option>
<option value="platform">Platform</option>
<option value="database">Database</option>
`;
document.getElementById('badge-label').value = 'made with';
document.getElementById('badge-message').value = 'javascript';
}
updateStatsOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="stars">GitHub Stars</option>
<option value="forks">GitHub Forks</option>
<option value="issues">GitHub Issues</option>
<option value="downloads">Downloads</option>
`;
document.getElementById('badge-label').value = 'stars';
document.getElementById('badge-message').value = '1k';
}
updateQualityOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="codeclimate">Code Climate</option>
<option value="codefactor">CodeFactor</option>
<option value="codacy">Codacy</option>
<option value="sonar">SonarCloud</option>
`;
document.getElementById('badge-label').value = 'quality';
document.getElementById('badge-message').value = 'A';
}
updateSocialOptions() {
const typeSelect = document.getElementById('badge-type');
typeSelect.innerHTML = `
<option value="twitter">Twitter Follow</option>
<option value="discord">Discord</option>
<option value="youtube">YouTube</option>
<option value="reddit">Reddit</option>
`;
document.getElementById('badge-label').value = 'follow';
document.getElementById('badge-message').value = '@username';
}
generateBadge() {
const repo = document.getElementById('repo-input').value;
const type = document.getElementById('badge-type').value;
const style = document.getElementById('badge-style').value;
const label = document.getElementById('badge-label').value;
const message = document.getElementById('badge-message').value;
const color = document.querySelector('[data-color].selected')?.dataset.color || 'blue';
let badgeUrl = '';
switch(this.currentCategory) {
case 'build':
badgeUrl = `${this.baseUrl}/github/workflow/status/${repo}/${type}?style=${style}`;
break;
case 'testing':
badgeUrl = type === 'coverage'
? `${this.baseUrl}/codecov/c/github/${repo}?style=${style}`
: `${this.baseUrl}/github/workflow/status/${repo}/tests?label=tests&style=${style}`;
break;
// Add cases for other categories...
}
this.updatePreview(badgeUrl);
this.updateOutputs(badgeUrl);
}
// Add other necessary methods (updatePreview, copyToClipboard, etc.)
}
// Initialize
document.addEventListener('DOMContentLoaded', () => {
new BadgeGenerator();
});
</script>
<!-- Scripts -->
<script src="main.js"></script>
</body>
</html>