-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcode.html
311 lines (308 loc) · 17.8 KB
/
code.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>codebook.dev - Code</title>
<link href='https://fonts.googleapis.com/css?family=JetBrains Mono' rel='stylesheet'>
<script src="https://kit.fontawesome.com/f7c8be4779.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="src/css/main.css">
<link rel="stylesheet" href="src/css/settings.css">
<link rel="stylesheet" href="src/css/styles.css">
<link rel="icon" href="images/icons/codebook-logo.ico">
<script src = "https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js" integrity="sha512-csNcFYJniKjJxRWRV1R7fvnXrycHP6qDR21mgz1ZP55xY5d+aHLfo9/FcGDQLfn2IfngbAHd8LdfsagcCqgTcQ==" crossorigin = "anonymous" referrerpolicy = "no-referrer"> </script>
<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
</head>
<body class="code.html">
<div id="webpage" class="main">
<div id="scanner" class="browser-check">
<div id="scanner-container" class="check-container">
<div class="check-container-content">
<div class="loader">
<svg id="checkmark" style="display: none;" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 64 64" enable-background="new 0 0 64 64">
<path
d="M32,2C15.431,2,2,15.432,2,32c0,16.568,13.432,30,30,30c16.568,0,30-13.432,30-30C62,15.432,48.568,2,32,2z M25.025,50 l-0.02-0.02L24.988,50L11,35.6l7.029-7.164l6.977,7.184l21-21.619L53,21.199L25.025,50z"
fill="#43a047" />
</svg>
<svg id="loader" class="circular-loader" viewBox="25 25 50 50">
<circle class="loader-path" cx="50" cy="50" r="20"></circle>
</svg>
</div>
<p id="scanner-text"></p>
</div>
</div>
</div>
<div id="settings" class="settings-menu">
<div class="settings-card">
<div class="card-content">
<h3>Quick Actions</h3>
<div class="quick-action-row">
<div class="action-tooltip">
<a><i class="action fa-solid fa-circle-user"></i></a>
<span id="action-tooltip" class="action-tooltiptext">Profile</span>
</div>
<div class="action-tooltip">
<a><i id="save" class="action fa-solid fa-save"></i></a>
<span id="action-tooltip" class="action-tooltiptext">Save</span>
</div>
<div class="action-tooltip">
<a><i id="copy" class="action fa-solid fa-copy"></i></a>
<span id="action-tooltip" class="action-tooltiptext">Copy</span>
</div>
<div class="action-tooltip">
<a><i id="reset-compiler" class="action fa-solid fa-trash"></i></a>
<span id="action-tooltip" class="action-tooltiptext">Reset Compiler</span>
</div>
<div class="action-tooltip">
<form>
<input id="import-code" type="file" hidden>
<label for="import-code"><i class="action fa-solid fa-upload"></i></label>
</form>
<span id="action-tooltip" class="action-tooltiptext">Import Code</span>
</div>
<div class="action-tooltip">
<a><i id="editor-mode" class="action fa-solid fa-i-cursor"></i></a>
<span id="vim-mode" class="action-tooltiptext">Enable VIM</span>
</div>
</div>
<div class="settings-col">
<div class="settings-row">
<h5>Font Size</h5>
<div class="font-size">
<a id="font-size-down"><i class="fa-solid fa-minus"></i></a>
<p id="font-size">12</p>
<a id="font-size-up"><i class="fa-solid fa-plus"></i></a>
</div>
</div>
<div class="settings-row input-text-setting">
<h5>Allow Input</h5>
<div id="user-input-toggle" class="input-toggle">
<input type="checkbox" id="input-toggle" />
<label for="input-toggle"></label>
</div>
</div>
<div class="rename-col">
<h5>Current Tab Name</h5>
<div class="rename-text-area-row">
<input id="tab-rename" type="text" placeholder="codebook">
<button id="rename-button"><i class="fa-solid fa-file-pen"></i></button>
</div>
</div>
</div>
</div>
<p class="bottom-esc">press <span class="accent">escape</span> at any time to exit this menu</p>
</div>
</div>
<div id="language" class="language-selection">
<div class="selection-card">
<h3>Language Selection</h3>
<h5 style="margin-top: 15px;">Selected Language: <span id="selected-lang"
class="accent">JavaScript</span></h5>
<h5>Supported Languages:
<input id="myInput" type="text" class="language-search-bar" placeholder="Filter Languages">
<div class="language-list">
<ul id="lang-search">
<li><a href="#" id="assembly">Assembly</a></li>
<li><a href="#" id="clojure">Clojure</a></li>
<li><a href="#" id="cpp">C++</a></li>
<li><a href="#" id="css">CSS</a></li>
<li><a href="#" id="elixir">Elixir</a></li>
<li><a href="#" id="go">Go</a></li>
<li><a href="#" id="haskell">Haskell</a></li>
<li><a href="#" id="html">HTML</a></li>
<li><a href="#" id="java">Java</a></li>
<li><a href="#" id="javascript">JavaScript</a></li>
<li><a href="#" id="kotlin">Kotlin</a></li>
<li><a href="#" id="lisp">Lisp</a></li>
<li><a href="#" id="objective-c">Objective-C</a></li>
<li><a href="#" id="perl">Perl</a></li>
<li><a href="#" id="php">PHP</a></li>
<li><a href="#" id="python">Python</a></li>
<li><a href="#" id="ruby">Ruby</a></li>
<li><a href="#" id="rust">Rust</a></li>
<li><a href="#" id="swift">Swift</a></li>
<li><a href="#" id="typescript">TypeScript</a></li>
</ul>
</div>
</h5>
<p class="bottom-esc">press <span class="accent">escape</span> at any time to exit this menu</p>
</div>
</div>
<div id="theme" class="theme-selection">
<div class="theme-card">
<h3>Theme Selection</h3>
<div id="theme-toggle" class="toggle">
<input type="checkbox" id="toggle" />
<label for="toggle"></label>
</div>
<h5 style="margin-top: 15px;">Selected Theme: <span id="selected-theme" class="accent">Dracula</span>
</h5>
<h5>Available Themes:</h5>
<div class="theme-list">
<ul id="theme-search">
</ul>
</div>
<p class="bottom-esc">press <span class="accent">escape</span> at any time to exit this menu</p>
</div>
</div>
<div class="landing-page">
<div id="landing-bar" class="landing-toolbar">
<a><i class="fa-solid fa-bars-staggered"></i></a>
<div id="nav-settings" class="tooltip">
<a id="settings-btn"><i class="fa-solid fa-gear"></i></a>
<span id="settings-tooltip" class="tooltiptext">Settings</span>
</div>
<div id="nav-language" class="tooltip">
<a id="lang-btn"><i class="fa-solid fa-file-code"></i></a>
<span id="language-tooltip" class="tooltiptext">Language</span>
</div>
<div id="nav-theme" class="tooltip">
<a id="theme-btn"><i class="fa-solid fa-brush"></i></a>
<span id="theme-tooltip" class="tooltiptext">Themes</span>
</div>
<div style="margin-top: auto;" class="tooltip">
<a id="lang-doc" target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"><img
src="images/icons/javascript.svg" class="svg" id="lang-icon"></i></a>
<span class="tooltiptext">Open Docs</span>
</div>
<div class=" tooltip">
<a href="https://www.codebook.dev/docs/index.html" target="_blank"><i
class="fa-solid fa-circle-info"></i></a>
<span class="tooltiptext">v1.2 pre-release</span>
</div>
</div>
<div class="code">
<div class="landing-nav">
<a style="font-size: 18px;" href="index.html" class="color">codebook.dev</a>
<div id="code-compile-status">
<div class="lds-dual-ring" id="compile-loader"></div>
<i class="fa-solid fa-check-circle" id="compile-success" style="color: rgb(54, 195, 54);"></i>
<i class="fa-solid fa-times-circle" id="compile-error" style="color: rgb(195, 54, 54);"></i>
<p id="compile-status-text">Compiling Code</p>
</div>
<a id="run-btn" class="run-btn"><i class="fa-solid fa-play"></i> Run</a>
</div>
<div class="landing-page-container">
<div class="editor-and-tab-container">
<div class="tab-bar-container">
<div id="tab-list" class="tabs">
</div>
<button id="new-tab">
<i class="fa-solid fa-plus"></i>
</button>
</div>
<div class="editor-container">
<div id="close-tab-warning" class="overlay-code">
<div class="inner-text">
<i class="color fa-solid fa-trash"></i>
<h3>Are you sure?</h3>
<p>This tab has code stored in it.
This is a destructive action and will destroy all code in this tab.
If you would like to save your code, please copy it to a new tab or save it via
the settings menu and then
proceed to close the tab.
</p>
<div class="btn-row">
<button class="btn-confirm" id="close-tab-confirm">Close Tab</button>
<button class="btn-cancel" id="close-tab-cancel">Cancel</button>
</div>
</div>
</div>
<div id="editor">
</div>
</div>
</div>
<div class="landing-info-terminal-container">
<div id="info" class="landing-info">
<div id="stdin-help" class="overlay-landing-info">
<i class="fa-solid fa-times" id="close-info"></i>
<h4>STDIN on <span class="color">codebook.dev</span></h4>
<hr>
<p>
Since you as a user does not have full access to the terminal,
you'll need to specify your inputs before you execute your code. When
you enable <span class="color">STDIN</span> in the settings menu, you'll be able to
specify your inputs in the <span class="accent">Standard IN / User Input</span> box.
<br><br>
<span class="badge badge-danger">Warning</span><br> If you attempt to ask for input in your code, and specify an input string, you will
receive an error. This is because the code is executed in a sandboxed environment, and
does not have access to the terminal.
</p>
</div>
<div id="landing-info-cont" class="landing-info-container">
<h1 id="hey-there-code" class=""><i class="fa-solid fa-hands-clapping"></i></i></h1>
<h2 class="accent">Code Stats</h2>
<h5>Execution Time: <span style="color:rgb(88, 206, 88);"><span id="compile-usage">0.00</span> seconds</span>
<div id="compile-bar-box">
<div id="compile-bar"></div>
</div></h5>
<h5>RAM Usage: <span style="color:rgb(88, 206, 88);"><span id="ram-usage">0.00</span> bytes</span>
<div id="ram-bar-box">
<div id="ram-bar"></div>
</div></h5>
<p id="code-stats" style="color:rgb(236, 236, 236);">You have not compiled any code yet, but
you can do so
by
clicking the
<span class="accent">Run</span> button in the top-right corner.
</p>
<div class="stdin-header-row">
<h2 class="accent">Standard IN / User Input</h2>
<i id="stdin-info-btn" class="fa-solid fa-question-circle accent"></i>
</div>
<textarea id="stdin" placeholder="55"></textarea>
<p id="stdin-disabled" style="color:rgb(236, 236, 236);">
You don't have uesr-input (stdin) enabled, but you can
enable it in the Settings pane.
</p>
</div>
</div>
<div id="terminal-hide" class="no-term">
<i class="color fa-solid fa-exclamation-triangle"></i>
<h3>Code Compilation Disabled</h3>
<h5>
The terminal has been disabled for <span id="disabled-lang" class="accent">HTML</span>
since
it
is not supported by our compiler. You can still edit your code, although code-execution
features
have been disabled.
</h5>
</div>
<div id="terminal">▶ user.io@shell: ~$</div>
</div>
</div>
</div>
<div id="lang-change" class="success-alert">
<p id="lang-change-text"><i class="fa-solid fa-retweet"></i> Language changed to JavaScript</p>
</div>
</div>
</div>
</body>
<script src="/editor/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="/editor/ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
<script type="module" src="src/js/main.js"></script>
<script>
var editor = ace.edit("editor");
editor.setOptions({
enableBasicAutocompletion: true,
enableLiveAutocompletion: true,
enableSnippets: true,
hScrollBarAlwaysVisible: false,
wrap: true
})
var terminal = ace.edit("terminal");
terminal.renderer.setShowGutter(false);
terminal.renderer.setHighlightGutterLine(false);
terminal.$mouseHandler.$focusWaitTimout = 0;
terminal.setTheme("ace/theme/terminal");
terminal.setOptions({
wrap: true
})
terminal.setReadOnly(true);
</script>
</html>