-
Notifications
You must be signed in to change notification settings - Fork 3
/
editor.html
851 lines (724 loc) · 20.5 KB
/
editor.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
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
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="description" content="Spark Code is a web based IDE for editing and running HTML, CSS, and JavaScript code.">
<meta name="keywords" content="HTML, CSS, JavaScript, IDE, JavaScript Editor, HTML Editor, CSS Editor, Web IDE, Code Editor, test HTML code, test CSS code, test JavaScript Code, test code, online code editor, online code IDE">
<meta name="author" content="Hammerhead Studios">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spark Code - Editor</title>
<link rel="icon" href="Icons/favicon.ico" />
<! Import Code Mirror Libraries>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/theme/monokai.min.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.52.2/codemirror.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://codemirror.net/lib/codemirror.css">
<script type="text/javascript" src="https://codemirror.net/lib/codemirror.js"></script>
<script type="text/javascript" src="https://codemirror.net/mode/xml/xml.js"></script>
<script type="text/javascript" src="https://codemirror.net/mode/css/css.js"></script>
<script type="text/javascript" src="https://codemirror.net/mode/javascript/javascript.js"></script>
</head>
<header id="header">
<div class="dropdown">
<button class="topButton" id="fileButton">
File
</button>
<div class="dropdown-content">
<div class="subDropdown-content">
<button id="SaveButton" onclick="saveProject()">
Save
</button>
<button id="saveHTMLButton" onclick="file(getProjectName(), '.html', (compile()))">
Save as .html
</button>
<button id="saveTxtButton" onclick="file(getProjectName(), '.txt', (<compile> </compile>()))">
Save as .txt
</button>
<button id="printButton" onclick="document.getElementById('OutputArea').contentWindow.print()">
Print
</button>
<button id="ImportButton" onclick="document.getElementById('importFile').click();">
Import
<input type="file" id="importFile" style="display:none;" accept=".js, .html, .css, .txt" />
</button>
</div>
</div>
</div>
<button class="topButton" id="SettingsButton" onclick="openSettings()">
Settings
</button>
<div class="dropdown">
<button class="topButton" id="windowButton">
Window
</button>
<div class="dropdown-content">
<div class="subDropdown-content">
<button id="newWindowButton" onclick="openWindow()">
Open in New Tab
</button>
<div class="subDropdown-content">
<button id="fullScreenButton" onclick="openFullscreen()">
Fullscreen
</button>
</div>
</div>
</div>
</div>
<button class="topButton" id="commandButton" onclick="toggleCommand()">
Command
</button>
<input type="text" id="commandLine" placeholder="<_" onkeydown="runCommand(event)">
<button class="topButton" id="runButton" onclick="run()">
▷ Run
</button>
<button class="topButton" id="stopButton" onclick="stop()" style="display: none;">
☐ Stop
</button>
<img src="Icons/SparkCodeLogo.svg" id="Logo" alt="Spark Code" onclick="
saveProject();
location.href = 'https://spark.js.org';
">
</header>
<div class="tab">
<button class="tablinks" onclick="openTab(event, 'HTMLarea')" id="HTMLTabButton">HTML</button>
<button class="tablinks" onclick="openTab(event, 'CSSarea')">CSS</button>
<button class="tablinks" onclick="openTab(event, 'JSarea')">JavaScript</button>
<button class="tablinks" onclick="openTab(event, 'outputAreaBox')">Output</button>
</div>
<body id="body">
<div id="HTMLarea" class="editorArea">
<textarea id="HTMLScriptContainer" placeholder="HTML" spellcheck="false"></textarea>
<button id="HTMLeditorDownloadButton" class="editorIcon" onclick="file(getProjectName(), '.html', HTMLScriptContainer.getValue())">
🡳
</button>
</div>
<div id="CSSarea" class="editorArea">
<textarea id="CSSScriptContainer" placeholder="CSS" spellcheck="false"></textarea>
<button id="CSSeditorDownloadButton" class="editorIcon" onclick="file(getProjectName(), '.css', CSSScriptContainer.getValue())">
🡳
</button>
</div>
<div id="JSarea" class="editorArea">
<textarea id="javaScriptContainer" placeholder="JavaScript" spellcheck="false"></textarea>
<button id="JSeditorDownloadButton" class="editorIcon" onclick="file(getProjectName(), '.js', javaScriptContainer.getValue())">
🡳
</button>
</div>
<div id="outputAreaBox" class="editorArea">
<img src="Icons/326650_fullscreen_icon.png" onclick="openFullscreen()" class="editorIcon">
<iframe id="OutputArea" sandbox="allow-scripts allow-forms allow-popups allow-modals allow-downloads allow-same-origin" scrolling="auto">Your browser does not Support Iframe.</iframe>
</div>
<div id="mySidenav" class="sidenav">
<a href="javascript:void(0)" class="closebtn" onclick="closeSettings()">×</a>
<p class="SettingsTitles">
Name
</p>
<input type="text" id="projectNameInput" class="projectInput" placeholder="Untitled Project" rows="1" maxlength="20" wrap="off">
<p class="SettingsTitles">
Description
</p>
<textarea id="projectDescriptionInput" class="projectInput" placeholder="Description" rows="3" maxlength="100"></textarea>
<p class="SettingsTitles">
General
</p>
<label class="switch">
<input id="autoSaveSwitch" type="checkbox">
<span class="slider round"></span>
</label>
<p class="switchLabel">
Auto Save
</p>
<!-- Buttons to choose list or grid view -->
<p class="SettingsTitles">
Layout
</p>
<div id="layoutSelector">
<button onclick="listView()" class="settingsButton">List
</button>
<button onclick="gridView()" class="settingsButton">Grid</button>
<button onclick="tabView()" class="settingsButton">Tabs</button>
</div>
</div>
<div class="row">
</div>
<div class="column" style="background-color:#aaa;">
</div>
</body>
<script> //Set up Codemirror Editors
var javaScriptContainer = CodeMirror.fromTextArea(document.getElementById("javaScriptContainer"), {
styleActiveLine: true,
lineNumbers: true,
matchBrackets: true,
value: localStorage.getItem("JScode"),
mode: 'javascript',
theme: "monokai",
lineWrapping: true,
indentWithTabs: true,
autoCloseBrackets: true
});
var HTMLScriptContainer = CodeMirror.fromTextArea(document.getElementById("HTMLScriptContainer"), {
styleActiveLine: true,
lineNumbers: true,
matchBrackets: true,
mode: 'text/html',
theme: 'monokai',
lineWrapping: true,
indentWithTabs: true
});
var CSSScriptContainer = CodeMirror.fromTextArea(document.getElementById("CSSScriptContainer"), {
styleActiveLine: true,
lineNumbers: true,
matchBrackets: true,
mode: 'css',
theme: 'monokai',
lineWrapping: true,
indentWithTabs: true
});
HTMLScriptContainer.setSize("100%", "100%")
javaScriptContainer.setSize("100%", "100%")
CSSScriptContainer.setSize("100%", "100%")
if (!HTMLScriptContainer || !javaScriptContainer || !CSSScriptContainer) {
alert("Failed to load Codemirror Libraries. If this problem persists please contact support.")
console.error("Failed to load code mirror editors.")
}
const urlParams = new URLSearchParams(window.location.search);
var projectId = urlParams.get('id');
var outputArea = document.getElementById("OutputArea");
var saveHTMLButton = document.getElementById("saveHTMLButton")
var saveTxtButton = document.getElementById("saveTxtButton")
var projectNameInputArea = document.getElementById("projectNameInput")
var projectDescriptionArea = document.getElementById("projectDescriptionInput")
var autoSaveSwitch = document.getElementById("autoSaveSwitch")
var settingsArea = document.getElementById("mySidenav")
var header = document.getElementById("header")
var elements = document.getElementsByClassName("editorArea");
var tabs = document.getElementsByClassName("tab")
var HTMLArea = document.getElementById("HTMLarea")
var importFileInput = document.getElementById("importFile")
var runButton = document.getElementById("runButton")
var stopButton = document.getElementById("stopButton")
var commandLine = document.getElementById("commandLine")
var commandOpen = false;
window.onload = loadData()
window.onerror = function(message, source, lineno, colno, error) {
alert(message);
};
tabView()
document.getElementById("importFile").addEventListener("change", function() {
var file = this.files[0];
var type = importFileInput.value.split('.')[1];
console.log("File type = " + type);
if (file) {
var reader = new FileReader();
reader.onload = function(evt) {
console.log(evt);
var scriptContainer = HTMLScriptContainer
if (type == "html" || type == "txt") {
scriptContainer = HTMLScriptContainer
} else if (type == "js") {
scriptContainer = javaScriptContainer
} else if (type == "css") {
scriptContainer = CSSScriptContainer
}
scriptContainer.getDoc().setValue(evt.target.result);
alert("Succesfully imported the " + type + " file.")
};
reader.onerror = function(evt) {
console.error("An error ocurred reading the file", evt);
alert("An error occured reading the File")
};
reader.readAsText(file, "UTF-8");
}
}, false);
function loadData() {
javaScriptContainer.getDoc().setValue(localStorage.getItem(projectId + "-JScode"));
CSSScriptContainer.getDoc().setValue(localStorage.getItem(projectId + "-CSScode"));
HTMLScriptContainer.getDoc().setValue(localStorage.getItem(projectId + "-HTMLcode"));
projectNameInputArea.value = localStorage.getItem(projectId + "-name")
projectDescriptionArea.value = localStorage.getItem(projectId + "-description")
}
function saveProject() {
if (typeof(Storage) !== "undefined") {
localStorage.setItem(projectId + "-JScode", javaScriptContainer.getValue());
localStorage.setItem(projectId + "-CSScode", CSSScriptContainer.getValue());
localStorage.setItem(projectId + "-HTMLcode", HTMLScriptContainer.getValue());
if(projectNameInputArea.value == "" || projectNameInputArea.value == null || projectNameInputArea.value == "null"){
localStorage.setItem(projectId + "-name", "Untitled Project");
} else {
localStorage.setItem(projectId + "-name", projectNameInputArea.value);
}
localStorage.setItem(projectId + "-description", projectDescriptionArea.value);
} else {
alert("Uh oh! It looks like your browser doesn't support saving data.")
}
}
function getProjectName() {
var name = projectNameInputArea.value
if (!name) {
name = "UntitledProject"
}
return (name)
}
function run() {
if (autoSaveSwitch.checked) {
saveProject()
}
outputArea.style.backgroundColor = "white";
outputArea.srcdoc = compile()
runButton.style.display = "none"
stopButton.style.display = "inline"
}
function compile() {
var JScode = "<script> " + javaScriptContainer.getValue() + "<" + "/script>"
var CSScode = "<style>" + CSSScriptContainer.getValue() + "</style>"
var HTMLcode = HTMLScriptContainer.getValue()
return (HTMLcode + JScode + CSScode)
}
//Save file function
function file(name, type, content) {
// create the text file as a Blob:
var blob = new Blob([content], {
type: "text/plain"
});
// download the file:
download(blob, (name + type));
function download(blob, name) {
var url = URL.createObjectURL(blob),
div = document.createElement("div"),
anch = document.createElement("a");
document.body.appendChild(div);
div.appendChild(anch);
anch.innerHTML = " ";
div.style.width = "0";
div.style.height = "0";
anch.href = url;
anch.download = name;
var ev = new MouseEvent("click", {});
anch.dispatchEvent(ev);
document.body.removeChild(div);
}
}
function toggleCommand() {
if(!commandOpen){
commandLine.style.width = "200px"
commandLine.style.marginLeft = "5px"
commandLine.style.paddingLeft = "4px"
commandLine.style.paddingRight = "4px"
commandOpen = true;
} else {
commandLine.style.width = "0px"
commandLine.style.marginLeft = "-11px"
commandLine.style.paddingLeft = "0px"
commandLine.style.paddingRight = "0px"
commandOpen = false;
}
}
function openSettings() {
document.getElementById("mySidenav").style.width = "250px";
}
function closeSettings() {
document.getElementById("mySidenav").style.width = "0";
}
// Declare a loop variable
var i;
// List View
function listView() {
for (i = 0; i < elements.length; i++) {
elements[i].style.width = "100%";
elements[i].style.display = "inline";
elements[i].style.height = "34vh";
}
for (i = 0; i < tabs.length; i++) {
tabs[i].style.display = "none";
}
}
// Grid View
function gridView() {
for (i = 0; i < elements.length; i++) {
elements[i].style.width = "49.5%";
elements[i].style.height = "44vh";
elements[i].style.display = "inline";
}
for (i = 0; i < tabs.length; i++) {
tabs[i].style.display = "none";
}
}
function openWindow() {
var externalWindow = window.open()
externalWindow.document.write(compile());
externalWindow.document.title = getProjectName();
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("toolbox-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
function openFullscreen() {
if (outputArea.requestFullscreen) {
outputArea.requestFullscreen();
} else if (elem.webkitRequestFullscreen) {
/* Safari */
outputArea.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) {
/* IE11 */
outputArea.msRequestFullscreen();
}
}
function tabView() {
for (i = 0; i < elements.length; i++) {
elements[i].style.width = "100%";
elements[i].style.height = "83vh";
}
for (i = 0; i < tabs.length; i++) {
tabs[i].style.display = "inline";
}
}
function openTab(evt, tabArea) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("editorArea");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabArea).style.display = "block";
evt.currentTarget.className += " active";
}
function stop(){
outputArea.srcdoc = ""
outputArea.style.backgroundColor = "#272822"
stopButton.style.display = "none"
runButton.style.display = "inline"
}
function runCommand(event){
if(event.keyCode==13){
outputArea.contentWindow.eval(commandLine.value)
commandLine.value = ""
}
}</script><style>.codeMirrorContainer {
height: 80%;
}
#commandLine {
background-color: #383838;
position: relative;
left: 8px;
border-radius: 4px;
border: none;
font-family: Arial, serif;
margin-right: 10px;
color: white;
padding: 0px;
padding-top: 3px;
padding-bottom: 3px;
width: 0px;
transition: 0.3s;
margin-left: -11px;
}
.tab {
display: none;
}
.tab button {
border: none;
margin-top: 10px;
margin-left: 5px;
background-color: #5C5C5C;
float: left;
cursor: pointer;
padding: 5px 16px;
transition: 0.3s;
font-size: 14px;
width: 100px;
clip-path: polygon(15% 0, 86% 0, 100% 50%, 100% 100%, 0 100%, 0% 50%);
}
.tab button:hover {
background-color: #878787;
}
.tab button.active {
background-color: #ccc;
}
.settingsButton {
background-color: white;
color: black;
border: none;
border-radius: 2px;
transition: 0.2s;
}
.settingsButton:hover {
background-color: #696969;
}
.editorLabel {
display: block;
}
iframe {
border: none;
}
.switchLabel {
position: relative;
top: -1px;
color: white;
font-family: Arial, sans-serif;
display: inline-block;
font-size: 14px;
}
.switch {
margin-left: 10px;
position: relative;
display: inline-block;
width: 30px;
height: 17px;
margin-top: 20px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: 0.4s;
transition: 0.4s;
}
.slider:before {
position: absolute;
content: "";
height: 13px;
width: 13px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: 0.4s;
transition: 0.4s;
}
input:checked+.slider {
background-color: #2196F3;
}
input:focus+.slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked+.slider:before {
-webkit-transform: translateX(13px);
-ms-transform: translateX(13px);
transform: translateX(13px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
.editorIcon {
position: absolute;
background-color: transparent;
border: none;
font-size: 18px;
z-index: 100;
top: 2px;
right: 12px;
opacity: 0;
height: 15px;
width: 15px;
transition: 0.3s;
color: white;
}
.editorIcon:hover {
color: white;
cursor: pointer;
height: 17px;
width: 17px;
}
header {
background-color: #121212;
position: -webkit-sticky;
/* Safari */
position: sticky;
color: white;
font-weight: bold;
font-family: Arial, sans-serif;
opacity: 100;
z-index: 10;
height: 45px;
top: 0;
padding: 0px;
}
#Logo {
display: inline;
position: relative;
float: right;
height: 100%;
cursor: pointer;
}
.SettingsTitles {
padding: 8px 8px 8px 8px;
text-decoration: none;
font-size: 15px;
color: #f1f1f1;
display: block;
transition: 0.3s;
height: 10px;
font-family: Arial, sans-serif;
}
#layoutSelector {
position: relative;
display: block;
left: 8px;
padding: 4px;
}
.projectInput {
padding: 8px;
resize: none;
display: block;
background-color: #383838;
position: relative;
left: 8px;
border-radius: 4px;
border: none;
width: 85%;
font-family: Arial, serif;
color: white;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
z-index: 100;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
transition: 0.5s;
padding-top: 40px;
}
.sidenav a {
padding: 8px 8px 8px 32px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
transition: 0.3s;
}
.sidenav a:hover {
color: #f1f1f1;
}
.sidenav .closebtn {
position: absolute;
top: 0;
right: 25px;
font-size: 36px;
margin-left: 50px;
}
.topButton {
font-family: Arial, serif;
font-size: 13px;
height: 100%;
cursor: pointer;
transition: 0.3s;
outline: none;
border: none;
color: white;
background-color: transparent;
border-radius: 1px;
display: inline;
position: relative;
top: -1px;
}
.topButton:hover {
background-color: #696969;
}
.topButton:active {
background-color: #525252;
}
.editorArea {
resize: none;
float: left;
width: 49.5%;
position: relative;
height: 44vh;
padding: 0.5px;
background-color: #1c1a1a;
z-index: -100;
}
.editorIcon:active {
transform: scale(0.9, 0.9);
}
.editorArea:hover .editorIcon {
opacity: 100;
}
body {
background-color: transparent;
margin: 0;
}
#javaScriptContainer,
#HTMLScriptContainer,
#CSSScriptContainer,
#OutputArea {
position: relative;
width: 100%;
height: 100%;
padding: none;
background-color: #272822;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
height: 100%;
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
z-index: 20;
}
/* Links inside the dropdown */
.dropdown-content button {
min-width: 160px;
border: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
cursor: pointer;
transition: 0.3s;
z-index: 100;
}
/* Change color of dropdown links on hover */
.dropdown-content button:hover {
background-color: #ddd;
}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
background-color: #696969;
}
.icon {
height: 25px;
width: 25px;
}
html {
height: 100%;
width: 100%;
background: #212121;
}</style>