This repository has been archived by the owner on Oct 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
265 lines (263 loc) · 9.02 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Logical</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<!-- What p5.js shows while running preload() -->
<div id="p5_loading" class="center">
<div class="loader"></div>
<!--
<div class="container">
<p>Loading...</p>
</div>
-->
</div>
<main oncontextmenu="return false;">
<!-- Where p5.js will add the canvas -->
</main>
<!-- The menu dialog -->
<dialog id="dialog_menu">
<form method="dialog">
<!--
<span><b>Main menu</b></span>
-->
<!--
<span class="close">×</span>
<br>
-->
<button value="examples" class="mainmenubutton">Examples</button>
<br />
<button value="import" class="mainmenubutton">Import</button>
<br />
<button value="export" class="mainmenubutton">Export</button>
<br />
<button value="cancel" class="mainmenubutton" id="close_menu">
Close
</button>
<br />
<input
type="checkbox"
id="cinematic_mode_checkbox"
name="cinematic_mode"
value="cinematic_mode"
/>
<label for="cinematic_mode_checkbox"> Cinematic mode (no GUI)</label>
<br />
<input
type="checkbox"
id="snap_to_grid_checkbox"
name="snap_to_grid_mode"
value="snap_to_grid_mode"
/>
<label for="snap_to_grid_checkbox"> Snap to grid</label>
<!-- <br />
<input
type="checkbox"
id="instant_prop_box"
name="instant_prop"
value="instant_prop"
/>
<label for="instant_prop_box"
>Instant propagation (Prevents loops and reduce delay of propagation -
see Logical tutorial)</label
> -->
<br />
<div class="centerdivtext">
<a
href="https://github.com/LogicalSimulator/Logical"
target="_blank"
rel="noopener noreferrer"
>⭐ Star ⭐ us on GitHub</a
>
<a> or </a>
<a
href="https://github.com/LogicalSimulator/Logical/issues/new/choose"
target="_blank"
rel="noopener noreferrer"
>report an issue!</a
>
</div>
</form>
</dialog>
<!-- The example dialog -->
<dialog id="dialog_example">
<form method="dialog">
<p>Import an example here!</p>
<p class="error">
Make sure that you have saved your work, as importing an example will
overwrite it!
</p>
<div id="example_div" class="quarterscreendiv"></div>
<button value="cancel" style="margin-top: 5px">Close</button>
</form>
</dialog>
<!-- The import dialog -->
<dialog id="dialog_import">
<form method="dialog">
<label for="code">Import code:</label>
<br />
<textarea
type="text"
id="input_code"
name="code"
autocomplete="off"
autocorrect="off"
spellcheck="false"
class="quarterscreen"
></textarea>
<br />
<p id="message_dialog_import_success_clipboard" hidden>
Successfully read from clipboard!
</p>
<p id="message_dialog_import_failed_clipboard" class="error" hidden>
Failed to read from clipboard! Make sure you have given us permission
to read the clipboard!
</p>
<p id="message_dialog_import_failed_import" class="error" hidden>
Failed to import! Make sure you pasted in the <i>entire</i> code
without any extra characters!
</p>
<button value="import">Import</button>
<button type="button" id="copy_import_button">
Read from clipboard
</button>
<button value="cancel">Cancel</button>
</form>
</dialog>
<!-- The export dialog -->
<dialog id="dialog_export">
<form method="dialog">
<label for="code">Export code:</label>
<a>(Don't forget to scroll to see the rest of the code!)</a>
<br />
<textarea
type="text"
id="output_code"
name="code"
autocomplete="off"
autocorrect="off"
spellcheck="false"
readonly="true"
class="quarterscreen"
></textarea>
<br />
<p id="message_dialog_export_success_clipboard" hidden>
Successfully copied to clipboard!
</p>
<p id="message_dialog_export_failed_clipboard" class="error" hidden>
Failed to copy to clipboard!
</p>
<button type="button" id="copy_export_button">
Copy all to clipboard
</button>
<button value="cancel">Close</button>
</form>
</dialog>
<!-- The clock period dialog -->
<dialog id="dialog_clock_period">
<form method="dialog">
<label for="code">Set clock period:</label>
<br />
<input
type="number"
id="clock_period_code"
name="code"
min="1"
autocomplete="off"
autocorrect="off"
spellcheck="false"
/>
<br />
<button value="submit">Submit</button>
<button value="cancel">Cancel</button>
</form>
</dialog>
<!-- The buffer delay dialog -->
<dialog id="dialog_buffer_delay">
<form method="dialog">
<label for="code">Set buffer delay:</label>
<br />
<input
type="number"
id="buffer_delay_code"
name="code"
min="0"
autocomplete="off"
autocorrect="off"
spellcheck="false"
/>
<br />
<button value="submit">Submit</button>
<button value="cancel">Cancel</button>
</form>
</dialog>
<!-- The note dialog -->
<dialog id="dialog_note">
<form method="dialog">
<label for="code">Your note:</label>
<br />
<textarea
type="text"
id="note_code"
name="code"
autocomplete="on"
autocorrect="on"
spellcheck="true"
class="quarterscreen"
></textarea>
<br />
<button value="submit">Submit</button>
<button value="cancel">Cancel</button>
</form>
</dialog>
<!-- Screw the enter key ->
<script>
window.addEventListener('keydown',function(e){if(e.keyIdentifier=='U+000A'||e.keyIdentifier=='Enter'||e.keyCode==13){if(e.target.nodeName=='INPUT'&&e.target.type=='text'){e.preventDefault();return false;}}},true);
</script>
-->
<!-- Libraries -->
<script src="/js/libs/p5.min.js" defer></script>
<script src="/js/libs/p5.sound.min.js" defer></script>
<script src="/js/libs/p5.collide2d.min.js" defer></script>
<script src="/js/libs/p5.clickable.min.js" defer></script>
<!-- Utilities -->
<script src="/js/util/trig.js" defer></script>
<script src="/js/util/text_utils.js" defer></script>
<script src="/js/util/ui.js" defer></script>
<script src="/js/util/compress.js" defer></script>
<script src="/js/util/clipboard.js" defer></script>
<!-- Game files -->
<script src="/js/game/components/component.js" defer></script>
<script src="/js/game/components/connection.js" defer></script>
<script src="/js/game/components/io/switch.js" defer></script>
<script src="/js/game/components/io/button.js" defer></script>
<script src="/js/game/components/io/clock.js" defer></script>
<script src="/js/game/components/io/constant.js" defer></script>
<script src="/js/game/components/io/light.js" defer></script>
<script src="/js/game/components/io/note.js" defer></script>
<script src="/js/game/components/io/4bit_digit.js" defer></script>
<script src="/js/game/components/io/8bit_digit.js" defer></script>
<script src="/js/game/components/gates/gate.js" defer></script>
<script src="/js/game/components/gates/buffer_gate.js" defer></script>
<script src="/js/game/components/gates/not_gate.js" defer></script>
<script src="/js/game/components/gates/and_gate.js" defer></script>
<script src="/js/game/components/gates/nand_gate.js" defer></script>
<script src="/js/game/components/gates/or_gate.js" defer></script>
<script src="/js/game/components/gates/nor_gate.js" defer></script>
<script src="/js/game/components/gates/xor_gate.js" defer></script>
<script src="/js/game/components/gates/xnor_gate.js" defer></script>
<script src="/js/game/sounds.js" defer></script>
<script src="/js/game/icons.js" defer></script>
<script src="/js/game/export.js" defer></script>
<script src="/js/game/example_saves.js" defer></script>
<script src="/js/game/game.js" defer></script>
<!-- Main script -->
<script src="/js/main.js" defer></script>
<!-- Shows a console on the web page itself, for easier debugging on restricted computers -->
<script src="/js/util/on_page_console.js" defer></script>
</body>
</html>