-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
103 lines (90 loc) · 3.13 KB
/
example.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
<!DOCTYPE HTML>
<html>
<head>
<title>Unnotify Example</title>
<link rel="stylesheet" href="node_modules/animate.css/animate.min.css">
</head>
<body>
<h1>This is the example HTML file for running unnotify examples.</h1>
</body>
<script type="text/javascript" src="dist/unnotify.min.js"></script>
<script type="text/javascript">
function clickedConfirm(evt, id) {
evt.preventDefault();
console.log("Clicked confirm with notification ID: "+id);
}
function clickedCancel(evt, id) {
evt.preventDefault();
console.log("Clicked cancel with notification ID: "+id);
}
function clickedYes(evt, id) {
evt.preventDefault();
console.log("Clicked yes with notification ID: "+id);
}
function clickedNo(evt, id) {
evt.preventDefault();
console.log("Clicked no with notification ID: "+id);
}
function nextCallback(evt, id, valueEntered) {
evt.preventDefault();
console.log("Clicked Next with the following content: ", valueEntered);
}
window.addEventListener('load', function () {
var left = new unnotify.Unnotify('right', true);
let temp = left.show("Hi", "From right", {
timeout: 0,
type: 'info',
animateIn: 'fadeInUpBig',
animateOut: 'rotateOutDownLeft'
});
setTimeout(function () {
left.destroy(temp);
}, 8000);
left.show("Hi", "From right", {
timeout: 5000,
type: 'danger',
animateIn: 'fadeInUpBig',
animateOut: 'rotateOutDownLeft'
});
left.confirm("Confirm this content, and check the console", {
type: "warning",
animateIn: "fadeInUpBig",
animateOut: "rotateOutDownLeft"
}, clickedConfirm, clickedCancel);
left.confirm("Confirm this content, and check the console", {
type: "info",
animateIn: "fadeInUpBig",
animateOut: "rotateOutDownLeft"
}, clickedConfirm, clickedCancel);
left.affirm("Affirm this content, and check the console", {
type: "info",
animateIn: "fadeInUpBig",
animateOut: "rotateOutDownLeft"
}, clickedYes, clickedNo);
var l = ["info", "warning", "success", "danger"];
for (var i = 0; i < l.length; i++) {
var t = l[i];
left.input("This is a message -> enter some content in the input below:", {
type: t,
animateIn: "fadeInUpBig",
animateOut: "rotateOutDownLeft"
}, nextCallback, clickedCancel);
}
// var right = new unnotify.Unnotify('right');
// right.show("Hi", "From right", {
// timeout: 4000,
// type: 'success'
// });
unnotify.init('left');
var a = unnotify.show("Hi", "From normal (left)", {
timeout: 0,
type: 'success',
animateIn: 'fadeInRight',
animateOut: 'zoomOutUp'
});
setTimeout(function () {
unnotify.destroy(a);
}, 4000);
});
</script>
</html>