forked from AlexKvazos/VanillaToasts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
294 lines (275 loc) · 7.48 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
<html>
<head>
<title>VanillaToasts - Agnostic Javascript Library for Website Notifications</title>
<script src="vanillatoasts.js"></script>
<link href="vanillatoasts.css" rel="stylesheet"></script>
<link href='http://fonts.googleapis.com/css?family=Lobster|Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<a href="https://github.com/AlexKvazos/VanillaToasts"><img style="position: fixed; top: 0; left: 0; border: 0;" src="https://camo.githubusercontent.com/82b228a3648bf44fc1163ef44c62fcc60081495e/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png"></a>
<style>
/*
Date: 17.V.2011
Author: pumbur <[email protected]>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #222;
-webkit-text-size-adjust: none;
}
.profile .hljs-header *,
.ini .hljs-title,
.nginx .hljs-title {
color: #fff;
}
.hljs-comment,
.hljs-preprocessor,
.hljs-preprocessor .hljs-title,
.hljs-pragma,
.hljs-shebang,
.profile .hljs-summary,
.diff,
.hljs-pi,
.hljs-doctype,
.hljs-tag,
.css .hljs-rule,
.tex .hljs-special {
color: #444;
}
.hljs-string,
.hljs-symbol,
.diff .hljs-change,
.hljs-regexp,
.xml .hljs-attribute,
.smalltalk .hljs-char,
.xml .hljs-value,
.ini .hljs-value,
.clojure .hljs-attribute,
.coffeescript .hljs-attribute {
color: #ffcc33;
}
.hljs-number,
.hljs-addition {
color: #00cc66;
}
.hljs-built_in,
.hljs-literal,
.hljs-type,
.hljs-typename,
.go .hljs-constant,
.ini .hljs-keyword,
.lua .hljs-title,
.perl .hljs-variable,
.php .hljs-variable,
.mel .hljs-variable,
.django .hljs-variable,
.css .funtion,
.smalltalk .method,
.hljs-hexcolor,
.hljs-important,
.hljs-flow,
.hljs-inheritance,
.hljs-name,
.parser3 .hljs-variable {
color: #32aaee;
}
.hljs-keyword,
.hljs-tag .hljs-title,
.css .hljs-tag,
.css .hljs-class,
.css .hljs-id,
.css .hljs-pseudo,
.css .hljs-attr_selector,
.hljs-winutils,
.tex .hljs-command,
.hljs-request,
.hljs-status {
color: #6644aa;
}
.hljs-title,
.ruby .hljs-constant,
.vala .hljs-constant,
.hljs-parent,
.hljs-deletion,
.hljs-template_tag,
.css .hljs-keyword,
.objectivec .hljs-class .hljs-id,
.smalltalk .hljs-class,
.lisp .hljs-keyword,
.apache .hljs-tag,
.nginx .hljs-variable,
.hljs-envvar,
.bash .hljs-variable,
.go .hljs-built_in,
.vbscript .hljs-built_in,
.lua .hljs-built_in,
.rsl .hljs-built_in,
.tail,
.avrasm .hljs-label,
.tex .hljs-formula,
.tex .hljs-formula * {
color: #bb1166;
}
.hljs-doctag,
.profile .hljs-header,
.ini .hljs-title,
.apache .hljs-tag,
.parser3 .hljs-title {
font-weight: bold;
}
.coffeescript .javascript,
.javascript .xml,
.tex .hljs-formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .hljs-cdata {
opacity: 0.6;
}
.hljs,
.hljs-subst,
.diff .hljs-chunk,
.css .hljs-value,
.css .hljs-attribute {
color: #aaa;
}
</style>
<style>
body {
background: #E6E6E6;
padding-top: 40px;
font-family: 'Open Sans';
}
h1, h2, h3 {
margin: 0;
}
h1 {
font-family: 'Lobster';
font-size: 70px;
color: #1B7FD5
}
h2 {
font-weight: normal;
font-size: 15px;
}
.editor {
text-align: left;
margin-top: 40px;
}
pre {
padding: 0;
}
textarea {
position: absolute;
width: 100%;
left: 0;
height: 300px;
resize: none;
}
</style>
<div class="container">
<div class="row" style="text-align:center">
<div class="col-md-12">
<h1>VanillaToasts</h1>
<h2>Agnostic Javascript Library for Website Notifications</h2>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="well editor">
<h3>Create Toast</h3>
<hr>
<div class="row">
<div class="col-md-2">
<label>Title</label>
<input name="title" type="text" class="form-control" value="GitHub">
</div>
<div class="col-md-8">
<label>Text</label>
<input name="text" type="text" class="form-control" value="Welcome to the VanillaToasts demo!">
</div>
<div class="col-md-2">
<label>Type</label>
<select name="type" class="form-control">
<option value="">-</option>
<option selected value="success">success</option>
<option value="info">info</option>
<option value="warning">warning</option>
<option value="error">error</option>
</select>
</div>
</div>
<div class="row" style="margin-top:20px">
<div class="col-md-12">
<label>Icon (Optional)</label>
<input type="text" name="icon" value="http://cdn2-b.examiner.com/sites/default/files/styles/image_content_width/hash/95/78/95789353532452967f80ac6758c671be.png?itok=QUTdjSOh" class="form-control">
</div>
</div>
<div class="row" style="margin-top:20px">
<div class="col-md-3">
<label>Timeout (Optional)</label>
<input type="number" name="timeout" value="4500" class="form-control">
</div>
</div>
<hr>
<button class="btn btn-primary" onclick="create()">Create</button>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="well">
<h3>Documentation</h3>
<hr>
<h4>Installing</h4>
<br>
<p>Using NPM</p>
<pre><code class="javascript">
$ npm install vanillatoasts
var VanillaToasts = require('vanillatoasts');
</code></pre>
<br>
<p>Using Bower</p>
<pre><code class="html">
$ bower install vanillatoasts
<script src="/bower_components/vanillatoasts/VanillaToasts.js"></script>
</code></pre>
<br>
<p>Do not forget to include the CSS file on your site!</p>
<pre><code class="html">
<link rel="stylesheet" href="/bower_components/vanillatoasts/vanillatoasts.css">
</code></pre>
<hr>
<h4>Usage</h4><br>
<pre><code class="javascript">
VanillaToasts.create({
title: 'Welcome to my site',
text: 'This toast will hide after 5000ms or when you click it',
type: 'warning', // success, info, warning, error / optional parameter
icon: '/img/alert-icon.jpg', // optional parameter
timeout: 5000 // hide after 5000ms, // optional parameter
callback: function() { ... } // executed when toast is clicked / optional parameter
});
</code></pre>
</div>
</div>
</div>
</div>
<script>
function create() {
VanillaToasts.create({
title: document.body.querySelector('input[name="title"]').value || null,
text: document.body.querySelector('input[name="text"]').value || null,
type: document.body.querySelector('select[name="type"]').value || null,
icon: document.body.querySelector('input[name="icon"]').value || null,
timeout: document.body.querySelector('input[name="timeout"]').value || null
});
}
</script>
</body>
</html>