-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
126 lines (107 loc) · 3.49 KB
/
index.html
File metadata and controls
126 lines (107 loc) · 3.49 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Universal Code Highlighter</title>
<!-- CodeMirror Core -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script>
<!-- Theme -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/dracula.min.css"
/>
<!-- Modes -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/htmlmixed/htmlmixed.min.js"></script>
<!-- CodeMirror core -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script>
<!-- Theme -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/theme/dracula.min.css">
<!-- Language mode -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js"></script>
<!-- Hint (Autocomplete) Add-ons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/hint/show-hint.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/hint/show-hint.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/addon/hint/javascript-hint.min.js"></script>
<!-- Styling -->
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', sans-serif;
background-color: #121212;
color: #fff;
height: 100vh;
display: flex;
flex-direction: column;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
background: #1e1e1e;
border-bottom: 1px solid #333;
}
select, button {
padding: 6px 12px;
background: #333;
color: white;
border: 1px solid #555;
border-radius: 4px;
cursor: pointer;
}
.CodeMirror {
height: 100%;
font-size: 14px;
border-bottom: 2px solid #333;
}
#output {
display: flex;
flex-direction: column;
height: 200px;
max-height: 60vh;
resize: none;
overflow: auto;
background: #1e1e1e;
color: white;
border-top: 2px solid #333;
}
#resizer {
height: 6px;
cursor: ns-resize;
background: #444;
}
#outputContent {
padding: 10px;
white-space: pre-wrap;
font-family: monospace;
overflow-y: auto;
flex: 1;
}
</style>
</head>
<body>
<div class="header">
<select id="languageSelect">
<option value="javascript">JavaScript</option>
<option value="htmlmixed">HTML/CSS/JS</option>
</select>
<button id="runButton">Run</button>
</div>
<textarea id="editor">// Write your JavaScript code here</textarea>
<div id="output">
<div id="resizer"></div>
<div id="outputContent">Output will appear here...</div>
</div>
<script src="script.js"></script>
</body>
</html>