-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimulator.html
More file actions
168 lines (161 loc) · 7.61 KB
/
Copy pathsimulator.html
File metadata and controls
168 lines (161 loc) · 7.61 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, max-age=0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>Shimmer Simulator</title>
<script>
try {
const theme = localStorage.getItem('shimmer-theme');
if (theme) document.documentElement.dataset.theme = theme;
} catch (e) {}
</script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:wght@700&family=Modak&display=swap" rel="stylesheet">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<!-- Inherit design tokens (colors, fonts, sliders, selects) from main stylesheet -->
<link rel="stylesheet" href="style.css?v=28">
<!-- CodeMirror 5 - MIT licensed, plain script tags, no build step required -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css">
<link rel="stylesheet" href="simulator.css?v=13">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/javascript/javascript.min.js"></script>
<script src="vendor/three.min.js"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to simulator</a>
<!-- Header -->
<header class="site-header sim-header">
<a class="site-brand" href="index.html">Shimmer <span>Simulator</span></a>
<div class="site-tools sim-midi-tools">
<label class="port-label">
MIDI in
<select id="sim-midi-in-port"><option value="">-- any --</option></select>
</label>
<label class="port-label">
MIDI out
<select id="sim-midi-port"><option value="">-- none (visual only) --</option></select>
</label>
</div>
<nav class="site-nav" aria-label="Site links">
<a href="index.html" class="site-link">Website</a>
<a href="simulator.html" class="site-link" aria-current="page">Simulator</a>
<a href="user-modes/" class="site-link">JS API reference</a>
<a href="manual.pdf" class="site-link" target="_blank" rel="noopener" aria-label="Full User Manual opens in a new tab">Full User Manual</a>
<button type="button" class="site-link theme-toggle-link" data-theme-toggle aria-pressed="false">Dark mode</button>
</nav>
</header>
<!-- Main: LED grid (left) + Editor (right) -->
<main class="sim-main" id="main-content">
<h1 class="sr-only">Shimmer simulator</h1>
<div class="grid-panel">
<div class="grid-stage" id="sim-grid-stage">
<div class="grid-stage-layer grid-stage-layer-2d">
<canvas id="grid-canvas" width="600" height="600" role="img" aria-label="Simulated 12 by 12 LED grid"></canvas>
</div>
<div class="grid-stage-layer grid-stage-layer-3d" id="sim-3d-stage" tabindex="-1" aria-label="3D device simulator"></div>
<div class="sim-stage-overlay">
<div class="sim-sensor-readout" id="sim-sensor-readout">X +000 | Y +000 | Z +064 | M 000</div>
<div class="sim-3d-hint">Click device, then drag | R reset | S shake | Hold <span class="sim-axis-x">X</span>/<span class="sim-axis-y">Y</span>/<span class="sim-axis-z">Z</span> to lock</div>
</div>
</div>
</div>
<div class="editor-panel">
<div class="editor-toolbar">
<div class="script-search-wrap sim-script-search">
<label class="sim-script-search-label" for="sim-script-search">Script library</label>
<input type="text" class="script-search" id="sim-script-search"
placeholder="Search name, tag, or description" autocomplete="off" spellcheck="false"
aria-label="Search scripts" aria-controls="sim-script-results" aria-expanded="false">
<ul class="script-results" id="sim-script-results" role="listbox" aria-label="Script search results"></ul>
</div>
<div class="sim-byte-counter" id="sim-byte-counter">0 / 12288 bytes</div>
<button class="btn-run" id="btn-run">Run</button>
<button class="btn-stop" id="btn-stop">Stop</button>
<div class="sim-upload-tools">
<label class="sim-upload-slot">Slot
<select id="sim-upload-slot">
<option value="0">1</option>
<option value="1">2</option>
<option value="2">3</option>
<option value="3">4</option>
</select>
</label>
<button class="btn-run" id="btn-upload-shimmer">Upload to Shimmer</button>
</div>
</div>
<div id="sim-safety" class="sim-safety" role="status" aria-live="polite"></div>
<div id="sim-upload-status" class="sim-upload-status" role="status" aria-live="polite"></div>
<span class="sr-only" id="sim-code-editor-label">Script code editor</span>
<div id="editor-container" aria-labelledby="sim-code-editor-label"></div>
</div>
</main>
<!-- Controls bar -->
<div class="sim-controls">
<label>Scale
<select id="sim-scale">
<option value="0">Major</option>
<option value="1">Minor</option>
<option value="2">Dorian</option>
<option value="3" selected>Pentatonic</option>
<option value="4">Chromatic</option>
<option value="5">Mixolydian</option>
<option value="6">Lydian</option>
<option value="7">Phrygian</option>
<option value="8">Harmonic Minor</option>
<option value="9">Whole Tone</option>
</select>
</label>
<label>Root
<select id="sim-root"><!-- populated by JS --></select>
</label>
<label class="label-stack"><span>Tempo</span>
<div class="tempo-field">
<input type="range" id="sim-tempo" min="1" max="240" value="120">
<output id="sim-tempo-val">120</output>
<span id="sim-clock-info" class="control-note">Internal clock</span>
</div>
</label>
<label>Brightness
<input type="range" id="sim-brightness" min="0" max="255" value="200">
<output id="sim-brightness-val">200</output>
</label>
<label>
<span id="sim-param-label">Amount</span>
<input type="range" id="sim-param" min="0" max="255" value="128">
<output id="sim-param-val">128</output>
</label>
<label>MIDI Ch
<select id="sim-channel"><!-- populated by JS --></select>
</label>
<label>MIDI In Ch
<select id="sim-in-channel"><!-- populated by JS --></select>
</label>
<label class="label-stack"><span>Clock Mode</span>
<div class="control-stack">
<select id="sim-clock-mode">
<option value="auto">Auto</option>
<option value="leader">Leader</option>
<option value="follower">Follower</option>
<option value="internal">Internal</option>
</select>
<span id="sim-clock-mode-help" class="control-note">Auto: follow external clock when present, otherwise run internal clock and send clock out.</span>
</div>
</label>
<label class="sim-toggle" for="sim-enable-3d">
<input type="checkbox" id="sim-enable-3d">
<span class="sim-toggle-track" aria-hidden="true"></span>
<span class="sim-toggle-text">Enable 3D</span>
</label>
<span id="sim-status" class="sim-status-idle" role="status" aria-live="polite">Stopped</span>
</div>
<script src="theme.js?v=1"></script>
<script src="simulator-3d.js"></script>
<script src="script-safety.js?v=2"></script>
<script src="simulator.js?v=8"></script>
</body>
</html>