-
Notifications
You must be signed in to change notification settings - Fork 513
/
index.html
4234 lines (4166 loc) · 144 KB
/
index.html
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
<!DOCTYPE html>
<html
lang="en"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml"
>
<head>
<meta charset="utf-8" />
<title>PNotify</title>
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="JavaScript notification plugin." />
<meta property="og:title" content="PNotify" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://sciactive.com/pnotify/" />
<meta property="og:image" content="includes/logo.png" />
<meta property="og:site_name" content="PNotify" />
<meta property="fb:admins" content="508999194" />
<meta property="og:description" content="JavaScript notification plugin." />
<link
rel="apple-touch-icon"
sizes="180x180"
href="includes/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="includes/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="includes/favicon/favicon-16x16.png"
/>
<!-- Dev Notice -->
<link href="devnote.css" rel="stylesheet" />
<!-- Page Style -->
<link href="includes/style.css" rel="stylesheet" />
<!-- Animate.css -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css"
integrity="sha256-PHcOkPmOshsMBC+vtJdVr5Mwb7r0LkSVJPlPrp/IMpU="
crossorigin="anonymous"
/>
<!-- NonBlock.js -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/NonBlock.es5.js"
integrity="sha256-ya57jZves9vI0hPcq0IoJMrIuwwk9w01CvkvG5xJQ1s="
crossorigin="anonymous"
></script>
<!-- Bootstrap -->
<link
id="bootstrap-light"
media="(prefers-color-scheme: no-preference), (prefers-color-scheme: light)"
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha256-L/W5Wfqfa0sdBNIKN9cG6QA5F2qx4qICmU2VgLruv9Y="
crossorigin="anonymous"
/>
<link
id="bootstrap-dark"
media="(prefers-color-scheme: dark)"
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/darkly/bootstrap.min.css"
integrity="sha256-WzKrnqJMmUZVHL8Im0hFLIOJ3UiQtgwK7zNfwxb5Bx0="
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bootstrap-native-v4.min.js"
integrity="sha256-k5gE8gnbCCVtz/4z2LzbAIpMdH8K1Bjl4cTCjm6SZS8="
crossorigin="anonymous"
></script>
<!-- FontAwesome -->
<script
src="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/js/all.min.js"
integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs="
crossorigin="anonymous"
></script>
<!-- Material Design Icons Font -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/material-icons-font.css"
integrity="sha256-Qhft8mGp8dJ8oc6Pvys+NmBL6Mvi4Jqg+T0aN2huMUw="
crossorigin="anonymous"
/>
<!-- Roboto Font -->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
crossorigin="anonymous"
/>
<!-- JavaScript Source Formatting -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/styles/atom-one-dark.css"
integrity="sha256-k5IP6hFowt2ISQDOHTuCLFciixzxZ/8/qYTlEvTQ6CI="
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/lib/highlight.js"
integrity="sha256-X93pzXSFftQ1a7EIBCLb8DgWcfcBOlgCwkNQoKKNf2k="
crossorigin="anonymous"
></script>
<script type="text/javascript">
module = {};
</script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/lib/languages/javascript.js"
integrity="sha256-gw54feyfS2axM9wJn/Yw66WD7HEb8LnC1F6M2D3Hkd8="
crossorigin="anonymous"
></script>
<script type="text/javascript">
hljs.registerLanguage('javascript', module.exports);
delete module;
</script>
<script type="text/javascript">
module = {};
</script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/lib/languages/css.js"
integrity="sha256-3HiVmBMOhajA6zBBiKBpQnd28r+GAKg5LBiF63OiQA4="
crossorigin="anonymous"
></script>
<script type="text/javascript">
hljs.registerLanguage('css', module.exports);
delete module;
</script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/js/lib/beautifier.min.js"
integrity="sha256-mtOFRa0v4H67G1yfvpq8Y9olqgFzvOdVvVjaJ7SZF5g="
crossorigin="anonymous"
></script>
<!-- PNotify CSS -->
<link rel="stylesheet" href="packages/core/dist/PNotify.css" />
<link rel="stylesheet" href="packages/core/dist/BrightTheme.css" />
<link rel="stylesheet" href="packages/core/dist/Material.css" />
<link rel="stylesheet" href="packages/core/dist/Angeler.css" />
<link
rel="stylesheet"
href="packages/bootstrap4/dist/PNotifyBootstrap4.css"
/>
<link rel="stylesheet" href="packages/mobile/dist/PNotifyMobile.css" />
<link rel="stylesheet" href="packages/desktop/dist/PNotifyDesktop.css" />
<link rel="stylesheet" href="packages/confirm/dist/PNotifyConfirm.css" />
<link
rel="stylesheet"
href="packages/countdown/dist/PNotifyCountdown.css"
/>
<link rel="stylesheet" href="packages/paginate/dist/PNotifyPaginate.css" />
<link
rel="stylesheet"
href="packages/reference/dist/PNotifyReference.css"
/>
<!-- PNotify JS -->
<script src="packages/core/dist/PNotify.js"></script>
<script src="packages/bootstrap4/dist/PNotifyBootstrap4.js"></script>
<script src="packages/font-awesome5-fix/dist/PNotifyFontAwesome5Fix.js"></script>
<script src="packages/font-awesome5/dist/PNotifyFontAwesome5.js"></script>
<script src="packages/animate/dist/PNotifyAnimate.js"></script>
<script src="packages/mobile/dist/PNotifyMobile.js"></script>
<script src="packages/desktop/dist/PNotifyDesktop.js"></script>
<script src="packages/confirm/dist/PNotifyConfirm.js"></script>
<script src="packages/countdown/dist/PNotifyCountdown.js"></script>
<script src="packages/paginate/dist/PNotifyPaginate.js"></script>
<script src="packages/reference/dist/PNotifyReference.js"></script>
<!-- Custom Styling -->
<style type="text/css">
/* Translucent notice CSS */
[data-pnotify].pnotify.translucent.pnotify-fade-in {
opacity: 0.8;
}
/* Custom styled notice CSS */
[data-pnotify].custom-elem {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
line-height: 1.1;
}
[data-pnotify] .custom-container {
background-color: #404040;
background-image: none;
border: none;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
padding: 15px;
font-size: 15px;
}
[data-pnotify] .custom-title,
[data-pnotify] .custom-text {
margin-left: 50px;
color: #fff;
}
[data-pnotify] .custom-title {
font-weight: bold;
font-size: 15px;
}
[data-pnotify] .custom-icon {
color: #ffa;
}
/* Browser bar stacks. */
[data-pnotify].pnotify.stack-bar-top {
width: 100%;
border-radius: 0;
}
[data-pnotify].pnotify.stack-bar-bottom {
width: 70%;
border-radius: 0;
}
/* Unpositioned notices margin. */
#unpositioned-context > * {
margin-bottom: 1em;
}
</style>
<!-- Demo Code -->
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', () => {
// ---
// Set defaults.
// ---
PNotify.defaults.destroy = false;
PNotify.defaultModules.set(PNotifyMobile, {});
PNotify.defaultModules.set(PNotifyFontAwesome5Fix, {});
// ---
// Notice that opens when the page opens.
// ---
PNotify.notice({
title: 'PNotify',
text: 'Welcome to the demo site. Try our fresh demos.',
});
});
</script>
</head>
<body
data-spy="scroll"
data-target=".navbar"
data-offset="0"
style="position: relative"
>
<nav class="navbar sticky-top navbar-expand-lg navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="https://sciactive.com/pnotify/"
>PNotify</a
>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#overview">Overview</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#demos-core">Core Demos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#demos-modules">Module Demos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#stacks">Stacks</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#comments">Comments</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a
class="nav-link"
href="https://github.com/sciactive/pnotify"
title="Fork me on GitHub"
><i class="fab fa-github"></i
></a>
</li>
<li class="nav-item">
<a
class="nav-link"
href="https://twitter.com/sciactive"
title="Follow me on Twitter"
><i class="fab fa-twitter"></i
></a>
</li>
<li class="nav-item dropdown">
<a
class="nav-link dropdown-toggle"
href="#"
id="navbarDropdown"
role="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
Beyond PNotify
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a
class="dropdown-item"
href="https://github.com/sciactive/"
target="_blank"
>SciActive</a
>
<div class="dropdown-divider"></div>
<a
class="dropdown-item"
href="https://nymph.io/"
target="_blank"
>Nymph</a
>
<a
class="dropdown-item"
href="https://sveltematerialui.com/"
target="_blank"
>Svelte Material UI</a
>
<a
class="dropdown-item"
href="https://tunnelgram.com/"
target="_blank"
>Tunnelgram</a
>
<a
class="dropdown-item"
href="https://sciactive.com/pform/"
target="_blank"
>PForm</a
>
<a
class="dropdown-item"
href="https://hookphp.org/"
target="_blank"
>HookPHP</a
>
</div>
</li>
</ul>
</div>
</div>
</nav>
<section class="container page-banner" id="overview">
<h1><img src="includes/logo.png" alt="PNotify" id="logo" /></h1>
<p id="description">Beautiful notifications and prompts.</p>
<p class="dev-note" style="display: none">
You probably want to go to the
<a href="https://sciactive.com/pnotify/">production site</a>, cause
things will be broken here.
</p>
<div class="row align-items-stretch">
<div class="col-md-4 my-3">
<div class="card" style="height: 100%">
<h5 class="card-header">
<i class="fas fa-mobile"></i> Mobile Ready
</h5>
<div class="card-body">
PNotify works on your phone and tablet. You can swipe notices away
to dismiss them.
</div>
</div>
</div>
<div class="col-md-4 my-3">
<div class="card" style="height: 100%">
<h5 class="card-header">
<i class="fas fa-asterisk"></i> Unobtrusive
</h5>
<div class="card-body">
PNotify uses the
<a
href="https://sciactive.com/2020/02/11/the-modalish-notification-flow/"
target="_blank"
>modalish notification flow</a
>
to provide unobtrusive support for many notifications at once.
</div>
</div>
</div>
<div class="col-md-4 my-3">
<div class="card" style="height: 100%">
<h5 class="card-header"><i class="fas fa-gift"></i> Open Source</h5>
<div class="card-body">
PNotify is distributed under the permissive
<a
href="http://www.apache.org/licenses/LICENSE-2.0"
target="_blank"
>Apache License, Version 2.0</a
>.
</div>
</div>
</div>
</div>
<div class="text-md-right">
<a
class="btn btn-primary btn-lg"
href="https://github.com/sciactive/pnotify/blob/master/README.md#getting-started"
>Get Started with PNotify</a
>
</div>
<div
class="dev-note"
style="
display: none;
position: fixed;
z-index: -1;
bottom: 20px;
left: 20px;
opacity: 0.4;
"
>
<div class="alert alert-danger">
<h5 style="margin-top: 0">
<i class="fas fa-exclamation-triangle"></i> Caution warning danger
attention!
</h5>
<p class="mb-0">
This is the development site. It demos bleeding edge features that
may not work.
</p>
</div>
</div>
</section>
<div id="demos-core" class="container page-section">
<div class="my-3">
<h2>
Simple Demos
<small>These demos only use core PNotify features.</small>
</h2>
<hr />
</div>
<div class="card border-dark">
<h5 class="card-header bg-dark text-white">Choose the Styling</h5>
<div class="card-body">
PNotify supports multiple styling methods, icon sets, and display
modes.
<div class="my-1">
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="styling"
id="style-brighttheme"
autocomplete="off"
checked
/>
<label class="form-check-label" for="style-brighttheme"
>Bright Theme</label
>
</div>
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="styling"
id="style-material"
autocomplete="off"
/>
<label class="form-check-label" for="style-material"
>Material</label
>
</div>
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="styling"
id="style-angeler"
autocomplete="off"
/>
<label class="form-check-label" for="style-angeler"
>Angeler</label
>
</div>
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="styling"
id="style-angeler-extended"
autocomplete="off"
/>
<label class="form-check-label" for="style-angeler-extended"
>Angeler (Extended)</label
>
</div>
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="styling"
id="style-bootstrap4"
autocomplete="off"
/>
<label class="form-check-label" for="style-bootstrap4"
>Bootstrap</label
>
</div>
</div>
<div class="my-1">
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="mode"
id="mode-no-preference"
autocomplete="off"
checked
/>
<label class="form-check-label" for="mode-no-preference"
>System Default</label
>
</div>
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="mode"
id="mode-light"
autocomplete="off"
/>
<label class="form-check-label" for="mode-light">Light</label>
</div>
<div class="form-check form-check-inline">
<input
class="form-check-input"
type="radio"
name="mode"
id="mode-dark"
autocomplete="off"
/>
<label class="form-check-label" for="mode-dark">Dark</label>
</div>
</div>
<a class="btn btn-info my-1" href="demo/styling.html" target="_blank"
>Demo All Styles/Icons</a
>
</div>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', () => {
document
.getElementById('style-brighttheme')
.addEventListener('change', (e) => {
PNotify.defaultModules.delete(PNotifyBootstrap4);
PNotify.defaultModules.delete(PNotifyFontAwesome5);
PNotify.defaults.styling = 'brighttheme';
PNotify.defaults.icons = 'brighttheme';
PNotify.defaults.addClass = '';
PNotify.defaults.closerHover = true;
PNotify.notice({
title: 'Styling Change',
text: 'From now on, notices will be styled with Bright Theme, the default theme.',
});
});
document
.getElementById('style-material')
.addEventListener('change', (e) => {
PNotify.defaultModules.delete(PNotifyBootstrap4);
PNotify.defaultModules.delete(PNotifyFontAwesome5);
PNotify.defaults.styling = 'material';
PNotify.defaults.icons = 'material';
PNotify.defaults.addClass = '';
PNotify.defaults.closerHover = true;
PNotify.notice({
title: 'Styling Change',
text: 'From now on, notices will be styled with Material.',
});
});
document
.getElementById('style-angeler')
.addEventListener('change', (e) => {
PNotify.defaultModules.delete(PNotifyBootstrap4);
PNotify.defaultModules.delete(PNotifyFontAwesome5);
PNotify.defaults.styling = 'angeler';
PNotify.defaults.icons = 'angeler';
PNotify.defaults.addClass = '';
PNotify.defaults.closerHover = false;
PNotify.notice({
title: 'Styling Change',
text: 'From now on, notices will be styled with Angeler. They will also always show the closer button, which is how Angela designed it.',
});
});
document
.getElementById('style-angeler-extended')
.addEventListener('change', (e) => {
PNotify.defaultModules.delete(PNotifyBootstrap4);
PNotify.defaultModules.delete(PNotifyFontAwesome5);
PNotify.defaults.styling = 'angeler';
PNotify.defaults.icons = 'angeler';
PNotify.defaults.addClass = 'angeler-extended';
PNotify.defaults.closerHover = false;
PNotify.notice({
title: 'Styling Change',
text: 'From now on, notices will be styled with Angeler, and use the extended variant. They will also always show the closer button, which is how Angela designed it.',
});
});
document
.getElementById('style-bootstrap4')
.addEventListener('change', (e) => {
PNotify.defaultModules.set(PNotifyBootstrap4, {});
PNotify.defaultModules.set(PNotifyFontAwesome5, {});
PNotify.defaults.addClass = '';
PNotify.defaults.closerHover = true;
PNotify.notice({
title: 'Styling Change',
text: 'From now on, notices will be styled with Bootstrap 4 w/ Font Awesome 5 Icons.',
});
});
document
.getElementById('mode-no-preference')
.addEventListener('change', (e) => {
PNotify.defaults.mode = 'no-preference';
document.getElementById(
'bootstrap-light'
).attributes.media.value =
'(prefers-color-scheme: no-preference), (prefers-color-scheme: light)';
document.getElementById(
'bootstrap-dark'
).attributes.media.value = '(prefers-color-scheme: dark)';
PNotify.notice({
title: 'Mode Change',
text: 'From now on, notices will show in system default mode.',
});
});
document
.getElementById('mode-light')
.addEventListener('change', (e) => {
PNotify.defaults.mode = 'light';
document.getElementById(
'bootstrap-light'
).attributes.media.value =
'(prefers-color-scheme: no-preference), (prefers-color-scheme: light), (prefers-color-scheme: dark)';
document.getElementById(
'bootstrap-dark'
).attributes.media.value = '(width: 0px)';
PNotify.notice({
title: 'Mode Change',
text: 'From now on, notices will show in light mode.',
});
});
document
.getElementById('mode-dark')
.addEventListener('change', (e) => {
PNotify.defaults.mode = 'dark';
document.getElementById(
'bootstrap-light'
).attributes.media.value = '(width: 0px)';
document.getElementById(
'bootstrap-dark'
).attributes.media.value =
'(prefers-color-scheme: no-preference), (prefers-color-scheme: light), (prefers-color-scheme: dark)';
PNotify.notice({
title: 'Mode Change',
text: 'From now on, notices will show in dark mode.',
});
});
});
</script>
</div>
<div class="card mt-3">
<h5 class="card-header">PNotify Core</h5>
<div class="card-body">
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Regular Notice',
text: 'Check me out! I\'m a notice.'
});
"
>
Notice
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.info({
title: 'New Thing',
text: 'Just to let you know, something happened.'
});
"
>
Info Message
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.success({
title: 'Success!',
text: 'That thing that you were trying to do worked.'
});
"
>
Success Message
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.error({
title: 'Oh No!',
text: 'Something terrible happened.'
});
"
>
Error Message
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Font Awesome Icon',
text: 'I have an icon that uses the Font Awesome icon styles.',
icon: 'far fa-envelope'
});
"
>
Custom Icon (Font Awesome)
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'No Icon Notice',
text: 'I have no icon.',
icon: false
});
"
>
No Icon
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'There\'s No Time to Explain',
text: 'OMG READ ME FAST, I\'M ABOUT TO GO AWAY!',
delay: 1000
});
"
>
Fast Notice
</button>
<hr />
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Sticky Notice',
text: 'Check me out! I\'m a sticky (pinned) notice. You\'ll have to close me yourself.',
hide: false
});
"
>
Sticky Notice
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.info({
title: 'Sticky Info',
text: 'Sticky info, you know, like a newspaper covered in honey.',
hide: false
});
"
>
Sticky Info
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.success({
title: 'Sticky Success',
text: 'Sticky success... I\'m not even gonna make a joke.',
hide: false
});
"
>
Sticky Success
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.error({
title: 'Uh Oh!',
text: 'Something really terrible happened. You really need to read this, so I won\'t close automatically.',
hide: false
});
"
>
Sticky Error
</button>
<hr />
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Stickyish Notice',
text: 'Check me out! I\'m a Stickyish notice. I won\'t hide automatically, but I\'ll close with everyone else when you click the modal backdrop.',
delay: Infinity
});
"
>
Stickyish Notice
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.info({
title: 'Stickyish Info',
text: 'Check me out! I\'m a Stickyish info. I won\'t hide automatically, but I\'ll close with everyone else when you click the modal backdrop.',
delay: Infinity
});
"
>
Stickyish Info
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.success({
title: 'Stickyish Success',
text: 'Check me out! I\'m a Stickyish success. I won\'t hide automatically, but I\'ll close with everyone else when you click the modal backdrop.',
delay: Infinity
});
"
>
Stickyish Success
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.error({
title: 'Stickyish Error',
text: 'Check me out! I\'m a Stickyish error. I won\'t hide automatically, but I\'ll close with everyone else when you click the modal backdrop.',
delay: Infinity
});
"
>
Stickyish Error
</button>
<hr />
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Custom Button Icons Notice',
text: 'Check me out! My sticker and close buttons have custom icons!',
hide: false,
icons: {
prefix: PNotify.defaults.icons,
closer: 'fas fa-bomb',
sticker: 'fas',
stuck: 'fa-hourglass',
unstuck: 'fa-anchor'
}
});
"
>
Custom Button Icons
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'No Sticky Button Notice',
text: 'Check me out! I\'m a sticky notice with no unsticky button. You\'ll have to close me manually.',
hide: false,
sticker: false
});
"
>
No Sticky Button
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'No Close Button Notice',
text: 'But, how are you supposed to close me?',
hide: false,
closer: false
});
"
>
No Close Button
</button>
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Permanent Buttons Notice',
text: 'My buttons are really lonely, so they\'re gonna hang out with us.',
closerHover: false,
stickerHover: false
});
"
>
Permanent Buttons
</button>
<button
class="btn btn-light my-1 source"
onclick="
if (window.permanotice) {
window.permanotice.open();
} else {
window.permanotice = PNotify.notice({
title: 'Now Look Here',
text: 'There\'s something you need to know, and I won\'t go away until you come to grips with it.',
hide: false,
closer: false,
sticker: false,
modules: new Map([
...PNotify.defaultModules,
[PNotifyMobile, {
swipeDismiss: false
}]
])
});
}
"
>
Permanotice
</button>
<button
class="btn btn-light my-1 source"
onclick="
if (window.permanotice) {
window.permanotice.close();
}
"
>
Close Permanotice
</button>
<hr />
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'Non-Blocking Notice',
text: 'I\'m a special kind of notice called "non-blocking". When you hover over me I\'ll fade to show the elements underneath. Feel free to click any of them just like I wasn\'t even here.\n\nNote: HTML links don\'t trigger in some very old browsers, due to security settings.',
addModelessClass: 'nonblock'
});
"
>
Using NonBlock.js
</button>
<small>(Click through to things underneath the notice.)</small>
<hr />
<button
class="btn btn-light my-1 source"
onclick="
PNotify.notice({
title: 'See Through Notice',
text: 'No one ever pays attention to me. Why should they? I\'m practically invisible.',
addClass: 'translucent'
});
// You need this CSS:
// [data-pnotify].pnotify.translucent.pnotify-fade-in {
// opacity: 0.8;
// }
"
>