-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
364 lines (359 loc) Β· 10.4 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
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>TNG Sounds</title>
</head>
<style>
:root {
--background: white;
--color: black;
--item: rgb(202, 218, 251);
}
@media (prefers-color-scheme:dark) {
:root {
--background: rgb(20, 20, 20);
--color: white;
--item: rgb(59, 80, 122);
}
}
* {
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
*:focus {
outline-color: var(--item);
}
body {
background: var(--background);
color: var(--color);
margin: 0 64px;
margin-block-end: 128px;
}
.button-row {
display: flex;
justify-content: flex-end;
}
.button-row button {
background: var(--item);
color: inherit;
border-radius: 16px;
border: none;
padding: 8px 16px;
font-size: 1em;
}
.grid {
display: flex;
flex-wrap: wrap;
}
.section {
width: 100%;
margin-bottom: 32px;
}
.section > h2 {
margin-left: 8px;
}
.item {
margin: 8px;
border-radius: 16px;
padding: 16px;
background: var(--item);
box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.25);
display: flex;
flex-direction: column;
justify-content: space-between;
flex-basis: calc(100% / 3 - 16px);
}
.item[role=button] {
cursor: pointer;
}
.item h3 {
margin-top: 0;
max-width: 100%;
}
.item audio {
width: 100%;
}
@media (max-width: 900px) {
body {
margin: 16px;
}
.item {
flex-basis: calc(50% - 16px);
}
}
@media (max-width: 600px) {
.button-row {
position: fixed;
bottom: 0;
left: 0;
background: var(--background);
width: 100%;
z-index: 1;
padding: 16px;
}
.button-row button {
width: 100%;
}
.item {
flex-basis: 100%;
}
}
.hide {
display: none;
}
</style>
<script>
const iOS = () => {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform)
// iPad on iOS 13 detection
|| (navigator.userAgent.includes('Mac') && 'ontouchend' in document)
}
const isZoom = () => localStorage.getItem('zoomVol') === 'true'
const setZoom = (zoom) => localStorage.setItem('zoomVol', zoom ? 'true' : 'false')
const setToggleButtonContent = () => {
const zoomVolToggleButton = document.querySelector('button#zoom-vol-toggle')
if (isZoom()) {
zoomVolToggleButton.innerHTML = 'Set volumes back to normal π'
} else {
zoomVolToggleButton.innerHTML = 'Set volumes low for Zoom sharing π'
}
}
const setVolumes = (zoom) => {
const audios = document.querySelectorAll('audio')
audios.forEach(a => {
if (zoom) {
setZoom(true)
if (a.dataset.vol === 'quiet') {
a.volume = 0.03
} else {
a.volume = 0.1
}
} else {
a.volume = 1
}
})
}
const zoomVolToggle = () => {
setZoom(!isZoom())
setToggleButtonContent()
setVolumes(isZoom())
}
const setItems = () => {
if (!iOS()) {
setToggleButtonContent()
setVolumes(isZoom())
} else {
document.querySelector('.button-row').classList.add('hide')
}
const items = document.querySelectorAll('.item')
items.forEach(i => {
const audio = i.querySelector('audio')
if (audio) {
i.setAttribute('role', 'button')
i.onclick = (e) => {
if (e.target !== audio) {
if (!audio.paused) {
audio.pause()
} else {
audio.play()
}
}
}
}
})
}
window.onload = setItems
</script>
<body>
<h1>TNG Sounds π½ππ§βπ</h1>
<div class='button-row'>
<button id='zoom-vol-toggle' onclick='zoomVolToggle();'>...</button>
</div>
<div class='grid'>
<div class='section'>
<h2>Background loops π</h2>
<div class='grid'>
<div class='item'>
<h3>bridge 1</h3>
<audio data-vol='quiet' type='audio/mpeg' loop controls>
<source src='./sounds/tng_bridge_1.mp3'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>bridge 2</h3>
<audio data-vol='quiet' loop controls>
<source src='./sounds/tng_bridge_2.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
<div class='section'>
<h2>Alerts π¨</h2>
<div class='grid'>
<div class='item'>
<h3>alert</h3>
<audio controls>
<source src='./sounds/alert06.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>intruder alert deck 8</h3>
<audio controls>
<source src='./sounds/intruderalertdeck8_ep.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>auto pilot not working</h3>
<audio controls>
<source src='./sounds/autopilotnotfunctional.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
<div class='section'>
<h2>Answers π€</h2>
<div class='section grid'>
<div class='item'>
<h3>affirmative 1</h3>
<audio controls>
<source src='./sounds/affirmative1_ep.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>affirmative 2</h3>
<audio controls>
<source src='./sounds/affirmative2_ep.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
<div class='section grid'>
<div class='item'>
<h3>direction unclear, please repeat</h3>
<audio controls>
<source src='./sounds/directionunclearpleaserepeat_clean.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
<div class='section grid'>
<div class='item'>
<h3>don't sass computer</h3>
<audio controls>
<source src='./sounds/donotaddressthisunitinthatmanner_clean.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>incorrect</h3>
<audio controls>
<source src='./sounds/tos_incorrect_ep.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>negative</h3>
<audio controls>
<source src='./sounds/tos_negative_ep.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
<div class='section'>
<h2>Auto destruct π₯</h2>
<div class='grid'>
<div class='item'>
<h3>auto destruct armed</h3>
<audio controls>
<source src='./sounds/autodestructsequencearmed_ep.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>1min to self destruct</h3>
<audio controls>
<source src='./sounds/oneminutetoautodestruct_ep.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
<div class='section'>
<h2>Beeps and pews π«π€</h2>
<div class='grid'>
<div class='item'>
<h3>alert</h3>
<audio controls>
<source src='./sounds/alert06.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>processing</h3>
<audio controls>
<source src='./sounds/processing.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>pew!</h3>
<audio controls>
<source src='./sounds/tng_disruptor_clean.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
</div class='item'>
<div class='section'>
<h2>Denied βοΈ</h2>
<div class='grid'>
<div class='item'>
<h3>deny beep</h3>
<audio controls>
<source src='./sounds/denybeep1.mp3' type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>lvl 9 auth required</h3>
<audio controls>
<source src='./sounds/levelnineauthorizationrequired_ep.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
<div class='item'>
<h3>you are not auth to access this facility</h3>
<audio controls>
<source
src='./sounds/youarenotauthorisedtoaccessthisfacility_clean.mp3'
type='audio/mpeg'>
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
</div>
</body>
</html>