-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
619 lines (619 loc) · 18 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="application-name" content="RIS Gates">
<meta name="author" content="esdmr">
<meta name="color-scheme" content="light dark">
<meta name="description"
content="Logic gate grid simulator puzzle thingy">
<meta name="theme-color" media="(prefers-color-scheme: dark)"
content="#282828">
<meta name="theme-color" media="(prefers-color-scheme: light)"
content="#e8e8e8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RIS Gates</title>
<link rel="stylesheet" href="index.css">
<script type="module" src="./src/component/index.ts"></script>
</head>
<body>
<canvas id="canvas"></canvas>
<div id="hud" class="hud" aria-label="Heads-on Display">
<div class="show-if-normal show-if-eval" role="presentation">
<button id="hud-eval" aria-label="evaluate" role="checkbox"
aria-checked="false">
<svg viewBox="0 0 1 1" class="enabled-if-eval">
<title>Evaluate</title>
<use href="icons.svg#eval" />
</svg>
</button>
</div>
<div class="show-if-eval" role="presentation">
<button id="hud-tick-bwd-stable" class="requires-undo"
aria-label="Previous stable tick">
<svg viewBox="0 0 1 1">
<title>Previous stable tick</title>
<use href="icons.svg#tick-bwd-stable" />
</svg>
</button>
<button id="hud-tick-bwd" class="requires-undo"
aria-label="Previous tick">
<svg viewBox="0 0 1 1">
<title>Previous tick</title>
<use href="icons.svg#tick-bwd" />
</svg>
</button>
<div id="hud-tick-no" class="hud-message">0</div>
<button id="hud-tick-fwd" aria-label="Next tick">
<svg viewBox="0 0 1 1">
<title>Next tick</title>
<use href="icons.svg#tick" />
</svg>
</button>
<button id="hud-tick-fwd-stable" aria-label="Next stable tick">
<svg viewBox="0 0 1 1">
<title>Next stable tick</title>
<use href="icons.svg#tick-stable" />
</svg>
</button>
<button id="hud-automate" aria-label="Automate">
<svg viewBox="0 0 1 1">
<title>Automate</title>
<use href="icons.svg#automation" />
</svg>
</button>
</div>
<div class="show-if-automated" role="presentation">
<button id="hud-return" aria-label="Return">
<svg viewBox="0 0 1 1">
<title>Return</title>
<use href="icons.svg#cross" />
</svg>
</button>
<button id="hud-monitor" aria-label="Monitor">
<svg viewBox="0 0 1 1">
<title>Monitor</title>
<use href="icons.svg#monitor" />
</svg>
</button>
<button id="hud-assert" aria-label="Assertions">
<svg viewBox="0 0 1 1">
<title>Assertions</title>
<use href="icons.svg#assert" />
</svg>
</button>
<div id="hud-tick-no2" class="hud-message">0</div>
<button id="hud-next" aria-label="Next">
<svg viewBox="0 0 1 1">
<title>Next</title>
<use href="icons.svg#tick" />
</svg>
</button>
</div>
<div class="show-if-normal" role="presentation">
<div class="hud-group" role="radiogroup">
<button id="hud-empty" aria-label="Empty" role="radio"
aria-checked="false">
<svg viewBox="0 0 1 1">
<title>Empty</title>
<use href="icons.svg#cross" />
</svg>
</button>
<button id="hud-io" aria-label="IO" role="radio"
aria-checked="false">
<svg viewBox="0 0 1 1">
<title>IO</title>
<use href="icons.svg#tile"
color="var(--active-io)" />
</svg>
</button>
<button id="hud-negate" aria-label="Negate" role="radio"
aria-checked="false">
<svg viewBox="0 0 1 1">
<title>Negate</title>
<use href="icons.svg#tile"
color="var(--active-negate)" />
</svg>
</button>
<button id="hud-conjoin" aria-label="Conjoin" role="radio"
aria-checked="false">
<svg viewBox="0 0 1 1">
<title>Conjoin</title>
<use href="icons.svg#tile"
color="var(--active-conjoin)" />
</svg>
</button>
<button id="hud-disjoin" aria-label="Disjoin" role="radio"
aria-checked="false">
<svg viewBox="0 0 1 1">
<title>Disjoin</title>
<use href="icons.svg#tile"
color="var(--active-disjoin)" />
</svg>
</button>
</div>
<button id="hud-dir" aria-label="Direction: up">
<svg viewBox="0 0 1 1">
<title>Direction: up</title>
<path d="M0 1 .5 0 1 1Z"
style="transform-origin: center"
fill="var(--foreground)" />
</svg>
</button>
</div>
<div class="show-if-selected" role="presentation">
<button id="hud-unselect" aria-label="Unselect">
<svg viewBox="0 0 1 1">
<title>Unselect</title>
<use href="icons.svg#cross" />
</svg>
</button>
<button id="hud-delete" aria-label="Delete">
<svg viewBox="0 0 1 1">
<title>Delete</title>
<use href="icons.svg#delete" />
</svg>
</button>
<button id="hud-cut" aria-label="Cut">
<svg viewBox="0 0 1 1">
<title>Cut</title>
<use href="icons.svg#cut" />
</svg>
</button>
<button id="hud-copy" aria-label="Copy">
<svg viewBox="0 0 1 1">
<title>Copy</title>
<use href="icons.svg#copy" />
</svg>
</button>
</div>
<div class="hud-paste" role="presentation">
<button id="hud-paste" aria-label="Paste">
<svg viewBox="0 0 1 1">
<title>Paste</title>
<use href="icons.svg#paste" />
</svg>
</button>
</div>
<div class="show-if-normal" role="presentation">
<button id="hud-menu" aria-label="Menu">
<svg viewBox="0 0 1 1">
<title>Menu</title>
<use href="icons.svg#menu" />
</svg>
</button>
</div>
<div class="show-if-selected" role="presentation">
<button id="hud-menu-selection" aria-label="Menu">
<svg viewBox="0 0 1 1">
<title>Menu</title>
<use href="icons.svg#menu" />
</svg>
</button>
</div>
<div class="show-if-pasting" role="presentation">
<button id="hud-paste-cancel" aria-label="Cancel pasting">
<svg viewBox="0 0 1 1">
<title>Cancel pasting</title>
<use href="icons.svg#cross" />
</svg>
</button>
<div class="hud-message">
Click top left corner to paste.
</div>
<div class="hud-group">
<button id="hud-rot" aria-label="Rotation: 0 degrees">
<svg viewBox="0 0 1 1">
<title>Rotation: 0 degrees</title>
<use href="icons.svg#rot0" />
</svg>
</button>
<button id="hud-hrefl" aria-label="Horizontal reflection"
role="checkbox" aria-checked="false">
<svg viewBox="0 0 1 1">
<title>Horizontal reflection</title>
<use href="icons.svg#hrefl" />
</svg>
</button>
<button id="hud-vrefl" aria-label="Vertical reflection"
role="checkbox" aria-checked="false">
<svg viewBox="0 0 1 1">
<title>Vertical reflection</title>
<use href="icons.svg#vrefl" />
</svg>
</button>
</div>
</div>
<div class="show-if-picking" role="presentation">
<button id="hud-pick-cancel" aria-label="Cancel picking">
<svg viewBox="0 0 1 1">
<title>Cancel picking</title>
<use href="icons.svg#cross" />
</svg>
</button>
<div class="hud-message">
Click an IO tile.
</div>
</div>
</div>
<dialog id="dialog-menu">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Menu</h1>
<div class="body" role="presentation">
<fieldset>
<legend>Appearance</legend>
<label>
<input id="chk-minor-grid" type="checkbox">
Show minor grid
</label>
<label>
Major grid length:
<input id="inp-major-grid" type="number" placeholder="0"
min="0" step="1">
</label>
</fieldset>
<fieldset>
<legend>Behavior</legend>
<label>
Rate of evaluation (in Hz):
<input id="inp-eval-rate" type="number" placeholder="15"
min="1" max="30" step="1">
</label>
<label>
Maximum evaluation undo history:
<input id="inp-eval-undo" type="number"
placeholder="128" min="0" step="1">
</label>
<label>
<input id="chk-eval-wasm" type="checkbox">
Use WebAssembly-based evaluation if available
</label>
</fieldset>
</div>
<div class="footer vertical" role="presentation">
<button id="btn-clear">Clear</button>
<button id="btn-load"
class="requires-local-storage">Load</button>
<button id="btn-save"
class="requires-local-storage">Save</button>
<button id="btn-browse"
class="requires-local-storage">Browse</button>
<button id="btn-load-schm" class="requires-local-storage">Load
clipboard</button>
<button id="btn-save-schm" class="requires-local-storage">Save
clipboard</button>
<button id="btn-browse-schm"
class="requires-local-storage">Browse schematics</button>
<button id="btn-screenshot">Screenshot</button>
</div>
</dialog>
<dialog id="dialog-selection">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Selection</h1>
<div class="footer vertical" role="presentation">
<button id="btn-save-schm2" class="requires-local-storage">Save
selection</button>
<button id="btn-screenshot2">Screenshot selection</button>
</div>
</dialog>
<dialog id="dialog-epilepsy">
<h1 class="title">Epilepsy Warning</h1>
<div class="body" role="presentation">
<p>
This part may display flashing lights. If you have
photosensitive epilepsy, you can either go back, or adjust
the rate of evaluation via the input box below.
</p>
<label>
Rate of evaluation (in Hz):
<input id="inp-eval-rate2" type="number" placeholder="15"
min="1" max="30" step="1">
</label>
</div>
<div class="footer" role="presentation">
<form method="dialog">
<button value="cancel">Cancel</button>
<button value="proceed">Proceed</button>
</form>
</div>
</dialog>
<dialog id="dialog-load">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Load</h1>
<div class="body" role="presentation">
<storage-browser></storage-browser>
</div>
<div class="footer" role="presentation">
<button id="btn-paste">Paste</button>
</div>
</dialog>
<dialog id="dialog-load-failed">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Loading failed!</h1>
<div class="body" role="presentation">
<p>
This file is corrupted and cannot be loaded. See the console
for more information.
</p>
</div>
</dialog>
<dialog id="dialog-paste-failed">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Paste</h1>
<div class="body" role="presentation">
<p>
I cannot automatically read your clipboard.<br>
Try pasting in the following text box instead.
</p>
<textarea id="inp-paste" class="full-width"
autocomplete="off"></textarea>
</div>
</dialog>
<dialog id="dialog-save">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Save</h1>
<div class="body" role="presentation">
<form method="dialog" id="form-save">
<p>
<label>Name
<input type="text" name="name" autocomplete="off"
required>
</label>
</p>
</form>
<h2>Other saves</h2>
<storage-browser></storage-browser>
</div>
<div class="footer" role="presentation">
<button id="btn-copy">Copy</button>
<button form="form-save">Save</button>
</div>
</dialog>
<dialog id="dialog-save-failed">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Saving failed!</h1>
<div class="body" role="presentation">
<p>
See the console for more information.
</p>
</div>
</dialog>
<dialog id="dialog-copy-failed">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Copy</h1>
<div class="body" role="presentation">
<p>
I cannot automatically write to your clipboard.<br>
Try copying from the following text box instead.
</p>
<textarea id="inp-copy" class="full-width"
autocomplete="off"></textarea>
</div>
</dialog>
<dialog id="dialog-browse">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Browse</h1>
<div class="body" role="presentation">
<storage-browser></storage-browser>
</div>
<div class="footer" role="presentation">
<button id="btn-delete-all">Delete all</button>
<button id="btn-import">Import</button>
<button id="btn-export">Export</button>
</div>
</dialog>
<dialog id="dialog-screenshot">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Screenshot</h1>
<div class="body" role="presentation">
<form method="dialog" id="form-screenshot">
<fieldset>
<legend>Appearance</legend>
<label>
X offset:
<input type="number" name="x" step="any"
placeholder="0" autocomplete="off">
</label>
<label>
Y offset:
<input type="number" name="y" step="any"
placeholder="0" autocomplete="off">
</label>
<label>
Scale:
<input type="number" name="scale" step="any"
placeholder="0" autocomplete="off">
</label>
<label>
<input type="checkbox" name="dip"
autocomplete="off">
Scale according to pixel density
</label>
<label>
<input type="checkbox" name="dark"
autocomplete="off">
Use dark theme
</label>
</fieldset>
<fieldset>
<legend>Output</legend>
<label>
Width:
<input type="number" name="width" placeholder="0"
autocomplete="off">
</label>
<label>
Height:
<input type="number" name="height" placeholder="0"
autocomplete="off">
</label>
</fieldset>
</form>
</div>
<div class="footer vertical" role="presentation">
<button type="button" name="type" value="png"
form="form-screenshot">Raster
(PNG)</button>
<button type="button" name="type" value="svg"
form="form-screenshot">Vector
(SVG)</button>
</div>
</dialog>
<dialog id="dialog-sequence">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Sequence</h1>
<div class="body" role="presentation">
<textarea id="inp-seq" class="full-width taller"
autocomplete="off" autocorrect="off" autocapitalize="off"
spellcheck="false"></textarea>
</div>
<div class="footer" role="presentation">
<button id="btn-pick">Pick IO</button>
<button id="btn-start">Start</button>
</div>
</dialog>
<dialog id="dialog-sequence-failed">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Error</h1>
<div class="body" role="presentation">
<ul></ul>
</div>
<div class="footer" role="presentation"></div>
</dialog>
<dialog id="dialog-entry">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Sequence entry point</h1>
<div class="body" role="presentation">
<form method="dialog" id="frm-entry"></form>
</div>
<div class="footer" role="presentation"></div>
</dialog>
<dialog id="dialog-monitor">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Monitor</h1>
<div class="body" role="presentation">
<label><input id="chk-high-contrast" type="checkbox"
autocomplete="off"> High
contrast</label>
<label><input id="chk-stable-only" type="checkbox"
autocomplete="off"> Stable ticks
only</label>
<table class="monitor">
<thead>
<tr>
<th>#</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="footer" role="presentation"></div>
</dialog>
<dialog id="dialog-assert">
<button class="close" aria-label="Close">
<svg viewBox="0 0 1 1">
<title>Close</title>
<use href="icons.svg#cross" />
</svg>
</button>
<h1 class="title">Assertions</h1>
<div class="body" role="presentation">
<table class="asserts">
<thead>
<tr>
<th>#</th>
<th>Actual tile</th>
<th>Actual</th>
<th>Expected</th>
<th>Expected tile</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="footer" role="presentation"></div>
</dialog>
<dialog id="dialog-incompatible">
<h1 class="title">Incompatible</h1>
<div class="body" role="presentation">
<p>The current version of RIS Gates (<span
id="current-ver"></span>) is incompatible with the
previous saved data (<span id="previous-ver"></span>).</p>
</div>
<div class="footer" role="presentation">
<button id="btn-export2">Export</button>
<button id="btn-reset">Reset everything</button>
</div>
</dialog>
</body>
</html>