forked from greggman/html5bytebeat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
340 lines (312 loc) · 13.7 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
<!DOCTYPE html>
<html lang="en" data-theme="default">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#000000">
<meta property="og:title" content="Touchbit" />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://dev.eypacha.com/touchbit/touchbit.png" />
<meta property="og:image:width" content="600" />
<meta property="og:image:height" content="600" />
<meta property="og:description" content="Bytebeat for mobile" />
<meta property="og:url" content="https://dev.eypacha.com/touchbit" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@eypacha">
<meta name="twitter:creator" content="@eypacha">
<meta name="twitter:domain" content="dev.eypacha.com">
<meta name="twitter:title" content="Touchbit">
<meta name="twitter:url" content="https://dev.eypacha.com/touchbit">
<meta name="twitter:description" content="Bytebeat for mobile">
<meta name="twitter:image:src" content="https://dev.eypacha.com/touchbit/touchbit.png">
<link href="icon.png" rel="shortcut icon" type="image/png">
<link rel="stylesheet" href="styles/main.css">
<title>Touchbit</title>
<script src="js/lzma.min.js"></script>
<script src="js/peerjs.min.js"></script>
</head>
<body>
<div id="main" style="--exp-font-size: 30px">
<div id="controls"></div>
<div class="stack-container">
<div id="number-editor" class="modal-backdrop">
<div id="number-container" class="modal-body">
</div>
</div>
<div id="stack"></div>
<div class="debuggerContainer">
<div id="debugger">
</div>
</div>
</div>
<div id="keyboard">
<button class="command small notranslate hide" id="signalBtn" aria-label="function">SEND</button>
<div class="row">
<div class="row">
<div class="double-button">
<button class="button command small layer-1 notranslate" id="undo">UNDO</button>
<button class="button command small layer-1 notranslate" id="redo">REDO</button>
</div>
<div class="expandable" data-default="0">
<button class="symbol small notranslate">sin</button>
<div class="expanded left">
<div class="notranslate" data-insert="sin" aria-label="sin">sin</div>
<div class="notranslate" data-insert="cos" aria-label="con">cos</div>
<div class="notranslate" data-insert="tan" aria-label="tan">tan</div>
</div>
</div>
</div>
<div class="row">
<div class="expandable" data-default="4">
<button class="symbol small notranslate">pow</button>
<div class="expanded centered">
<div class="notranslate" data-insert="log" aria-label="log">log</div>
<div class="notranslate" data-insert="exp" aria-label="exp">exp</div>
<div class="notranslate" data-insert="abs" aria-label="absolute">abs</div>
<div class="notranslate" data-insert="sqrt" aria-label="square root">sqrt</div>
<div class="notranslate" data-insert="pow" aria-label="pow">pow</div>
<div class="notranslate" data-insert="floor" aria-label="floor">floor</div>
<div class="notranslate" data-insert="ceil" aria-label="ceil">ceil</div>
<div class="notranslate" data-insert="min" aria-label="min">min</div>
<div class="notranslate" data-insert="max" aria-label="max">max</div>
</div>
</div>
<div class="expandable" data-default="2">
<button class="symbol small notranslate">swap</button>
<div class="expanded centered">
<div class="notranslate" data-insert="pick">pick</div>
<div class="notranslate" data-insert="dup">dup</div>
<div class="notranslate" data-insert="swap">swap</div>
<div class="notranslate" data-insert="put">put</div>
<div class="notranslate" data-insert="drop">drop</div>
</div>
</div>
<div class="expandable" data-default="7">
<button class="symbol small notranslate" aria-label="equal">=</button>
<div class="expanded right">
<div data-insert="&&" aria-label="logical AND">&&</div>
<div data-insert="||" aria-label="logical OR">‖</div>
<div data-insert="<" aria-label="less than"><</div>
<div data-insert="<=" aria-label="less or equal than">≤</div>
<div data-insert=">" aria-label="greater than">></div>
<div data-insert=">=" aria-label="greater or equal than">≥</div>
<div data-insert="!=" aria-label="equal">≠</div>
<div data-insert="=" aria-label="equal">=</div>
</div>
</div>
</div>
</div>
<div class="row">
<button class="number" data-insert="7">7</button>
<button class="number" data-insert="8">8</button>
<button class="number" data-insert="9">9</button>
<button class="symbol" data-insert="*" aria-label="multiplication">*</button>
<button class="symbol" data-insert="/" aria-label="division">/</button>
<button class="symbol" data-insert="&" aria-label="bitwise AND">&</button>
</div>
<div class="row">
<button class="number" data-insert="4">4</button>
<button class="number" data-insert="5">5</button>
<button class="number" data-insert="6">6</button>
<button class="symbol" data-insert="+" aria-label="addition">+</button>
<button class="symbol" data-insert="-" aria-label="substraction">-</button>
<button class="symbol" data-insert="|" aria-label="bitwise OR">|</button>
</div>
<div class="row">
<button class="number" data-insert="1">1</button>
<button class="number" data-insert="2">2</button>
<button class="number" data-insert="3">3</button>
<button class="symbol" data-insert="%" aria-label="modulus">%</button>
<button class="symbol" data-insert="~" aria-label="bitwise NOT">~</button>
<button class="symbol" data-insert="^" aria-label="bitwise XOR">^</button>
</div>
<div class="row">
<button class="number" data-insert=".">.</button>
<button class="number" data-insert="0">0</button>
<button class="modifier" id="clear" aria-label="clear">⌫</button>
<button class="symbol t" data-insert="t">t</button>
<button class="symbol" data-insert="<<" aria-label="left shift">«</button>
<button class="symbol" data-insert=">>" aria-label="right shift">»</button>
</div>
<div class="row">
<div class="row">
<!-- <button class="command small notranslate" id="fnMode" aria-label="function">FN</button> -->
<button class="command small notranslate" id="holdMode" aria-label="hold">HOLD</button>
<button class="command small notranslate" id="insertSlot" aria-label="insert">INS</button>
<button class="command small notranslate" id="deleteSlot" aria-label="delete">DEL</button>
</div>
<div class="row">
<div class="double-button">
<button class="command" id="selectPrev" aria-label="previous">←</button>
<button class="command" id="selectNext" aria-label="next">→</button>
</div>
</div>
</div>
</div>
</div>
<div id="settingsdialog" class="modal-backdrop">
<div class="dialog">
<div class="dialog-header">
<div class="title">♥ Touchbit</div>
<button id="cancelSettings" aria-label="close">×</button>
</div>
<div class="dialog-body">
<div class="tab-wrap">
<input type="radio" id="tab1" name="tabGroup1" class="tab" checked>
<label for="tab1">Audio</label>
<input type="radio" id="tab2" name="tabGroup1" class="tab">
<label for="tab2">Styles</label>
<input type="radio" id="tab3" name="tabGroup1" class="tab">
<label for="tab3">More</label>
<input type="radio" id="tab4" name="tabGroup1" class="tab">
<label for="tab4">About</label>
<div class="tab__content">
<div>
<label>
<span>Equalizer</span>
<label class="switch">
<input id="eqSwitch" type="checkbox" checked/>
<span class="slider round"></span>
</label>
</label>
</div>
<div id="eqOptions">
<canvas id="eqGraph" width="512" height="300"></canvas>
<table>
<tr>
<th>bass</th>
<td><input id="eq-bass" type="range" min="-20" max="20" value="0" step="0.01" /></td>
<td><output id="eq-bass-value"></output></td>
</tr>
<tr>
<th>mid</th>
<td><input id="eq-mid" type="range" min="-20" max="20" value="0" step="0.01" /></td>
<td><output id="eq-mid-value"></output></td>
</tr>
<tr>
<th>treble</th>
<td><input id="eq-treble" type="range" min="-20" max="20" value="0" step="0.01" /></td>
<td><output id="eq-treble-value"></output></td>
</tr>
</table>
</div>
</div>
<div class="tab__content">
<div>
<label>
<span>Theme </span>
<select id="selectTheme">
<option>default</option>
<option>tropical</option>
<option>lavander</option>
<option>monochrome-dark</option>
<option>monochrome-light</option>
<option>randomize</option>
</select>
<button id="randomizeBtn">?</button>
</label>
</div>
<div>
<div>
<label>
<span>Expresion font size:</span>
<input id="expFontSize" type="number" inputmode="numeric" value="30" min="10" max="100">
<span class="notranslate">px</span>
</label>
</div>
</div>
<div>
<div>
<label>
<span>Key height:</span>
<input id="keyHeight" type="number" inputmode="numeric" value="45" min="20" max="100">
<span class="notranslate">px</span>
</label>
</div>
</div>
<div style="margin-top: 1em; text-align: center;">
<a href="#" id="restoreSettings">Restore default settings</a>
</div>
</div>
<div class="tab__content">
<div>
<label>
<span>Mode</span>
<select id="selectMode">
<option>bytebeat</option>
<option>floatbeat</option>
</select>
</label>
</div>
<div>
<label>
<span>Debug mode</span>
<label class="switch">
<input type="checkbox" id="debugMode">
<span class="slider round"></span>
</label>
</label>
</div>
<div>
<label>
<span>Save logs</span>
<label class="switch">
<input type="checkbox" id="saveLogs">
<span class="slider round"></span>
</label>
<button id="viewLogs" disabled>View</button>
<button id="clearLogs" disabled>Clear</button>
</label>
</div>
<div>
<div>Export expression to:</div>
<div class="help-text">
<a href="https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html" id="toGreggman"
target="_blank">Greggman editor</a> or <a href="#" id="copyToClipboard">Clipboard</a> <span
id="clipStatus"></span>
</div>
</div>
<div>Remote mode</div>
<div class="help-text">Open <a href="receive/" target="_blank">this url</a> in another screen and scan the
qr code or paste here the receiver id</div>
<div>
<input type="text" id="receiver-id" placeholder="id">
</div>
<div>
<button id="connect-button">Connect</button>
<button id="disconnect-button" class="hide">Disconect</button>
</div>
<div id="peerStatus"></div>
</div>
<div class="tab__content">
<div class="mb-6">Touchbit is a 'mobile-friendly' interface for composing bytebeat music using postfix
expressions.</div>
<div><b>More info: </b><br />
<a href="https://github.com/eypacha/touchbit" target="_blank">github.com/eypacha/touchbit</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="logsDialog" class="modal-backdrop">
<div class="dialog">
<div class="dialog-header">
<div class="title">Logs</div>
<button id="cancelLogs" aria-label="close">×</button>
</div>
<div class="dialog-body">
<textarea id="logs" readonly></textarea>
</div>
</div>
</div>
<div id="startTouchbitContainer">
<div>Touchbit</div>
<button id="startTouchbit">start</button>
</div>
<div id="loadingContainer">
<div>loading...</div>
</div>
<script type="module" src="editor/index.js"></script>
</body>
</html>