Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1294 lines (1173 loc) · 87.3 KB
/
Copy pathindex.html
File metadata and controls
1294 lines (1173 loc) · 87.3 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
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!--
KD Notifications | Demo & Documentation
This file is designed as a standalone, zero-build HTML document.
The single-file structure is optimized for maximum portability,
allowing developers to easily inspect the source code and
copy-paste examples directly into their projects without setup.
-->
<!DOCTYPE html>
<html lang="en" class="scroll-smooth scroll-pt-10 dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z2BQP6ND9C"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Z2BQP6ND9C');
</script>
<title>KD Notifications by KhvichaDev | Professional Toast System for Modern Web</title>
<meta name="description" content="KD Notifications by KhvichaDev — A zero-dependency, elegantly designed toast notification library for the modern web. Features auto-theming, XSS protection, and full accessibility.">
<meta name="keywords" content="KhvichaDev, KD Notifications, toast notifications, javascript notification, zero-dependency, vanilla js, react toast, vue toast, accessible popup, lightweight modal">
<meta name="author" content="KhvichaDev">
<meta name="robots" content="index, follow">
<meta name="google-site-verification" content="FyqoiMph9CXf336RBGlLbW2uOm1x3ORa17bZ-4-LCvI" />
<link rel="canonical" href="https://khvichadev.github.io/notifications-kd/">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:title" content="KD Notifications by KhvichaDev | Professional Toast System">
<meta property="og:description" content="A zero-dependency, elegantly designed toast notification library for the modern web. Features auto-theming, XSS protection, and full accessibility.">
<meta property="og:image" content="https://raw.githubusercontent.com/KhvichaDev/notifications-kd/main/open-graph-image.png">
<meta property="og:url" content="https://khvichadev.github.io/notifications-kd/">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="KD Notifications by KhvichaDev">
<meta name="twitter:description" content="A zero-dependency, elegantly designed toast notification library for the modern web.">
<meta name="twitter:image" content="https://raw.githubusercontent.com/KhvichaDev/notifications-kd/main/open-graph-image.png">
<!-- Schema.org JSON-LD -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "KD Notifications",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any",
"description": "A zero-dependency, elegantly designed toast notification library for the modern web. Crafted by KhvichaDev.",
"url": "https://khvichadev.github.io/notifications-kd/",
"image": "https://raw.githubusercontent.com/KhvichaDev/notifications-kd/main/open-graph-image.png",
"author": { "@type": "Person", "name": "KhvichaDev", "url": "https://khvichadev.com" },
"license": "https://opensource.org/licenses/MIT",
"offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" },
"softwareVersion": "1.2.3",
"programmingLanguage": "JavaScript"
}
</script>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect rx='20' width='100' height='100' fill='%234da6ff'/><g transform='translate(20, 20) scale(2.5)' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'><path d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/><path d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/></g></svg>">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://cdn.tailwindcss.com">
<!-- Load Google Fonts asynchronously to prevent render-blocking -->
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap"></noscript>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: 'rgb(var(--kd-primary-rgb) / <alpha-value>)',
dark: { 900: '#0f172a', 800: '#1e293b', 700: '#334155' }
}
}
}
}
</script>
<!-- ========================================== -->
<!-- CSS STYLES -->
<!-- ========================================== -->
<style>
:root {
--kd-primary-rgb: 37 99 235; /* blue-600 logic */
}
html.dark {
--kd-primary-rgb: 77 166 255; /* sky-400 logic */
}
body { font-family: 'Inter', sans-serif; }
.glass {
background: rgba(15, 23, 42, 0.04);
backdrop-filter: blur(10px);
border: 1px solid rgba(15, 23, 42, 0.1);
}
html.dark .glass {
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.05);
}
.pos-grid-btn.active,
.playground-theme-btn.active {
background-color: rgb(var(--kd-primary-rgb) / 0.15);
color: rgb(var(--kd-primary-rgb));
border-color: rgb(var(--kd-primary-rgb) / 0.4);
box-shadow: 0 0 0 3px rgb(var(--kd-primary-rgb) / 0.1);
}
.type-btn.active {
box-shadow: 0 0 0 1px currentColor;
}
.code-token-key { color: #60a5fa; }
.code-token-string { color: #34d399; }
.code-token-num { color: #fb923c; }
/* Custom scrollbars for code blocks. Note: This uses WebKit-specific pseudo-elements and will not apply to Firefox natively. */
pre::-webkit-scrollbar { width: 6px; height: 6px; }
pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
.fade-in-up {
opacity: 0;
transform: translateY(30px);
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible {
opacity: 1;
transform: translateY(0);
}
#back-to-top {
transition: opacity 0.3s, transform 0.3s;
}
#back-to-top.hidden-btn {
opacity: 0;
transform: translateY(20px);
pointer-events: none;
}
.feature-card {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
transform: translateY(-4px);
}
.hero-pill {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 14px;
border-radius: 9999px;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.3px;
border: 1px solid rgba(255, 255, 255, 0.08);
background: rgba(255, 255, 255, 0.04);
backdrop-filter: blur(8px);
transition: transform 0.2s ease, background 0.2s ease;
}
@media (min-width: 640px) {
.hero-pill {
gap: 8px;
padding: 8px 18px;
font-size: 13px;
}
}
.hero-pill:hover {
transform: translateY(-2px);
background: rgba(255, 255, 255, 0.08);
}
html:not(.dark) .hero-pill {
border-color: rgba(15, 23, 42, 0.08);
background: rgba(15, 23, 42, 0.03);
}
html:not(.dark) .hero-pill:hover {
background: rgba(15, 23, 42, 0.06);
}
.hero-pill .pill-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
}
@media (min-width: 640px) {
.hero-pill .pill-icon {
width: 18px;
height: 18px;
}
}
.mobile-nav-link.nav-active {
background-color: rgba(77, 166, 255, 0.12);
color: #4da6ff;
}
</style>
<!-- ========================================== -->
<!-- HTML CONTENT -->
<!-- ========================================== -->
</head>
<body class="bg-white dark:bg-dark-900 text-slate-800 dark:text-slate-300 transition-colors duration-300">
<!-- Navigation -->
<nav class="fixed top-0 w-full z-50 bg-white/85 dark:bg-dark-900/85 backdrop-blur-md border-b border-slate-200/50 dark:border-slate-800/50 shadow-sm transition-colors" aria-label="Main navigation">
<div class="max-w-7xl mx-auto px-4 h-16 flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-8 h-8 bg-primary rounded-lg flex items-center justify-center shadow-lg shadow-primary/20">
<i data-lucide="bell" class="text-white w-5 h-5"></i>
</div>
<span class="font-extrabold text-lg sm:text-xl tracking-tight leading-none text-slate-900 dark:text-white">KD <span class="text-primary">Notifications</span></span>
</div>
<div class="hidden md:flex items-center gap-8 text-sm font-medium">
<a href="#features" class="hover:text-primary transition-colors">Features</a>
<a href="#playground" class="hover:text-primary transition-colors">Playground</a>
<a href="#docs" class="hover:text-primary transition-colors">Docs</a>
</div>
<div class="flex items-center gap-1.5 sm:gap-3">
<button onclick="toggleTheme()" class="p-2 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 transition-colors border border-black/5 dark:border-white/5" id="theme-btn" aria-label="Toggle theme">
<i data-lucide="sun" class="hidden dark:block w-5 h-5 text-yellow-400"></i>
<i data-lucide="moon" class="block dark:hidden w-5 h-5 text-slate-600"></i>
</button>
<!-- Mobile Menu Toggle -->
<button onclick="toggleMobileMenu()" class="md:hidden p-2 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 transition-colors border border-black/5 dark:border-white/5" id="mobile-menu-btn" aria-label="Toggle menu" aria-controls="mobile-menu" aria-expanded="false">
<i data-lucide="menu" class="w-5 h-5"></i>
</button>
<a href="https://www.npmjs.com/package/notifications-kd" target="_blank" rel="noopener noreferrer" class="hidden sm:flex items-center gap-2 bg-red-500/10 text-red-600 dark:text-red-400 px-4 py-2 rounded-xl text-sm font-bold hover:bg-red-500/20 transition-all border border-red-500/20" aria-label="View on npm">
<i data-lucide="package" class="w-4 h-4"></i> npm
</a>
<a href="https://github.com/KhvichaDev/notifications-kd" target="_blank" rel="noopener noreferrer" class="bg-slate-900 dark:bg-white text-white dark:text-slate-900 px-4 py-2 rounded-xl text-sm font-bold hover:opacity-90 transition-opacity flex items-center gap-2 border border-slate-900 dark:border-white" aria-label="View on GitHub">
<i data-lucide="github" class="w-4 h-4"></i> <span class="hidden sm:inline">GitHub</span>
</a>
</div>
</div>
<!-- Mobile Menu -->
<div id="mobile-menu" class="md:hidden hidden border-t border-black/5 dark:border-white/5 bg-white/80 dark:bg-dark-900/80 backdrop-blur-lg shadow-[0_8px_30px_rgba(0,0,0,0.12)] dark:shadow-[0_8px_30px_rgba(0,0,0,0.4)]">
<div class="px-4 py-4 flex flex-col gap-2">
<a href="#features" onclick="closeMobileMenu()" class="mobile-nav-link px-4 py-3 rounded-xl hover:bg-primary/10 hover:text-primary active:bg-primary/20 active:text-primary font-medium transition-all">Features</a>
<a href="#playground" onclick="closeMobileMenu()" class="mobile-nav-link px-4 py-3 rounded-xl hover:bg-primary/10 hover:text-primary active:bg-primary/20 active:text-primary font-medium transition-all">Playground</a>
<a href="#docs" onclick="closeMobileMenu()" class="mobile-nav-link px-4 py-3 rounded-xl hover:bg-primary/10 hover:text-primary active:bg-primary/20 active:text-primary font-medium transition-all">Docs</a>
<a href="https://www.npmjs.com/package/notifications-kd" target="_blank" rel="noopener noreferrer" class="sm:hidden px-4 py-3 rounded-xl hover:bg-red-500/10 hover:text-red-500 active:bg-red-500/20 font-medium transition-all flex items-center gap-2 text-red-600 dark:text-red-400">
<i data-lucide="package" class="w-4 h-4"></i> npm
</a>
</div>
</div>
</nav>
<!-- Main Content -->
<main id="main-content">
<!-- Hero Section -->
<section class="pt-24 sm:pt-32 pb-12 sm:pb-20 px-4 overflow-hidden">
<div class="max-w-7xl mx-auto text-center relative">
<div class="absolute -top-24 left-1/2 -translate-x-1/2 w-96 h-96 bg-primary/10 blur-[120px] rounded-full pointer-events-none"></div>
<a href="https://github.com/KhvichaDev/notifications-kd/releases" target="_blank" rel="noopener noreferrer" class="inline-block py-1 px-3 rounded-full bg-primary/10 text-primary text-xs font-bold mb-6 tracking-widest uppercase hover:bg-primary/20 transition-colors" id="version-badge">See What's New →</a>
<h1 class="text-4xl sm:text-5xl md:text-7xl font-black text-slate-900 dark:text-white mb-6 leading-tight">
The last notifications library <br> <span class="text-primary italic">you'll ever need.</span>
</h1>
<p class="max-w-2xl mx-auto text-base sm:text-lg text-slate-600 dark:text-slate-400 mb-8 leading-relaxed">
Zero setup. Fully customizable. <span class="text-slate-800 dark:text-slate-200 font-semibold">It just works</span> — from React to plain HTML.
</p>
<!-- Hero Feature Pills -->
<div class="flex flex-wrap items-center justify-center gap-2 sm:gap-3 mb-6 sm:mb-8 max-w-3xl mx-auto">
<span class="hero-pill text-emerald-600 dark:text-emerald-400">
<i data-lucide="unplug" class="pill-icon"></i> Zero Dependencies
</span>
<span class="hero-pill text-cyan-600 dark:text-cyan-400">
<i data-lucide="zap" class="pill-icon"></i> <span id="bundle-size-label">~4KB gzipped</span>
</span>
<span class="hero-pill text-emerald-600 dark:text-emerald-400">
<i data-lucide="shield-check" class="pill-icon"></i> XSS Protected
</span>
<span class="hero-pill text-amber-600 dark:text-amber-400">
<i data-lucide="sun-moon" class="pill-icon"></i> Auto Dark / Light
</span>
<span class="hero-pill text-pink-600 dark:text-pink-400">
<i data-lucide="smartphone" class="pill-icon"></i> Responsive
</span>
<span class="hero-pill text-indigo-600 dark:text-indigo-400">
<i data-lucide="accessibility" class="pill-icon"></i> WCAG Accessible
</span>
</div>
<div class="flex flex-col sm:flex-row items-center justify-center gap-5 sm:gap-4">
<a href="#playground" class="w-full sm:w-auto bg-primary hover:bg-primary-dark text-white px-6 py-3.5 sm:px-8 sm:py-4 rounded-2xl font-bold text-base sm:text-lg shadow-md shadow-primary/20 sm:shadow-xl transition-all flex items-center justify-center gap-2">
<i data-lucide="rocket" class="w-5 h-5"></i> Try It Live
</a>
<a href="#docs" class="w-full sm:w-auto bg-slate-100 dark:bg-dark-800 hover:bg-slate-200 dark:hover:bg-dark-700 px-6 py-3.5 sm:px-8 sm:py-4 rounded-2xl font-bold text-base sm:text-lg transition-all border border-black/5 dark:border-white/5 flex items-center justify-center gap-2">
<i data-lucide="book-open" class="w-5 h-5"></i> Quick Start
</a>
</div>
<!-- Dashboard Preview -->
<div class="mt-12 sm:mt-20 glass rounded-3xl p-2 max-w-4xl mx-auto shadow-2xl relative fade-in-up">
<div class="relative w-full aspect-[16/10] rounded-2xl overflow-hidden shadow-inner bg-slate-900" id="yt-container">
<div id="yt-facade" class="absolute inset-0 cursor-pointer group" onclick="loadYouTubeVideo()" role="button" tabindex="0" aria-label="Play YouTube Demo Video" onkeydown="if(event.key === 'Enter' || event.key === ' ') { event.preventDefault(); loadYouTubeVideo(); }">
<img src="https://i.ytimg.com/vi_webp/kdg47xX_sU4/maxresdefault.webp" alt="KD Notifications Demo" fetchpriority="high" class="absolute inset-0 w-full h-full object-cover opacity-80 group-hover:opacity-100 transition-opacity duration-300">
<div class="absolute inset-0 flex items-center justify-center">
<div class="w-16 h-16 sm:w-20 sm:h-20 bg-primary/90 rounded-full flex items-center justify-center shadow-lg shadow-primary/30 group-hover:scale-110 group-hover:bg-primary transition-all duration-300">
<i data-lucide="play" class="w-8 h-8 sm:w-10 sm:h-10 text-white ml-1"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Grid -->
<section id="features" class="py-12 sm:py-24 bg-slate-50 dark:bg-dark-800/50">
<div class="max-w-7xl mx-auto px-4">
<div class="text-center mb-10 sm:mb-16 fade-in-up">
<h2 class="text-2xl sm:text-3xl font-black text-slate-900 dark:text-white mb-4">Why KD Notifications?</h2>
<div class="h-1.5 w-20 bg-primary mx-auto rounded-full"></div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-6">
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-blue-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="zap" class="text-blue-600 dark:text-blue-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">Lightweight & Fast</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">No dependencies, no external CSS. A fully self-contained library that injects its own styles and loads instantly.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-purple-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="palette" class="text-purple-600 dark:text-purple-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">Fully Customizable</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Colors, positions, animations, icons, and themes — all configurable with CSS variables or the style API.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-emerald-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="shield-check" class="text-emerald-600 dark:text-emerald-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">XSS Protected</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Built-in DOM-based sanitization with strict whitelisting, SVG/Math blocking, and control-character filtering.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-amber-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="sun-moon" class="text-amber-600 dark:text-amber-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">Smart Auto-Theming</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Automatically detects your page's background color and system preferences to match Light or Dark mode seamlessly.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-indigo-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="accessibility" class="text-indigo-600 dark:text-indigo-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">WCAG Accessible</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Focus trap, automatic focus restoration, Esc-key dismiss, and prefers-reduced-motion integration out of the box.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-pink-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="smartphone" class="text-pink-600 dark:text-pink-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">Mobile-Ready</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Fully responsive layout with native Safe Area support for notches, Dynamic Island, and all modern screen cutouts.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-cyan-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="git-branch" class="text-cyan-600 dark:text-cyan-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">Promise-Based API</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Every notification returns a Promise. Build interactive confirmation dialogs with async/await or .then() chains.</p>
</div>
<div class="feature-card p-6 sm:p-8 rounded-3xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 hover:shadow-xl fade-in-up">
<div class="w-10 h-10 sm:w-12 sm:h-12 bg-rose-500/10 rounded-2xl flex items-center justify-center mb-4 sm:mb-6">
<i data-lucide="map-pin" class="text-rose-600 dark:text-rose-400 w-5 h-5 sm:w-6 sm:h-6"></i>
</div>
<h3 class="text-lg sm:text-xl font-bold text-slate-900 dark:text-white mb-2 sm:mb-3">Smart Positioning</h3>
<p class="text-slate-600 dark:text-slate-400 text-sm leading-relaxed">Place toasts anywhere on screen with strict CSS unit validation for custom offsets (px, em, rem, vh, vw).</p>
</div>
</div>
</div>
</section>
<!-- Interactive Playground -->
<section id="playground" class="py-12 sm:py-24 px-4">
<div class="max-w-7xl mx-auto">
<div class="flex flex-col md:flex-row items-end justify-between mb-8 sm:mb-12 gap-4 fade-in-up">
<div class="text-left">
<h2 class="text-2xl sm:text-4xl font-black text-slate-900 dark:text-white mb-2">Interactive Playground 🧪</h2>
<p class="text-sm sm:text-base text-slate-500 dark:text-slate-400 leading-relaxed max-w-xl">Configure, preview, and copy ready-to-use code — use it directly in your project</p>
</div>
<div class="hidden md:flex flex-col items-start gap-2">
<span class="text-[10px] sm:text-xs font-black uppercase tracking-widest text-primary ml-2">Playground Theme</span>
<div class="flex gap-2 p-1 bg-slate-100 dark:bg-dark-800 rounded-2xl border border-black/5 dark:border-white/5">
<button onclick="changePlaygroundTheme('auto')" class="playground-theme-btn active px-4 py-2 rounded-xl text-xs font-bold transition-all">AUTO</button>
<button onclick="changePlaygroundTheme('light')" class="playground-theme-btn px-4 py-2 rounded-xl text-xs font-bold transition-all">LIGHT</button>
<button onclick="changePlaygroundTheme('dark')" class="playground-theme-btn px-4 py-2 rounded-xl text-xs font-bold transition-all">DARK</button>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-12 gap-4 sm:gap-8">
<!-- Controls -->
<div class="lg:col-span-5 flex flex-col gap-4 sm:gap-6">
<!-- Playground Theme (Mobile) -->
<div class="md:hidden p-5 sm:p-6 rounded-3xl glass fade-in-up">
<span class="text-[10px] sm:text-xs font-black uppercase tracking-widest text-primary mb-3 sm:mb-4 block">Playground Theme</span>
<div class="grid grid-cols-3 gap-2 p-1 bg-slate-100 dark:bg-dark-800 rounded-2xl border border-black/5 dark:border-white/5">
<button onclick="changePlaygroundTheme('auto')" class="playground-theme-btn active px-2 py-2 rounded-xl text-xs font-bold transition-all">AUTO</button>
<button onclick="changePlaygroundTheme('light')" class="playground-theme-btn px-2 py-2 rounded-xl text-xs font-bold transition-all">LIGHT</button>
<button onclick="changePlaygroundTheme('dark')" class="playground-theme-btn px-2 py-2 rounded-xl text-xs font-bold transition-all">DARK</button>
</div>
</div>
<!-- Notification Type -->
<div class="p-5 sm:p-6 rounded-3xl glass fade-in-up">
<span class="text-[10px] sm:text-xs font-black uppercase tracking-widest text-primary mb-3 sm:mb-4 block">Notification Type</span>
<div class="grid grid-cols-2 gap-2 sm:gap-3">
<button onclick="demo('success', this)" class="type-btn active p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20 font-bold text-sm hover:bg-emerald-500/20 transition-all">Success</button>
<button onclick="demo('error', this)" class="type-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20 font-bold text-sm hover:bg-red-500/20 transition-all">Error</button>
<button onclick="demo('warning', this)" class="type-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20 font-bold text-sm hover:bg-amber-500/20 transition-all">Warning</button>
<button onclick="demo('info', this)" class="type-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20 font-bold text-sm hover:bg-blue-500/20 transition-all">Info</button>
<button onclick="demo('rich', this)" class="type-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-violet-500/10 text-violet-600 dark:text-violet-400 border border-violet-500/20 font-bold text-sm hover:bg-violet-500/20 transition-all flex items-center justify-center gap-2">
<i data-lucide="layout" class="w-4 h-4"></i> Rich Text
</button>
<button onclick="demo('processing', this)" class="type-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border border-cyan-500/20 font-bold text-sm hover:bg-cyan-500/20 transition-all flex items-center justify-center gap-2">
<i data-lucide="loader" class="w-4 h-4"></i> Processing
</button>
<button onclick="demo('modal', this)" class="type-btn col-span-2 p-3 sm:p-4 rounded-xl sm:rounded-2xl bg-primary/10 text-primary border border-primary/20 font-bold text-sm hover:bg-primary/20 transition-all flex items-center justify-center gap-2">
<i data-lucide="message-square" class="w-4 h-4"></i> Modal Dialog
</button>
</div>
</div>
<!-- Custom Text -->
<div class="p-5 sm:p-6 rounded-3xl glass fade-in-up">
<span class="text-[10px] sm:text-xs font-black uppercase tracking-widest text-primary mb-3 sm:mb-4 block">Custom Text</span>
<div class="space-y-2 sm:space-y-3">
<input type="text" id="pg-title" aria-label="Notification Title" placeholder="Title (optional — leave empty for simple layout)" value="" class="w-full bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-xl px-4 py-3 text-sm font-medium focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all placeholder:text-slate-500 dark:placeholder:text-slate-400" oninput="userModifiedTitle = true; syncInputToOptions()">
<input type="text" id="pg-message" aria-label="Notification Message" placeholder="Message" value="Data synced successfully!" class="w-full bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-xl px-4 py-3 text-sm font-medium focus:outline-none focus:ring-2 focus:ring-primary/40 transition-all placeholder:text-slate-500 dark:placeholder:text-slate-400" oninput="userModifiedMessage = true; syncInputToOptions()">
</div>
</div>
<!-- Duration -->
<div class="p-5 sm:p-6 rounded-3xl glass fade-in-up">
<div class="flex items-center justify-between mb-2 sm:mb-3">
<label for="pg-duration" class="text-[10px] sm:text-xs font-black uppercase tracking-widest text-primary">Duration</label>
<span id="duration-val" class="text-xs font-bold text-primary">3000ms</span>
</div>
<input type="range" id="pg-duration" aria-label="Notification Duration" min="0" max="10000" step="500" value="3000" oninput="updateDuration(this.value)" class="w-full accent-primary">
</div>
<!-- Screen Position -->
<div class="p-5 sm:p-6 rounded-3xl glass fade-in-up">
<span class="text-[10px] sm:text-xs font-black uppercase tracking-widest text-primary mb-4 sm:mb-6 block">Screen Position</span>
<div class="grid grid-cols-2 gap-2 sm:gap-3 mx-auto max-w-[200px] sm:max-w-none">
<button data-pos="top-left" aria-label="Position Top Left" onclick="updatePos('top-left', this)" class="pos-grid-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl border border-black/10 dark:border-white/10 hover:border-primary/40 transition-all flex items-center justify-center"><i data-lucide="arrow-up-left" class="w-5 h-5"></i></button>
<button data-pos="top-right" aria-label="Position Top Right" onclick="updatePos('top-right', this)" class="pos-grid-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl border border-black/10 dark:border-white/10 hover:border-primary/40 transition-all flex items-center justify-center"><i data-lucide="arrow-up-right" class="w-5 h-5"></i></button>
<button data-pos="center" aria-label="Position Center" onclick="updatePos('center', this)" class="pos-grid-btn col-span-2 justify-self-center p-3 sm:p-4 rounded-xl sm:rounded-2xl border border-black/10 dark:border-white/10 hover:border-primary/40 transition-all flex items-center justify-center active" style="width:calc(50% - 4px)"><i data-lucide="maximize" class="w-5 h-5"></i></button>
<button data-pos="bottom-left" aria-label="Position Bottom Left" onclick="updatePos('bottom-left', this)" class="pos-grid-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl border border-black/10 dark:border-white/10 hover:border-primary/40 transition-all flex items-center justify-center"><i data-lucide="arrow-down-left" class="w-5 h-5"></i></button>
<button data-pos="bottom-right" aria-label="Position Bottom Right" onclick="updatePos('bottom-right', this)" class="pos-grid-btn p-3 sm:p-4 rounded-xl sm:rounded-2xl border border-black/10 dark:border-white/10 hover:border-primary/40 transition-all flex items-center justify-center"><i data-lucide="arrow-down-right" class="w-5 h-5"></i></button>
</div>
</div>
</div>
<!-- Live Code Viewer -->
<div class="lg:col-span-7 flex flex-col fade-in-up">
<div class="flex-grow rounded-3xl bg-[#0d1117] overflow-hidden flex flex-col shadow-2xl">
<div class="bg-slate-800/50 px-4 py-3 sm:px-6 sm:py-4 border-b border-white/5 flex items-center justify-between">
<span class="text-[10px] sm:text-xs font-black text-slate-400 uppercase tracking-widest">JavaScript Implementation</span>
<button onclick="copyCode(this)" class="text-slate-400 hover:text-white transition-colors flex items-center gap-1.5 sm:gap-2 text-[10px] sm:text-xs font-bold" aria-label="Copy code">
<i data-lucide="copy" class="w-3.5 h-3.5 sm:w-4 sm:h-4"></i> <span>COPY</span>
</button>
</div>
<div class="p-5 sm:p-8 font-mono text-xs sm:text-sm leading-relaxed overflow-x-auto text-slate-300">
<pre id="code-output"></pre>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Installation & Docs -->
<section id="docs" class="py-12 sm:py-24 bg-slate-50 dark:bg-dark-800/30">
<div class="max-w-5xl mx-auto px-4">
<h2 class="text-2xl sm:text-3xl font-black text-slate-900 dark:text-white mb-8 sm:mb-12 text-center fade-in-up">Quick Start Guide</h2>
<div class="space-y-8 sm:space-y-12">
<!-- NPM -->
<div class="relative fade-in-up">
<h3 class="text-lg sm:text-xl font-bold mb-3 sm:mb-4 flex items-center gap-2">
<i data-lucide="package" class="text-primary w-5 h-5"></i> NPM (Recommended)
</h3>
<div class="relative bg-slate-900 text-white rounded-2xl font-mono text-sm group border border-white/5">
<div class="overflow-x-auto p-6 pr-16">
<span class="whitespace-nowrap">npm install <span class="text-primary">notifications-kd</span></span>
</div>
<button onclick="copyText('npm install notifications-kd', this)" class="absolute top-1/2 -translate-y-1/2 right-4 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all p-2 bg-slate-800 hover:bg-slate-700 border border-white/10 rounded-lg text-slate-300 hover:text-white shadow-lg z-10" aria-label="Copy npm command"><i data-lucide="copy" class="w-4 h-4"></i></button>
</div>
</div>
<!-- CDN -->
<div class="relative fade-in-up">
<h3 class="text-lg sm:text-xl font-bold mb-3 sm:mb-4 flex items-center gap-2">
<i data-lucide="globe" class="text-primary w-5 h-5"></i> CDN (Direct Browser Usage)
</h3>
<div class="space-y-4">
<div>
<p class="text-[10px] sm:text-xs font-normal sm:font-bold text-slate-500 mb-2 ml-4 uppercase tracking-wider">jsDelivr</p>
<div class="relative bg-slate-900 text-white rounded-2xl font-mono text-sm group border border-white/5">
<div class="overflow-x-auto p-5 pr-16">
<span class="whitespace-nowrap"><script <span class="text-blue-400">src</span>=<span class="text-emerald-400">"https://cdn.jsdelivr.net/npm/notifications-kd"</span>></script></span>
</div>
<button onclick="copyText('<script src=\'https://cdn.jsdelivr.net/npm/notifications-kd\'></script>', this)" class="absolute top-1/2 -translate-y-1/2 right-3 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all p-2 bg-slate-800 hover:bg-slate-700 border border-white/10 rounded-lg text-slate-300 hover:text-white shadow-lg z-10" aria-label="Copy jsDelivr CDN">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
</div>
<div>
<p class="text-[10px] sm:text-xs font-normal sm:font-bold text-slate-500 mb-2 ml-4 uppercase tracking-wider">unpkg</p>
<div class="relative bg-slate-900 text-white rounded-2xl font-mono text-sm group border border-white/5">
<div class="overflow-x-auto p-5 pr-16">
<span class="whitespace-nowrap"><script <span class="text-blue-400">src</span>=<span class="text-emerald-400">"https://unpkg.com/notifications-kd"</span>></script></span>
</div>
<button onclick="copyText('<script src=\'https://unpkg.com/notifications-kd\'></script>', this)" class="absolute top-1/2 -translate-y-1/2 right-3 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all p-2 bg-slate-800 hover:bg-slate-700 border border-white/10 rounded-lg text-slate-300 hover:text-white shadow-lg z-10" aria-label="Copy unpkg CDN">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
</div>
<!-- ES Module Import -->
<div class="relative fade-in-up">
<h3 class="text-lg sm:text-xl font-bold mb-3 sm:mb-4 flex items-center gap-2">
<i data-lucide="file-code" class="text-primary w-5 h-5"></i> ES Module Import
</h3>
<div class="space-y-4">
<div>
<p class="text-[10px] sm:text-xs font-normal sm:font-bold text-slate-500 mb-2 ml-4 uppercase tracking-wider">Modern bundlers (Webpack, Vite, React, Vue)</p>
<div class="relative bg-slate-900 text-white rounded-2xl font-mono text-sm group border border-white/5">
<div class="overflow-x-auto p-5 pr-16">
<span class="whitespace-nowrap"><span class="text-purple-400">import</span> KDNotification <span class="text-purple-400">from</span> <span class="text-emerald-400">"notifications-kd"</span>;</span>
</div>
<button onclick="copyText('import KDNotification from \'notifications-kd\';', this)" class="absolute top-1/2 -translate-y-1/2 right-3 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all p-2 bg-slate-800 hover:bg-slate-700 border border-white/10 rounded-lg text-slate-300 hover:text-white shadow-lg z-10" aria-label="Copy bundler import">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
</div>
<div>
<p class="text-[10px] sm:text-xs font-normal sm:font-bold text-slate-500 mb-2 ml-4 uppercase tracking-wider">Native Browser ES Module</p>
<div class="relative bg-slate-900 text-white rounded-2xl font-mono text-sm group border border-white/5">
<div class="overflow-x-auto p-5 pr-16">
<span class="whitespace-nowrap"><span class="text-purple-400">import</span> KDNotification <span class="text-purple-400">from</span> <span class="text-emerald-400">"https://cdn.jsdelivr.net/npm/notifications-kd/notifications-kd.js"</span>;</span>
</div>
<button onclick="copyText('import KDNotification from \'https://cdn.jsdelivr.net/npm/notifications-kd/notifications-kd.js\';', this)" class="absolute top-1/2 -translate-y-1/2 right-3 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all p-2 bg-slate-800 hover:bg-slate-700 border border-white/10 rounded-lg text-slate-300 hover:text-white shadow-lg z-10" aria-label="Copy native import">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Quick Usage Example -->
<div class="relative fade-in-up">
<h3 class="text-lg sm:text-xl font-bold mb-3 sm:mb-4 flex items-center gap-2">
<i data-lucide="play" class="text-primary w-5 h-5"></i> Basic Usage
</h3>
<div class="group relative bg-[#0d1117] text-white rounded-2xl font-mono text-sm leading-relaxed shadow-xl border border-white/5">
<div class="overflow-x-auto p-8 pr-16">
<pre><span class="text-slate-500">// No extra CSS required! Styles are auto-injected.</span>
<span class="text-purple-400">KDNotification</span>.<span class="text-blue-400">show</span>({
<span class="text-blue-400">type</span>: <span class="text-emerald-400">'success'</span>,
<span class="text-blue-400">title</span>: <span class="text-emerald-400">'Profile Updated'</span>,
<span class="text-blue-400">message</span>: <span class="text-emerald-400">'Your changes have been saved.'</span>,
<span class="text-blue-400">duration</span>: <span class="text-orange-400">4000</span>,
<span class="text-blue-400">position</span>: <span class="text-emerald-400">'top-right'</span>
});</pre>
</div>
<button onclick="copyText('KDNotification.show({\n type: \'success\',\n title: \'Profile Updated\',\n message: \'Your changes have been saved.\',\n duration: 4000,\n position: \'top-right\'\n});', this)" class="absolute top-3 right-3 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all p-2 bg-slate-800 hover:bg-slate-700 border border-white/10 rounded-lg text-slate-400 hover:text-white shadow-lg z-10" aria-label="Copy Basic Usage code">
<i data-lucide="copy" class="w-4 h-4"></i>
</button>
</div>
</div>
<!-- API Table -->
<div class="fade-in-up">
<h3 class="text-lg sm:text-xl font-bold mb-4 sm:mb-6">API Configuration Options</h3>
<div class="overflow-hidden rounded-2xl border border-black/5 dark:border-white/5 glass overflow-x-auto">
<table class="w-full text-left text-sm min-w-[600px]">
<thead>
<tr class="bg-black/5 dark:bg-white/5 font-bold uppercase text-xs tracking-widest">
<th class="px-6 py-4">Option</th>
<th class="px-6 py-4">Type</th>
<th class="px-6 py-4">Default</th>
<th class="px-6 py-4">Description</th>
</tr>
</thead>
<tbody class="divide-y divide-black/5 dark:divide-white/5">
<tr>
<td class="px-6 py-4 font-mono text-primary">type</td>
<td class="px-6 py-4 text-xs">String</td>
<td class="px-6 py-4 text-xs font-mono">'info'</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">'info' | 'success' | 'error' | 'warning' | 'processing'</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">title</td>
<td class="px-6 py-4 text-xs">String</td>
<td class="px-6 py-4 text-xs font-mono">''</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Optional title for a rich UI layout with icon</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">message</td>
<td class="px-6 py-4 text-xs">String</td>
<td class="px-6 py-4 text-xs font-mono">''</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Main content of the notification (Safe HTML supported)</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">duration</td>
<td class="px-6 py-4 text-xs">Number</td>
<td class="px-6 py-4 text-xs font-mono">3000</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Auto-dismiss time in ms (0 disables auto-dismiss)</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">position</td>
<td class="px-6 py-4 text-xs">String</td>
<td class="px-6 py-4 text-xs font-mono">'center'</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">theme</td>
<td class="px-6 py-4 text-xs">String</td>
<td class="px-6 py-4 text-xs font-mono">'auto'</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">'auto' (detects background) | 'light' | 'dark'</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">isModal</td>
<td class="px-6 py-4 text-xs">Boolean</td>
<td class="px-6 py-4 text-xs font-mono">false</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Blocks background interaction; requires manual dismissal</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">buttons</td>
<td class="px-6 py-4 text-xs">Array</td>
<td class="px-6 py-4 text-xs font-mono">null</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Array of { text, value, className, onClick } objects</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">icon</td>
<td class="px-6 py-4 text-xs">String</td>
<td class="px-6 py-4 text-xs font-mono">null</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Custom SVG string to override the default icon</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">style</td>
<td class="px-6 py-4 text-xs">Object</td>
<td class="px-6 py-4 text-xs font-mono">{}</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Custom inline CSS properties or CSS variables</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">offsetX / offsetY</td>
<td class="px-6 py-4 text-xs">String | Number</td>
<td class="px-6 py-4 text-xs font-mono">'50px'</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Distance from screen edges (supports px, em, rem, %, vh, vw)</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Methods -->
<div class="fade-in-up">
<h3 class="text-xl font-bold mb-6">Methods</h3>
<div class="overflow-hidden rounded-2xl border border-black/5 dark:border-white/5 glass overflow-x-auto">
<table class="w-full text-left text-sm min-w-[600px]">
<thead>
<tr class="bg-black/5 dark:bg-white/5 font-bold uppercase text-xs tracking-widest">
<th class="px-6 py-4">Method</th>
<th class="px-6 py-4">Returns</th>
<th class="px-6 py-4">Description</th>
</tr>
</thead>
<tbody class="divide-y divide-black/5 dark:divide-white/5">
<tr>
<td class="px-6 py-4 font-mono text-primary">KDNotification.show(options)</td>
<td class="px-6 py-4 text-xs">Promise</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Displays a notification. Resolves with the clicked button's value, or null/true on auto-dismiss</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">KDNotification.close()</td>
<td class="px-6 py-4 text-xs">void</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Programmatically dismisses the active notification. Ideal for hiding processing toasts after an API call finishes</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Button ClassNames -->
<div class="fade-in-up">
<h3 class="text-xl font-bold mb-6">Button Styles</h3>
<div class="flex flex-wrap gap-3">
<div class="px-4 py-3 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5">
<code class="text-primary text-sm">kd-btn</code>
<p class="text-slate-600 dark:text-slate-400 text-xs mt-1">Default neutral button</p>
</div>
<div class="px-4 py-3 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5">
<code class="text-primary text-sm">kd-btn-primary</code>
<p class="text-slate-600 dark:text-slate-400 text-xs mt-1">Primary action with gradient</p>
</div>
<div class="px-4 py-3 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5">
<code class="text-primary text-sm">kd-btn-danger</code>
<p class="text-slate-600 dark:text-slate-400 text-xs mt-1">Destructive action with red gradient</p>
</div>
</div>
</div>
<!-- Framework Compatibility -->
<div class="fade-in-up">
<h3 class="text-xl font-bold mb-6 flex items-center gap-2">
<i data-lucide="blocks" class="text-primary w-5 h-5"></i> Framework Compatibility
</h3>
<div class="flex flex-wrap gap-3">
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium text-blue-600 dark:text-blue-400">React</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium text-emerald-600 dark:text-emerald-400">Vue.js</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium text-red-600 dark:text-red-400">Angular</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium text-orange-600 dark:text-orange-400">Svelte</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium text-slate-800 dark:text-slate-200">Next.js / Nuxt</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium text-yellow-600 dark:text-yellow-400">Vanilla JS</span>
</div>
</div>
<!-- Browser Support -->
<div class="fade-in-up">
<h3 class="text-xl font-bold mb-6 flex items-center gap-2">
<i data-lucide="globe" class="text-primary w-5 h-5"></i> Browser Support
</h3>
<div class="flex flex-wrap gap-3">
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium">Chrome 60+</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium">Firefox 55+</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium">Safari 12+</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium">Edge 79+</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium">Opera 47+</span>
<span class="px-4 py-2 rounded-xl bg-white dark:bg-dark-900 border border-black/5 dark:border-white/5 text-sm font-medium">iOS Safari 12+</span>
</div>
</div>
<!-- CSS Customization -->
<div class="fade-in-up">
<h3 class="text-xl font-bold mb-6 flex items-center gap-2">
<i data-lucide="sliders" class="text-primary w-5 h-5"></i> CSS Customization
</h3>
<div class="overflow-hidden rounded-2xl border border-black/5 dark:border-white/5 glass overflow-x-auto">
<table class="w-full text-left text-sm min-w-[600px]">
<thead>
<tr class="bg-black/5 dark:bg-white/5 font-bold uppercase text-xs tracking-widest">
<th class="px-6 py-4">Variable</th>
<th class="px-6 py-4">Default</th>
<th class="px-6 py-4">Description</th>
</tr>
</thead>
<tbody class="divide-y divide-black/5 dark:divide-white/5">
<tr>
<td class="px-6 py-4 font-mono text-primary">--kd-toast-anim-duration</td>
<td class="px-6 py-4 text-xs font-mono">250ms</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Enter/leave animation speed (parses both s and ms)</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">--kd-z-toast</td>
<td class="px-6 py-4 text-xs font-mono">2147483647</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Z-index of the toast overlay</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">--kd-mobile-offset-x</td>
<td class="px-6 py-4 text-xs font-mono">12px</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Horizontal distance from edges on mobile</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">--kd-mobile-offset-y</td>
<td class="px-6 py-4 text-xs font-mono">16px</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Vertical distance from edges on mobile</td>
</tr>
<tr>
<td class="px-6 py-4 font-mono text-primary">--kd-mobile-max-width</td>
<td class="px-6 py-4 text-xs font-mono">420px</td>
<td class="px-6 py-4 text-slate-600 dark:text-slate-400">Maximum toast width on mobile devices</td>
</tr>
</tbody>
</table>
</div>
<p class="mt-4 text-xs sm:text-sm text-slate-600 dark:text-slate-400 italic">💡 Use the <code class="text-primary">style</code> API or CSS variables for customization. Avoid targeting internal CSS classes directly, as they may change in future updates.</p>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="pt-12 sm:pt-16 pb-6 sm:pb-8 border-t border-black/5 dark:border-white/5">
<div class="max-w-7xl mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between gap-12 mb-16">
<!-- Brand -->
<div class="md:max-w-sm">
<div class="flex items-center gap-3 mb-6">
<div class="w-8 h-8 sm:w-9 sm:h-9 bg-primary rounded-lg flex items-center justify-center shadow-lg shadow-primary/20">
<i data-lucide="bell" class="text-white w-5 h-5"></i>
</div>
<span class="font-black text-2xl sm:text-3xl text-slate-900 dark:text-white">KD <span class="text-primary">Notifications</span></span>
</div>
<p class="text-sm sm:text-base text-slate-500 leading-relaxed max-w-xl mb-6">A zero-dependency, elegantly designed toast notification library for the modern web. Proudly crafted by KhvichaDev with ❤️ in Georgia.</p>
<div class="flex items-center gap-5">
<a href="https://www.facebook.com/khvichadev" target="_blank" rel="noopener noreferrer" class="text-slate-500 dark:text-slate-400 hover:text-[#1877F2] dark:hover:text-[#1877F2] transition-colors" aria-label="Facebook" title="KhvichaDev's Facebook">
<i data-lucide="facebook" class="w-5 h-5"></i>
</a>
<a href="https://www.reddit.com/user/KhvichaDev/" target="_blank" rel="noopener noreferrer" class="text-slate-500 dark:text-slate-400 hover:text-[#FF4500] dark:hover:text-[#FF4500] transition-colors" aria-label="Reddit" title="KhvichaDev's Reddit">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-2.752 4.698c-1.514 0-2.684-.52-2.752-.553a.362.362 0 0 1-.161-.482c.118-.215.39-.297.606-.179.034.018 1.05.52 2.307.52 1.245 0 2.25-.494 2.296-.51.22-.08.475.02.56.233.084.212-.014.471-.226.551-.06.02-1.12.42-2.63.42z"/></svg>
</a>
<a href="https://www.linkedin.com/in/khvichadev/" target="_blank" rel="noopener noreferrer" class="text-slate-500 dark:text-slate-400 hover:text-[#0A66C2] dark:hover:text-[#0A66C2] transition-colors" aria-label="LinkedIn" title="KhvichaDev's LinkedIn">
<i data-lucide="linkedin" class="w-5 h-5"></i>
</a>
<a href="https://github.com/KhvichaDev" target="_blank" rel="noopener noreferrer" class="text-slate-500 dark:text-slate-400 hover:text-[#333] dark:hover:text-white transition-colors" aria-label="GitHub" title="KhvichaDev's GitHub">
<i data-lucide="github" class="w-5 h-5"></i>
</a>
<a href="https://www.youtube.com/@khvichadev" target="_blank" rel="noopener noreferrer" class="text-slate-500 dark:text-slate-400 hover:text-[#FF0000] dark:hover:text-[#FF0000] transition-colors" aria-label="YouTube" title="KhvichaDev's YouTube">
<i data-lucide="youtube" class="w-5 h-5"></i>
</a>
</div>
</div>
<!-- Link Groups -->
<div class="flex flex-wrap sm:flex-row gap-12 sm:gap-16 md:gap-24">
<!-- Quick Links -->
<div>
<h4 class="font-bold text-slate-900 dark:text-white mb-4 sm:mb-6 text-sm sm:text-base uppercase tracking-widest">Quick Links</h4>
<div class="flex flex-col gap-3">
<a href="#features" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm inline-flex">Features</a>
<a href="#playground" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm inline-flex">Playground</a>
<a href="#docs" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm inline-flex">Documentation</a>
</div>
</div>
<!-- Resources -->
<div>
<h4 class="font-bold text-slate-900 dark:text-white mb-4 sm:mb-6 text-sm sm:text-base uppercase tracking-widest">Resources</h4>
<div class="flex flex-col gap-3">
<a href="https://github.com/KhvichaDev/notifications-kd" target="_blank" rel="noopener noreferrer" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm flex items-center gap-2"><i data-lucide="github" class="w-4 h-4"></i> GitHub Repository</a>
<a href="https://www.npmjs.com/package/notifications-kd" target="_blank" rel="noopener noreferrer" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm flex items-center gap-2"><i data-lucide="package" class="w-4 h-4"></i> npm Package</a>
<a href="https://github.com/KhvichaDev/notifications-kd/releases" target="_blank" rel="noopener noreferrer" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm flex items-center gap-2"><i data-lucide="history" class="w-4 h-4"></i> Changelog</a>
<a href="https://github.com/KhvichaDev/notifications-kd/issues" target="_blank" rel="noopener noreferrer" class="text-slate-600 dark:text-slate-400 hover:text-primary transition-colors text-sm flex items-center gap-2"><i data-lucide="message-circle" class="w-4 h-4"></i> Report an Issue</a>
</div>
</div>
</div>
</div>
<div class="border-t border-black/5 dark:border-white/5 pt-6 sm:pt-8 flex flex-col sm:flex-row items-center justify-between gap-4">
<a href="https://khvichadev.com" target="_blank" rel="noopener noreferrer" class="flex items-center gap-2 opacity-60 hover:opacity-100 hover:text-primary transition-all" title="Visit KhvichaDev.com">
<i data-lucide="code" class="w-4 h-4"></i>
<span class="text-xs font-bold tracking-widest uppercase">Crafted by KhvichaDev</span>
</a>
<p class="text-slate-500 text-xs sm:text-sm text-center sm:text-left">© <span id="current-year">2026</span> <a href="https://github.com/KhvichaDev/notifications-kd/blob/main/LICENSE" target="_blank" rel="noopener noreferrer" class="hover:text-primary transition-colors underline decoration-dotted underline-offset-4" title="Show License">MIT License</a>. Open source and free to use.</p>
</div>
</div>
</footer>
<!-- Back to Top Button -->
<button onclick="window.scrollTo({top:0,behavior:'smooth'})" id="back-to-top" class="hidden-btn fixed bottom-6 right-6 z-40 w-12 h-12 bg-primary text-white rounded-full shadow-lg shadow-primary/30 flex items-center justify-center hover:scale-110 transition-transform" aria-label="Back to top">
<i data-lucide="chevron-up" class="w-5 h-5"></i>
</button>
<!-- ========================================== -->
<!-- JAVASCRIPT LOGIC -->
<!-- ========================================== -->
<script src="https://unpkg.com/lucide@0.344.0"></script>
<script src="https://unpkg.com/notifications-kd@1.2.3"></script>
<script>
document.getElementById('current-year').textContent = new Date().getFullYear();
/**
* Replaces the static image facade with an active YouTube iframe.
* This lazy-loading technique prevents loading the heavy iframe on initial page load,
* significantly improving performance and Core Web Vitals.
*/
function loadYouTubeVideo() {
const container = document.getElementById('yt-container');
if (container) {
container.innerHTML = `<iframe class="absolute top-0 left-0 w-full h-full" src="https://www.youtube.com/embed/kdg47xX_sU4?autoplay=1" title="KD Notifications Demo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`;
}
}
let currentOptions = {
type: 'success',
message: 'Data synced successfully!',
duration: 3000,
position: 'center',
theme: 'auto'
};
lucide.createIcons();
function toggleTheme() {
document.documentElement.classList.toggle('dark');
}
const mobileMenuEl = document.getElementById('mobile-menu');
const mobileMenuBtnEl = document.getElementById('mobile-menu-btn');
function toggleMobileMenu() {
if (!mobileMenuEl) return;
mobileMenuEl.classList.toggle('hidden');
const isExpanded = !mobileMenuEl.classList.contains('hidden');
if (mobileMenuBtnEl) mobileMenuBtnEl.setAttribute('aria-expanded', isExpanded);
}
function closeMobileMenu() {
if (!mobileMenuEl) return;
mobileMenuEl.classList.add('hidden');
if (mobileMenuBtnEl) mobileMenuBtnEl.setAttribute('aria-expanded', 'false');
}
document.addEventListener('click', (event) => {
const isClickInsideMenu = mobileMenuEl?.contains(event.target);
const isClickOnBtn = mobileMenuBtnEl?.contains(event.target);
if (!isClickInsideMenu && !isClickOnBtn && mobileMenuEl && !mobileMenuEl.classList.contains('hidden')) {
closeMobileMenu();
}
});
/**
* Updates the active theme for the playground demonstration.
* Synchronizes the UI button states and triggers a code view update
* to reflect the new configuration parameter.
*/
function changePlaygroundTheme(theme) {
currentOptions.theme = theme;
document.querySelectorAll('.playground-theme-btn').forEach(btn => {
btn.classList.remove('active');
if (btn.innerText.toLowerCase() === theme) btn.classList.add('active');
});
updateCodeView();
}
function updateDuration(val) {
const num = parseInt(val, 10);
currentOptions.duration = num;
document.getElementById('duration-val').textContent = val + 'ms';
updateCodeView();
}
/**
* State flags to track user interaction with text inputs.
* Prevents default demo text from overwriting user-provided custom text.
*/
let userModifiedTitle = false;
let userModifiedMessage = false;
let processingTimeout = null;
function clearProcessingState() {
if (processingTimeout) {
clearTimeout(processingTimeout);
processingTimeout = null;
}
}
/**
* Synchronizes the custom text input fields with the active options object.
* Dynamically adds or removes the title property based on input presence
* to maintain clean configuration output.
*/
function syncInputToOptions() {
const title = document.getElementById('pg-title').value.trim();
const message = document.getElementById('pg-message').value.trim();
if (title) currentOptions.title = title; else delete currentOptions.title;
if (message) currentOptions.message = message;
updateCodeView();
}
function updatePos(pos, el) {
currentOptions.position = pos;
document.querySelectorAll('.pos-grid-btn').forEach(b => b.classList.remove('active'));
el.classList.add('active');
updateCodeView();
clearProcessingState();
if (window.KDNotification) {
KDNotification.show({