forked from jaredreich/notie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
149 lines (123 loc) · 4.34 KB
/
test.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name='viewport' content="width=device-width,initial-scale=1,maximum-scale=1">
<title>Notie Test Page</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="dist/notie.css">
<!-- Font -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Satisfy' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
font-family: 'Lato', sans-serif;
background-color: rgb(255, 170, 133);
}
.div-ext {
height: 100vh;
width: 100%;
display: table;
text-align: center;
}
.div-int {
display: table-cell;
vertical-align: middle;
}
button {
cursor: pointer;
font-size: 20px;
border: 2px solid white;
border-radius: 2px;
background-color: transparent;
outline: 0;
margin: 2px;
margin-top: 4px;
padding: 5px;
color: white;
}
</style>
</head>
<body>
<div class="div-ext">
<div class="div-int">
<div style="font-family: 'Satisfy', cursive;color:white;font-size:80px;margin-bottom:20px;">notie.js</div>
<div style="margin-bottom:20px;padding-left:50px;padding-right:50px;">
<button onclick="success();">Success</button>
<button onclick="warning();">Warning</button>
<button onclick="error();">Error</button>
<button onclick="info();">Info</button>
<button onclick="confirm();">Confirm</button>
<button onclick="input();">Input</button>
<button onclick="select();">Select</button>
</div>
<div style="color:white;">Official demo page:</div>
<a href="https://jaredreich.com/projects/notie" target="_blank" style="color:white;">https://jaredreich.com/projects/notie</a>
</div>
</div>
<!-- JavaScript -->
<script src="notie.js"></script>
<script>
notie.setOptions({
colorSuccess: '#57BF57',
colorWarning: '#D6A14D',
colorError: '#E1715B',
colorInfo: '#4D82D6',
colorNeutral: '#A0A0A0',
colorText: '#FFFFFF',
animationDelay: 300,
backgroundClickDismiss: true
});
function success() {
notie.alert(1, 'Success!');
}
function warning() {
notie.alert(2, 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>', 2);
}
function error() {
notie.alert(3, 'Error.', 2);
}
function info() {
notie.alert(4, 'Information.', 2);
}
function confirm() {
notie.confirm('Are you sure you want to do that?<br><b>That\'s a bold move...</b>', 'Yes', 'Cancel', function() {
notie.alert(1, 'Good choice! :D', 2);
}, function() {
notie.alert(3, 'Aw, why not? :(', 2);
});
}
function input() {
notie.input({
type: 'text',
placeholder: '[email protected]',
prefilledValue: ''
}, 'Please enter your email address:', 'Submit', 'Cancel', function(valueEntered) {
notie.alert(1, 'You entered: ' + valueEntered, 2);
}, function(valueEntered) {
notie.alert(3, 'You cancelled with this value: ' + valueEntered, 2);
});
}
function select() {
notie.select('Demo item #1, owner: Jane Smith',
[
{ title: 'Share' },
{ title: 'Open', color: '#57BF57' },
{ title: 'Edit', type: 2 },
{ title: 'Delete', type: 3 }
],
function() {
notie.alert(1, 'Share item!', 3);
}, function() {
notie.alert(1, 'Open item!', 3);
}, function() {
notie.alert(2, 'Edit item!', 3);
}, function() {
notie.alert(3, 'Delete item!', 3);
});
}
</script>
</body>
</html>