-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
493 lines (407 loc) · 14.6 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
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='https://www.w3schools.com/w3css/4/w3.css'/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="w3.css"/>
<link rel="stylesheet" href="css/all.css"/>
<link rel="stylesheet" href="theme.css"/>
<title>pling.js</title>
<script src="https://rawcdn.githack.com/stonny71/pling/95d346c1c9ad0faa10c73ee3c041ea8e1fb8a4e8/pling.js"> </script>
<style type="text/css">.w3-theme-l5 {color:#000 !important; background-color:#f4f5f9 !important}
.w3-theme-l4 {color:#000 !important; background-color:#d9ddec !important}
.w3-theme-l3 {color:#000 !important; background-color:#b4bad8 !important}
.w3-theme-l2 {color:#fff !important; background-color:#8e98c5 !important}
.w3-theme-l1 {color:#fff !important; background-color:#6876b1 !important}
.w3-theme-d1 {color:#fff !important; background-color:#455185 !important}
.w3-theme-d2 {color:#fff !important; background-color:#3d4876 !important}</div>
<hr>
Do not us <mark>\n</mark> for new lines inside the <mark>Pling() </mark> function, use <mark><b/> </mark> instead.<br />
You can always use HTML markup inside <mark>Pling()</mark> function <br>
<div class="w3-panel w3-light-grey ">
<h4>sample</h4>
<div class ="htmlHigh notranslate w3-code w3-tiny">
Pling("Have a nice day my friend <br/> I wish you good luck");
</div>
<button class="w3-btn w3-theme-dark w3-round" onclick ="Pling('Have a nice day my friend <br> I wish you good luck')">demo</button>
</div>
.w3-theme-d3 {color:#fff !important; background-color:#353f68 !important}
.w3-theme-d4 {color:#fff !important; background-color:#2e3659 !important}
.w3-theme-d5 {color:#fff !important; background-color:#262d4a !important}
.w3-theme-light {color:#000 !important; background-color:#f4f5f9 !important}
.w3-theme-dark {color:#fff !important; background-color:#262d4a !important}
.w3-theme-action {color:#fff !important; background-color:#262d4a !important}
.w3-theme {color:#fff !important; background-color:#4c5994 !important}
.w3-text-theme {color:#4c5994 !important}
.w3-border-theme {border-color:#4c5994 !important}
.w3-hover-theme:hover {color:#fff !important; background-color:#4c5994 !important}
.w3-hover-text-theme:hover {color:#4c5994 !important}
.w3-hover-border-theme:hover {border-color:#4c5994 !important}
header, footer, .theme{
color:# !important;
}
header {
}
textarea {
border: none;
width:100%;
font-size:12px;
background:#3E2723;
border-radius:4px;
padding:4px;
color:#FFB74D;
}
.b{
font-weight:500;
}
.flow{
font-weight:300;
font-size:18px;
}
mark{
color:#FF5722 ! important;
background:transparent;
}
/**main container**/
.bat .box{
height:300px;
border:10px solid #263238;
background:#78909C !important;
color:#333 !important;
}
/**title of the alert**/
/**content of the alert**/
.bat .content{
color:#fff !important;
}
/**ok button**/
.bat .btn{
display:none;
background:rgba(0,0,0,0.1) !important;
color:#fff !important;
}
/**main container**/
.bar .box{
background:#fff !important;
color:#333 !important;
}
/**title of the alert**/
.bar .title{
border-top-right-radius:4px;
border-top-left-radius:4px;
background:#283593 ! important;
color:#fff !important;
padding:100px;
}
/**content of the alert**/
.bar .content{
color:#333 !important;
padding:0px 5px;
}
/**ok button**/
.bar .btn{
background-colorround:#DD2600 !important;
color:#333 !important;
}
/**main container**/
.custom .box{
background:#333 !important;
color:#fff !important;
}
/**title of the alert**/
.custom .title{
background:#64B5F6 ! important;
color:#fff !important;
}
/**content of the alert**/
.custom .content{
color:#fff !important;
}
/**ok button**/
.custom .btn{
background:#333 !important;
color:#fff !important;
}
.w3-idigo {
background:#333 ! important;
color:white;
}
body,.w3-code{
font-family: Poppins, sans-serif;
}
.g{
color:#424242 ! important;
}
.w3-margin{
margin:0px;
}
a{
text-decoration:none;
color:yellow;
}
.w3-btn{
outline:none;
}
.w3-panel, .w3-code{
border-color:#90A4AE ! important;
}
.git button{
border-radius:100% 0% 0% 100% / 0% 100% 0% 100%;
position:fixed;
top:0;
right:0;
}
</style>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
</head>
<body class="w3-theme-l5 w3-large" >
<header style="padding-top:10px" class=" w3-indig w3-theme-dark" >
<a class="git" href="https://github.com/stonny71/pling" ><button class="w3-card w3-btn w3-blue w3-tiny" >🌟 github</button></a>
<center>
<div class="w3-round w3-border w3-yellow w3-margin w3-xxlarge " ><center>
<div class="fa fa-cat w3-paddig" style="margin:10px" >
<div class=" " >PLING<span class="w3-jumbo w3-text-red" ><span class="w3-xlarge" >■</span></span>JS</div>
</div>
</center></div>
</center>
<div class="w3-padding flow " >
<p class="w3-card w3-padding" ><i class=" fa fa-cat"></i> A tiny inline javaScript library for displaying custom alerts or pop-ups. </p>
<p class="w3-padding w3-card" ><i class=" fa fa-cat"></i> The file size is 2kb, nothing to worry about!</p>
<p class="w3-padding w3-card w3-justiy" ><i class=" fa fa-cat"></i> Helps you write fashionable alerts directly with HTML without needing to write your JavaScript inside a script tag.</p>
</div>
</header>
<div class="w3-margin w3-card w3-padding w3-white" >
<br>
<center>
<button onclick="Pling('Thank you for your feedback we will attend to you shortly.','Admin')" class="w3-round-xxlarge w3-btn w3-theme-dark w3-text-white w3-block w3-padding-large rad" >Demo 1</button>
<br>
<button onclick="Pling('Downloading complete !')" class="w3-round-xxlarge w3-btn w3-text-white w3-block w3-padding-large w3-theme-dark"> Demo 2</button>
<br>
<button onclick="Pling('Thank you for choosing our product','Welcome!','bar')" class="w3-round-xxlarge w3-btn w3-text-white w3-block w3-padding-large w3-theme-dark"> Demo 3</button>
<br>
<button onclick="Pling('This is a sample or demonstration on the things you can do with Pling.js...Hope you enjoy.\nclick outside the box to exit','','bat')" class="w3-round-xxlarge w3-btn w3-text-white w3-block w3-padding-large w3-theme-dark"> Demo 4</button>
<br>
</center>
<br></div>
<hr>
<!--doc-->
<div class="w3-card g w3-padding w3-margin w3-white" >
<h1 id="doc" class="w3-xxlarge" ><b>HOW TO USE</b></h1>
<p class="w3-xlarge" >
<p class="w3-small" ><b class="" >The source link should be placed inside the head section of your html document.</b></p>
To start using, you either link from the <b class="w3-text-indigo" ><a href="https://rawcdn.githack.com/stonny71/pling/95d346c1c9ad0faa10c73ee3c041ea8e1fb8a4e8/pling.js" class="w3-text-indigo" >CDN</a></b>
</p>
<div class=" w3-small w3-code htmlHigh notranslate w3-text-red w3-light-grey" >
<script src="https://rawcdn.githack.com/stonny71/pling/95d346c1c9ad0faa10c73ee3c041ea8e1fb8a4e8/pling.js"> </script>"> </script>
</div>
<p class="g" >
OR download the source and host from your computer.
</p>
<div class=" w3-code w3-light-grey htmlHigh notranslate w3-text-red w3-small" >
<script src="pling.js"> </script>
</div>
<hr>
<div class="w3-panel w3-light-grey w3-small">
<h4>Quick Template</h4>
<div class="w3-code htmlHigh notranslate w3-small w3-light-grey">
<!DOCTYPE html><br><html><br>
<<head><br>
<title>Pling js </title><br>
<script src="https://rawcdn.githack.com/stonny71/pling/95d346c1c9ad0faa10c73ee3c041ea8e1fb8a4e8/pling.js"></script><br>
</head><br>
<body><br><br>
<button onclick="Pling('Hello world')">demo</h1><br>
<br>
</body><br>
</html>
</div>
<hr>
</div>
</div>
<div class="w3-card w3-theme-action w3-padding" >
<h3 class="b w3-text-yellow" >Displaying alerts using pling.js</h3>
The main syntax is <b class="w3-text-orange" >Pling(syntax1, syntax2, syntax3)</b><br>
where: <br>
<b class="w3-text-orange" >syntax1</b> is the content of the alert.<br>
<b class="w3-text-orange" >syntax2</b> is the title of the alert <span class="w3-tiny" >(optional).</span><br>
<b class="w3-text-orange" >syntax3</b> is used for adding custom css styles to the alert<span class="w3-tiny" >(optional).</span><br>
</div>
<hr>
<div class="w3-card w3-margin w3-padding w3-white g" >
<h2 class="w3-text-indigo b" >Displaying alerts with a title. </h2>
<p>The first argument is the content of the alert while the second argument is the title.</p>
<div class="w3-panel w3-light-grey w3-small">
<div class="w3-code htmlHigh notranslate w3-small w3-light-grey">
<button onclick="Pling('I am the content', 'I am the title')"> demo </button>
</div></div>
<p>
<button onclick="Pling('I am the content','I am the title')" class="w3-btn w3-theme-dark w3-round w3-block" >Demo</button>
</p>
</div>
<br>
<hr>
<div class="w3-card w3-padding w3-margin w3-white g" >
<h2 class="w3-text-indigo b" >Displaying alerts without a title. </h2>
<p>
To display alert without a title, the second argument should not be included.
</p>
<div class="w3-panel w3-light-grey w3-small">
<div class="w3-code htmlHigh notranslate w3-small w3-light-grey">
<button onclick="Pling('I am the content')"> demo </button>
</div></div>
<p>
<button onclick="Pling('i have no title')" class="w3-btn w3-theme-dark w3-round w3-block" >Demo</button>
</p>
</div>
<br>
<hr>
<div class="w3-padding w3-card w3-theme-action " >
<h1 class="w3-text-yellow b" >Using pling.js inside JavaScript environment.</h1>
<p>
Pling.js works like JavaScript alert() function, just that Pling.js provides extra parameters for adding more features to your alerts.<br>
All you just need is replace <span class="w3-text-yellow b" >alert</span> with <span class="w3-text-yellow b" >Pling</span>
</p>
<div class="w3-panel w3-light-grey w3-small">
<div class="w3-code htmlHigh notranslate w3-small w3-light-grey">
<script><br><br>
Pling('I am the content');<br> <br></script>
</div></div>
<br>
</div>
<hr>
<div class="w3-padding w3-margin w3-card g w3-white " >
<h2 class="w3-text-indigo b" >Using pling.js inside another function</h2>
<p>
In the below sample, Pling.js is used to display the current year.
</p>
<div class="w3-code w3-light-grey htmlHigh notranslate w3-small" >
<script><br>
<br>
function showYear(){<br>
d= new Date();<br>
year = d.getFullYear();<br>
Pling(year, "The current year is");<br>
}<br><br>
</script>
</div>
<button onclick="showYear()" class="w3-block w3-round w3-btn w3-theme-dark w3-ripple" >sample</button>
</div>
<br>
</div>
<hr>
<div class="w3-theme-dark w3-card w3-padding" >
<h2 class="w3-text-yellow b" >Adding css styles to your pling.js alert</h2>
<p style="line-height:30px" >
To add a custom css to the alert, include the third argument.<br><br>
<b class="w3-text-yellow" >
The third argument is a name you will use inside your css sheet;<br><br>
<mark class="w3-text-blue-grey" >sample:</mark></b><br>
<b class="w3-text-orange" >
Pling("hello my button is red", "red button", "custom");
</b> <p></p>
Pling.js has several class names you can use to add customized styles to your alert.<br>
<p></p>
<mark>.btn</mark> is the "ok button"<br>
<mark>.title </mark> is the title of the alert.<br>
<mark>.content</mark> is the content of the alert.
<mark>.box</mark> is the alert container itself.
</p>
</div>
<hr>
<div style="" class="w3-card w3-padding w3-margin g w3-white" >
<h2 class="w3-text-indigo b" >Customizing the alert using css</h2>
Using <mark class="b" >custom</mark> as the third argument.
<br>
You can always use any name as the third argument. (any name used as the third argument should be used inside your css sheet to style the alert.<br> you can give different names to different alerts in your project.<br>
<div class="w3-panel w3-light-grey w3-small">
<div class="w3-code htmlHigh notranslate w3-small w3-light-grey">
<button onclick = 'Pling( "content", "title", "custom")'> <br>
</button>
</div></div>
<br>
Inside your css sheet:
<div class="w3-panel w3-light-grey w3-small">
<div class="w3-code htmlHigh notranslate w3-small w3-light-grey">
<style><br><br>
/**main container**/<br>
.custom .box{<br>
background:#333 !important;<br>
color:#fff !important;<br>
}
<br><br>
/**title of the alert**/<br>
.custom .title{<br>
background:#64B5F6 ! important;<br>
color:#fff !important;<br>
}
<br><br>
/**content of the alert**/<br>
.custom .content{<br>
color:#fff !important;<br>
}<br>
<br>
/**ok button**/<br>
.custom .btn{<br>
background:#333 !important;<br>
color:#fff !important;<br>
}<br><br>
</style>
</div>
<div>
<button class="w3-medium w3-theme-dark w3-round w3-btn w3-block" onclick="Pling('I have a dark button','customized css','custom')">sample</button>
</div></div>
<hr>
<div class="w3-theme-l5 w3-padding w3-small" >
<h3 class="w3-text-red" ><i class="fa fa-info-circle" > </i> NOTE</h3>
<p>Always add <mark>!important</mark> while trying to add custom colors in the css sheet. e.g<br>
<div class="w3-text-purple" >
<mark>.custom .btn</mark>{<br>
<mark class="w3-text-teal" >background</mark>:red !important;<br>
<mark class="w3-text-teal" >color</mark>:white !important<br>
}</div>
<hr>
Do not us <mark>\n</mark> for new lines inside the <mark>Pling() </mark> function, use <mark><b/> </mark> instead.<br />
You can always use HTML markup inside <mark>Pling()</mark> function <br>
<div class="w3-panel w3-light-grey ">
<h4>sample</h4>
<div class ="htmlHigh notranslate w3-code w3-tiny">
Pling("Have a nice day my friend <br/> I wish you good luck");
</div>
<button class="w3-btn w3-theme-dark w3-round" onclick ="Pling('Have a nice day my friend <br> I wish you good luck')">demo</button>
</div>
</div>
</div>
</p>
</div>
<footer class=" w3-theme-dark w3-padding w3-padding-32" >
<center>
<div class="fa w3-xxlarge fa-cat w3-paddng" style="color:yellow" >
</div>
<br>
Developed by <a href="#https://github.com/stonny71" class="w3-large" >Stonny</a>
</center>
<p class="w3-xlarge" >
</p>
<p class="" style="text-align:left" >
<i class="fa fa-info-circle w3-text-red" ></i>
<a href="https://code.sololearn.com/W2kSJGJl1d29/?ref=app" >Pocket Life</a> game is updated and implemented with pling.js, you can play to see the full effect of this project.
<hr>
<i class="w3-small" >
This library is an open source project, feel free to distribute, edit and use at your own satisfaction. Any suggestions and contributions is highly welcomed.
</i>
</p>
</footer>
<script src="https://www.w3schools.com/lib/w3codecolor.js"> </script>
<script type="text/javascript">
w3CodeColor()
function showYear(){
d= new Date();
year = d.getFullYear();
Pling(year, "The current year is");
}
//Pling("colois hsh","red","tag")
</script>
</body>
</html>