-
Notifications
You must be signed in to change notification settings - Fork 374
/
test.html
192 lines (175 loc) · 5.27 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
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
<!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">
<style>
/* Styles can be overwritten after inlcuding notie.css */
.notie-container {
/*box-shadow: none;*/
}
.notie-background-overlay {
/*background-color: #F0F0F0;*/
}
</style>
<!-- Font -->
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
<style>
body {
margin: 0;
padding: 0;
font-family: 'Roboto Mono', monospace;
background-color: #E8E8E8;
}
.div-ext {
height: 100vh;
width: 100%;
display: table;
text-align: center;
}
.div-int {
display: table-cell;
vertical-align: middle;
}
button {
cursor: pointer;
font-size: 18px;
border: 2px solid #000;
border-radius: 2px;
background-color: transparent;
outline: 0;
margin: 2px;
margin-top: 4px;
padding: 5px;
}
a {
color: #585858;
}
</style>
</head>
<body>
<div class="div-ext">
<div class="div-int">
<div style="font-size:40px;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="force()">Force</button>
<button onclick="confirm()">Confirm</button>
<button onclick="input()">Input</button>
<button onclick="select()">Select</button>
<button onclick="date()">Date</button>
</div>
<div><b>Official demo page:</b></div>
<a href="https://jaredreich.com/notie" target="_blank" style="font-size:12px;">https://jaredreich.com/notie</a>
</div>
</div>
<!-- JavaScript -->
<script src="dist/notie.js"></script>
<script>
notie.setOptions({
alertTime: 2
})
function success () {
notie.alert({ type: 1, text: 'Success!', time: 2 })
}
function warning () {
notie.alert({ type: 2, text: 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>', time: 2 })
}
function error () {
notie.alert({ type: 3, text: 'Error.', time: 2 })
}
function info () {
notie.alert({ type: 4, text: 'Information.', time: 2 })
}
function force () {
notie.force({
type: 3,
text: 'You cannot do that, sending you back.',
buttonText: 'OK',
callback: function () {
notie.alert({ type: 3, text: 'Maybe when you\'re older...' })
}
})
}
function confirm () {
notie.confirm({
text: 'Are you sure you want to do that?<br><b>That\'s a bold move...</b>',
cancelCallback: function () {
notie.alert({ type: 3, text: 'Aw, why not? :(', time: 2 })
},
submitCallback: function () {
notie.alert({ type: 1, text: 'Good choice! :D', time: 2 })
}
})
}
function input() {
notie.input({
text: 'Please enter your email address:',
cancelCallback: function (value) {
notie.alert({ type: 3, text: 'You cancelled with this value: ' + value, time: 2 })
},
submitCallback: function (value) {
notie.alert({ type: 1, text: 'You entered: ' + value, time: 2 })
},
type: 'text',
placeholder: '[email protected]',
spellcheck: 'false'
})
}
function select() {
notie.select({
text: 'Demo item #1, owner is Jane Smith',
cancelText: 'Close',
cancelCallback: function () {
notie.alert({ type: 5, text: 'Cancel!' })
},
choices: [
{
text: 'Share',
handler: function () {
notie.alert({ type: 1, text: 'Share item!' })
}
},
{
text: 'Open',
handler: function () {
notie.alert({ type: 1, text: 'Open item!' })
}
},
{
type: 2,
text: 'Edit',
handler: function () {
notie.alert({ type: 2, text: 'Edit item!' })
}
},
{
type: 3,
text: 'Delete',
handler: function () {
notie.alert({ type: 3, text: 'Delete item!' })
}
}
]
})
}
function date() {
notie.date({
value: new Date(2015, 8, 27),
cancelCallback: function (date) {
notie.alert({ type: 3, text: 'You cancelled: ' + date.toISOString() })
},
submitCallback: function (date) {
notie.alert({ type: 1, text: 'You selected: ' + date.toISOString() })
}
})
}
</script>
</body>
</html>