-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
814 lines (758 loc) · 19.9 KB
/
index.html
File metadata and controls
814 lines (758 loc) · 19.9 KB
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
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#EE5522">
<!-- Primary Meta Tags -->
<title>LilScriptJS - JavaScript Framework</title>
<meta name="title" content="LilScriptJS - JavaScript Framework">
<meta name="description" content="LilScript was created by Dev Bash on 26th April, 2021
to make coding and debugging easier and faster, it comes with many debugging features.
LilScript is light-weight, fast, and easy to learn.">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://lilscriptjs.github.com/">
<meta property="og:title" content="LilScriptJS - JavaScript Framework">
<meta property="og:description" content="LilScript was created by Dev Bash on 26th April, 2021
to make coding and debugging easier and faster, it comes with many debugging features.
LilScript is light-weight, fast, and easy to learn.">
<meta property="og:image" content="back.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://lilscriptjs.github.com/">
<meta property="twitter:title" content="LilScriptJS - JavaScript Framework">
<meta property="twitter:description" content="LilScript was created by Dev Bash on 26th April, 2021
to make coding and debugging easier and faster, it comes with many debugging features.
LilScript is light-weight, fast, and easy to learn.">
<meta property="twitter:image" content="back.png">
<script src="LilScriptJS/lilscript.js"></script>
<script src="lib/bootstrap.js"></script>
<script src="lib/codemirror.js"></script>
<script src="lib/javascript.js"></script>
<script src="lib/matchbrackets.js"></script>
<script src="lib/htmlmixed.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" href="lib/bootstrap.css">
<link rel="stylesheet" href="lib/codemirror.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#"><img id="logo" src="logo.png"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="">About</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">More</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li>
<a class="dropdown-item" href="">Contributing</a>
</li>
<li>
<a class="dropdown-item" href="">Rating</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>
<a class="dropdown-item" href="">Buy Coffee</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Join</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<br>
<br>
<br>
<br>
<div id="github">
<a href="https://github.com/DevBash1/LilScriptJS">
<p>LilScriptJS</p>
<img src="GitHub.png">
</a>
</div>
<div class="card">
<div class="card-body">
LilScript is a JavaScript Framework<br>
That makes coding and debugging easier.
</div>
</div>
<div id="board">
Introduction
</div>
<div id="write">
LilScript was created by <code>Dev Bash</code> on <code>26<sup>th</sup> April, 2021</code>
to make coding and debugging easier and faster, it comes with many debugging features.
<br>LilScript is light-weight, fast, and easy to learn.
</div>
<br>
<div id="board">
Using LilScriptJS
</div>
<div id="write">
To use <code>LilScriptJS</code>, we have to first set the script type to <code>text/lilscript</code> in our script tag.
Then write our code into the script tag or use the src attribute in our <code>JavaScript</code> code.<br>
</div>
<textarea id="use">
<script type="text/lilscript" src="path/to/script.js">
</script>
OR
<script type="text/lilscript">
box "hello";
</script>
</textarea>
<script>
let use = document.getElementById("use");
var edit = CodeMirror.fromTextArea(use, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<div id="board">
Examples
</div>
<div id="write">
This is an example of <code>Boxing</code> in LilScript.<br>
<code>Boxing</code> is the same as <code>Alerting</code> in JavaScript.
</div>
<textarea id="example">
func hi(){
#This will box 'HI'
box "HI";
}
hi()
</textarea>
<center><button type="button" id="run" class="btn btn-dark run">Run</button></center>
<script>
let example = document.getElementById("example");
var editor = CodeMirror.fromTextArea(example, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run");
run.on("click",function(){
try{
eval(ls.run(editor.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Commenting
</div>
<div id="write">
<code>Commenting</code> in LilScript is easy and nice<br>
It comes with 3 types of Comments including that of <code>Python</code>
</div>
<textarea id="comment">
{"THIS IS A HEAD COMMENT"}
#This is a single line comment
@jump
This is a multiline comment
It can contain comments
from many lines
@land
box "NOT COMMENTED";
@stop
box "COMMENTED";
</textarea>
<center><button type="button" id="run1" class="btn btn-dark run">Run</button></center>
<script>
let comment = document.getElementById("comment");
var editor1 = CodeMirror.fromTextArea(comment, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run1");
run.on("click",function(){
try{
eval(ls.run(editor1.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Logging
</div>
<div id="write">
<code>Logging</code> is used to log text to the console<br>
Just like the <code>console.log</code> function.
</div>
<textarea id="log">
func sayMyName(name){
log "My name is " + name;
}
sayMyName("Favour");
</textarea>
<center><button type="button" id="run2" class="btn btn-dark run">Run</button></center>
<script>
let log = document.getElementById("log");
var editor2 = CodeMirror.fromTextArea(log, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run2");
run.on("click",function(){
try{
eval(ls.run(editor2.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Array Pushing
</div>
<div id="write">
<code>LilScript</code> has a simple way of pushing items to array<br>
Just like that of <code>PHP</code>.
</div>
<textarea id="push">
let friends = ["Keto","Praise"];
friends[] = "Ese";
friends[] = "Chisom";
box friends;
</textarea>
<center><button type="button" id="run3" class="btn btn-dark run">Run</button></center>
<script>
let push = document.getElementById("push");
var editor3 = CodeMirror.fromTextArea(push, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run3");
run.on("click",function(){
try{
eval(ls.run(editor3.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
String Reversing
</div>
<div id="write">
<code>LilScript</code> has a string reversing method.<br>
Just like that of <code>Python</code>
</div>
<textarea id="reverse">
let string = "I LOVE FAVOUR";
box string[::-1];
</textarea>
<center><button type="button" id="run4" class="btn btn-dark run">Run</button></center>
<script>
let reverse = document.getElementById("reverse");
var editor4 = CodeMirror.fromTextArea(reverse, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run4");
run.on("click",function(){
try{
eval(ls.run(editor4.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Function
</div>
<div id="write">
<code>Functions</code> in LilScript are declared with <code>func</code>.<br>
Just like in <code>Dragon</code>
</div>
<textarea id="func">
func greet(){
box "Greetings to you!";
}
let hello = func sayHello(name){
box "Hello, " + name;
greet();
}
hello("Bash");
</textarea>
<center><button type="button" id="run5" class="btn btn-dark run">Run</button></center>
<script>
let func = document.getElementById("func");
var editor5 = CodeMirror.fromTextArea(func, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run5");
run.on("click",function(){
try{
eval(ls.run(editor5.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Import
</div>
<div id="write">
<code>Import</code> in LilScript is used to import <code>functions</code> or other codes<br>
into our current code and use them,<br>
Just like in <code>Python</code> and <code>Java</code>.
</div>
<textarea id="imp">
import sum,sub from math.js
let a = 20;
let b = 10
sub(a,b);
</textarea>
<center><button type="button" id="run6" class="btn btn-dark run">Run</button></center>
<script>
let imp = document.getElementById("imp");
var editor6 = CodeMirror.fromTextArea(imp, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run6");
run.on("click",function(){
try{
eval(ls.run(editor6.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Keywords
</div>
<div id="write">
Lilscript <code>Keywords</code> are special words for caring out special operations in LilScript.<br>
There start with <code>@</code> and some requires closing.<br>
</div>
<textarea id="key">
box "I COME FIRST";
@run
box "I COME LAST";
@run
</textarea>
<center><button type="button" id="run7" class="btn btn-dark run">Run</button></center>
<script>
let key = document.getElementById("key");
var editor7 = CodeMirror.fromTextArea(key, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run7");
run.on("click",function(){
try{
eval(ls.run(editor7.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Keyword: @var
</div>
<div id="write">
The css <code>@var</code> helps to use JavaScript values in CSS.<br>
But the assigned css <code>@var</code> most come from the root and not be a refrence.<br>
</div>
<div id="testing">
<div class="greet">Hello</div>
<p class="message">Welcome to our home page</p>
</div>
<textarea id="css_var">
@var width = (screen.width - 40) + "px";
@css
.greet{
border:1px solid black;
width:@width;
color:orange;
}
.message{
color:navy
}
@css
</textarea>
<center><button type="button" id="run8" class="btn btn-dark run">Run</button></center>
<script>
let css_var = document.getElementById("css_var");
var editor8 = CodeMirror.fromTextArea(css_var, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run8");
run.on("click",function(){
try{
eval(ls.run(editor8.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Keyword: @css
</div>
<div id="write">
The <code>@css</code> keyword is used to embed css codes into LilScript.<br>
</div>
<div id="testing">
<h1 class="welcome">Welcome to my page</h1>
</div>
<textarea id="css">
@css
.welcome{
color: teal;
}
@css
</textarea>
<center><button type="button" id="run9" class="btn btn-dark run">Run</button></center>
<script>
let css = document.getElementById("css");
var editor9 = CodeMirror.fromTextArea(css, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run9");
run.on("click",function(){
try{
eval(ls.run(editor9.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Keyword: @run
</div>
<div id="write">
Codes in between the <code>@run</code> keyword runs immediately the compiler gets to it.<br>
</div>
<textarea id="runIt">
box "1";
box "2";
box "3";
box "4";
@run
box "5";
@run
</textarea>
<center><button type="button" id="run10" class="btn btn-dark run">Run</button></center>
<script>
let runIt = document.getElementById("runIt");
var editor10 = CodeMirror.fromTextArea(runIt, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run10");
run.on("click",function(){
try{
eval(ls.run(editor10.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Keyword: @boxline and @logline
</div>
<div id="write">
<code>@boxline</code> is used to box the number of the current line.<br>
Same with <code>@logline</code> but it logs the number instead.
</div>
<textarea id="line">
#THIS IS LINE 1
#THIS IS LINE 5
@boxline
@logline
</textarea>
<center><button type="button" id="run11" class="btn btn-dark run">Run</button></center>
<script>
let line = document.getElementById("line");
var editor11 = CodeMirror.fromTextArea(line, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run11");
run.on("click",function(){
try{
eval(ls.run(editor11.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Speed Test
</div>
<div id="write">
<code>@startTime</code> and <code>@endTime</code> are used to calculate the execution time of our code.<br>
It logs the time to the console.<br>
</div>
<textarea id="time">
@startTime
for(i=0;i<1000;i++){
}
@endTime
</textarea>
<center><button type="button" id="run12" class="btn btn-dark run">Run</button></center>
<script>
let time = document.getElementById("time");
var editor12 = CodeMirror.fromTextArea(time, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run12");
run.on("click",function(){
try{
eval(ls.run(editor12.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Selector
</div>
<div id="write">
A <code>Selector</code> is used to select <code>HTML</code> Elements for manipulation.<br>
</div>
<div id="testing">
<button id="btn">Click Me!</button>
</div>
<textarea id="select">
let btn = @("#btn");
btn.on("click", function(){
btn.html("Clicked!");
})
</textarea>
<center><button type="button" id="run13" class="btn btn-dark run">Run</button></center>
<script>
let select = document.getElementById("select");
var editor13 = CodeMirror.fromTextArea(select, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run13");
run.on("click",function(){
try{
eval(ls.run(editor13.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Event Listener
</div>
<div id="write">
An <code>Event Listener</code> is used to listen for <code>Events</code> in our <code>JavaScript</code> code.<br>
</div>
<div id="testing">
<button id="btn1">0</button>
</div>
<textarea id="listen">
let i = 0;
let btn = @("#btn1");
btn.on("click", function(){
i++;
btn.html(i)
});
</textarea>
<center><button type="button" id="run14" class="btn btn-dark run">Run</button></center>
<script>
let listen = document.getElementById("listen");
var editor14 = CodeMirror.fromTextArea(listen, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run14");
run.on("click",function(){
try{
eval(ls.run(editor14.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<div id="board">
Getting and Setting Values
</div>
<div id="write">
Getting values is easy in <code>LilScriptJS</code>
using <code>.html()</code>,<code>.text()</code> and <code>.val()</code>.<br>
It can also be used to set the values by passing values as a parameter.
</div>
<div id="testing">
<h1 id="show">No Name Entered!</h1>
<br>
<input id="enter" placeholder="Enter your name">
<button id="sendBtn">Send</button>
</div>
<textarea id="value">
let btn = @("#sendBtn");
let input = @("#enter");
let show = @("#show");
btn.on("click", function(){
if(input.val().trim() == ""){
box "Input is Empty";
return true;
}
show.text(input.val());
});
</textarea>
<center><button type="button" id="run16" class="btn btn-dark run">Run</button></center>
<script>
let value = document.getElementById("value");
var editor16 = CodeMirror.fromTextArea(value, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run16");
run.on("click",function(){
try{
eval(ls.run(editor16.getValue()));
}catch(e){
box e;
}
})
</script>
<div id="board">
Keyword: @find and @finds
</div>
<div id="write">
<code>LilScript</code> has an easy way of getting <code>HTML</code> Elements for manipulation.<br>
Using <code>@find</code> gets the first Element with the given text on it.<br>
While <code>@finds</code> returns an array of all Elements with the given text.
</div>
<div id="testing">
<h1 id="show1">2</h1>
<br>
<input id="enter1" value="1+1" placeholder="Enter Number">
<button id="sendBtn1">Calculate</button>
</div>
<textarea id="find">
let btn = @find("Calculate");
let input = @("#enter1");
let show = @("#show1");
btn.on("click", function(){
if(input.val().trim() == ""){
box "Input is Empty";
return true;
}
show.text(eval(input.val()));
});
</textarea>
<center><button type="button" id="run17" class="btn btn-dark run">Run</button></center>
<script>
let find = document.getElementById("find");
var editor17 = CodeMirror.fromTextArea(find, {
lineNumbers: true,
matchBrackets: true,
mode: 'javascript',
});
</script>
<script type="text/lilscript">
let run = @("#run17");
run.on("click",function(){
try{
eval(ls.run(editor17.getValue()));
}catch(e){
box e;
}
})
</script>
<br>
<br>
<footer>
<center>
<h5>Dev Bash - 2021</h5>
<br>
<p>Made with ❤️ from 🇳🇬 by Dev Bash</p>
</center>
</footer>
</body>
</html>