-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
703 lines (669 loc) · 20.8 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
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
<!DOCTYPE html>
<!-- Code formatting done with Prettier for VS Code-->
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Favicons generated by https://realfavicongenerator.net -->
<link
rel="apple-touch-icon"
sizes="180x180"
href="favicons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="favicons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="194x194"
href="favicons/favicon-194x194.png"
/>
<link
rel="icon"
type="image/png"
sizes="192x192"
href="favicons/android-chrome-192x192.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="favicons/favicon-16x16.png"
/>
<link rel="manifest" href="favicons/site.webmanifest" />
<link
rel="mask-icon"
href="favicons/safari-pinned-tab.svg"
color="#000000"
/>
<link rel="shortcut icon" href="favicons/favicon.ico" />
<meta name="apple-mobile-web-app-title" content="Phixer" />
<meta name="application-name" content="Phixer" />
<meta name="msapplication-TileColor" content="#ffed4e" />
<meta name="msapplication-config" content="favicons/browserconfig.xml" />
<title>Phixer</title>
<!-- p5js library -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.js"
harset="utf-8"
></script>
<!-- Tone.js -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.8.38/Tone.js"
charset="utf-8"
></script>
<!-- Phixer.js -->
<script src="Phixer.js" charset="utf-8"></script>
<!-- Bootstrap CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<!-- Bootstrap icons -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"
/>
<!-- Main CSS -->
<link href="style.css" rel="stylesheet" charset="utf-8" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-primary">
<div class="container add-padding">
<a class="navbar-brand fs-1 fw-bold" href=""
><img src="logo.svg" alt="" id="logo-img"
/></a>
<!-- Navbar is hidden for demo purposes -->
<!-- <button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div> -->
</div>
</nav>
</header>
<!-- Steps and errors -->
<div class="container my-4 p-0 add-padding">
<main>
<!-- Spinner overlay -->
<div
class="container-fluid d-flex flex-fill position-fixed justify-content-center align-items-center pe-none h-75 start-0"
id="spinner-container"
>
<div class="d-flex flex-column">
<div>
<div class="spinner-grow" role="status">
<span class="visually-hidden">Loading...</span>
</div>
</div>
<!-- <p class="mb-0 fs-4 fw-bold text-center"><span id="spinner"></span>%</p> -->
</div>
</div>
<!-- Error screen-->
<div class="container step-container" id="error" style="opacity: 0">
<h1 class="fw-bold">Error</h1>
<hr id="header-hr" class="col-lg-2 col-md-3 col-4 m-0" />
<section class="py-4">
<div class="container-fluid d-flex px-0 fs-5">
<div class="container-fluid pe-0">
<p class="m-0 p-0">
An error was encountered during execution.
</p>
<div class="bg-light p-4 mt-3">
<code></code>
</div>
</div>
</div>
</section>
<hr class="border mt-2 mb-0" />
<a href="">
<button
type="button"
class="col-md-4 col-sm-6 col-12 btn btn-primary text-black fs-3 fw-bold text-start px-4 py-2 my-3 rounded-3"
>
← Start over
</button>
</a>
</div>
<!-- Step 1: upload -->
<div class="container step-container" id="step-1" style="opacity: 1">
<h1 class="fw-bold">Step 1</h1>
<hr id="header-hr" class="col-lg-2 col-md-3 col-4 m-0" />
<section class="py-4">
<div class="container-fluid d-flex px-0 fs-5">
<div class="text-muted fw-bold">
<p>1.</p>
</div>
<div class="container-fluid pe-0">
<p>
Select your files.
<a
href="#/"
class="text-muted what-is-that"
data-bs-toggle="tooltip"
data-bs-offset="0,3"
data-bs-html="true"
data-bs-placement="bottom"
title="Phixer is currently working with <b>.wav</b> files only with the total of <b>2</b> channels. 32-bit audio is <u><b>not</b></u> supported."
>
What files?
</a>
</p>
<div
class="d-flex justify-content-center align-items-center bg-light border rounded-3"
id="upload-window"
>
<div id="upload-files-div">
<img
src="upload_icon.svg"
class="mx-auto d-block pb-3"
id="upload-icon"
alt=""
/>
<input
type="file"
multiple
class="text-muted m-0 form-control"
id="upload-files-input"
/>
<p class="text-muted mb-0">
<a href="#/" class="text-muted">Select</a>
or drag-and-drop
</p>
</div>
</div>
<div
class="container-fluid px-0 mt-3 text-muted"
id="uploadedFilesCountDiv"
>
<p class="p-0 m-0">
Files uploaded:
<span
class="fw-bold border py-1 px-2 bg-light rounded-3"
id="uploadedFilesCount"
>0</span
>
</p>
</div>
</div>
</div>
</section>
<hr class="border mt-2 mb-0" />
<button
type="button"
class="col-md-4 col-sm-6 col-12 btn btn-primary text-black fs-3 fw-bold text-start px-4 py-2 my-3 rounded-3 button-next"
id="btn-step1"
>
Next →
</button>
</div>
<!-- Step 2: set preferences -->
<div class="container step-container" id="step-2" style="opacity: 0">
<h1 class="fw-bold">Step 2</h1>
<hr id="header-hr" class="col-lg-2 col-md-3 col-4 m-0" />
<section class="py-4">
<div class="container-fluid d-flex px-0 fs-5">
<div class="text-muted fw-bold">
<p>1.</p>
</div>
<div class="container-fluid pe-0">
<p>Specify the duration and select in and out points.</p>
<!-- Player -->
<div class="d-flex flex-column container-fluid p-0">
<!-- Change take button -->
<div class="dropdown dropstart align-self-end">
<button
class="d-flex btn btn-secondary dropdown-toggle align-items-center border rounded-3 text-muted"
data-bs-offset="0, 10"
type="button"
id="change-takes-button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
<img
src="change_take.svg"
alt=""
id="change-take-button-img"
class="d-inline"
/>
</button>
<ul
class="dropdown-menu"
aria-labelledby="dropdownMenuButton1"
id="takes-dropdown"
>
<li>
<a class="dropdown-item active" href="#/"
>No file uploaded</a
>
</li>
</ul>
</div>
<div class="d-flex flex-row p-0">
<!-- Start / stop button -->
<div>
<button
class="btn btn-primary rounded-circle"
id="player-button"
>
<img
src="play_button.svg"
class="ps-2"
id="play-button"
phixer-player-button="play"
alt="Play button"
/>
<div id="stop-button" phixer-player-button="stop"></div>
</button>
</div>
<div class="d-flex flex-column flex-fill ms-3">
<!-- Waveform window -->
<div
class="d-flex bg-light border rounded-3"
id="player-wrapper"
>
<div
class="d-flex container-fluid p-0 m-0 justify-content-between ends-faded ends-faded-darker"
></div>
<div
class="flex-fill position-relative"
id="player-waveform"
>
<div id="player-progress">
<div
class="d-flex container-fluid p-0 m-0 justify-content-between ends-faded-progress"
></div>
<div id="player-progress-bg"></div>
</div>
<div id="player"></div>
</div>
</div>
<!-- In / out points / duration -->
<div
class="d-flex justify-content-between fs-6 text-muted mt-3"
>
<div
class="d-flex flex-column align-items-center time-markers-l col-3 col-md-2 col-xxl-1 text-decoration-underline"
>
<label for="in-point" class="form-label in-out-labels"
>In point</label
>
<input
type="text"
autocomplete="off"
pattern="\d"
inputmode="numeric"
placeholder="00:00"
class="form-control bg-light border rounded-3 text-muted in-out-points"
id="in-point"
phixer-in-out-points="inPoint"
/>
</div>
<div class="d-flex flex-column align-items-center">
<div
class="btn bg-light border rounded-3 text-muted in-out-points px-4"
id="take-duration"
>
<p class="m-0 p-0">
<span>5</span>
sec.
</p>
</div>
</div>
<div
class="d-flex flex-column align-items-center time-markers-r col-3 col-md-2 col-xxl-1 text-decoration-underline"
>
<label
for="out-point"
class="form-label in-out-labels"
>Out point</label
>
<input
type="text"
autocomplete="off"
pattern="\d"
inputmode="numeric"
placeholder="00:05"
class="text-muted form-control bg-light border rounded-3 in-out-points"
id="out-point"
phixer-in-out-points="outPoint"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="pb-4">
<div class="container-fluid d-flex px-0 fs-5">
<div class="text-muted fw-bold">
<p>2.</p>
</div>
<div class="container-fluid m-0 p-0 switch-range-number">
<div class="container-fluid pe-0 switch-range" id="block-2-2-1">
<label for="2-2-1-range" class="form-label">
<p class="m-0 p-0">
<a id="switch-2-2-1"
>Select your preference for spatial image</a
>
or
<a href="#/" class="text-muted" id="switch-2-2-2"
>use linear corellation coefficient</a
>.
</p>
</label>
<div class="d-flex container-fluid p-0 m-0 position-relative">
<div
class="d-flex container-fluid p-0 m-0 justify-content-between ends-faded"
></div>
<div class="range-wrap d-flex container-fluid p-0 m-0">
<div class="range-extension"></div>
<div class="range-wrap-center">
<input
type="range"
class="form-range input-range"
data-phixer-pref="targetLCC"
name="range-2-2"
id="2-2-1-range"
min="0"
max="100"
value="50"
/>
<output class="bubble fs-6"></output>
</div>
<div class="range-extension"></div>
</div>
</div>
</div>
<div
class="container-fluid pe-0 switch-number"
id="block-2-2-2"
>
<label for="2-2-2-number" class="form-label">
<p class="p-0 m-0">
Select
<a id="switch-2-2-1" href="#/" class="text-muted"
>your preference for spatial image</a
>
or
<a id="switch-2-2-2">use linear corellation coefficient</a
>.
</p>
</label>
<div class="d-flex flex-row mt-2">
<input
type="text"
name="number-2-2"
inputmode="decimal"
id="2-2-2-number"
class="form-control bg-light border rounded-3 number-big fs-2 text-black fw-bold px-3 py-2 input-number"
placeholder="0.5"
data-phixer-pref="targetLCC"
pattern="[^\d.]"
autocomplete="off"
/>
<p class="text-muted fs-6 align-self-center m-3">
out of 1
</p>
</div>
</div>
</div>
</div>
</section>
<section class="pb-4">
<div class="container-fluid d-flex px-0 fs-5">
<div class="text-muted fw-bold">
<p>3.</p>
</div>
<div class="container-fluid m-0 p-0 switch-range-number">
<div class="container-fluid pe-0 switch-range">
<label for="2-2-3-range" class="form-label">
<p class="m-0 p-0">
<a id="switch-2-3-1">Choose the precision</a>
or
<a href="#/" class="text-muted" id="switch-2-3-2"
>enter the sampling rate for analysis</a
>.
</p>
</label>
<div class="d-flex container-fluid p-0 m-0 position-relative">
<div
class="d-flex container-fluid p-0 m-0 justify-content-between ends-faded"
></div>
<div class="range-wrap d-flex container-fluid p-0 m-0">
<div class="range-extension"></div>
<div class="range-wrap-center">
<input
type="range"
class="form-range input-range"
data-phixer-pref="analysisSampleRate"
name="range-2-3"
id="2-3-1-range"
min="0"
max="100"
value="50"
/>
<output class="bubble fs-6"></output>
</div>
<div class="range-extension"></div>
</div>
</div>
</div>
<div
class="container-fluid pe-0 switch-number"
id="block-2-3-2"
>
<label for="2-3-2-number" class="form-label">
<p class="p-0 m-0">
Choose
<a id="switch-2-3-1" href="#/" class="text-muted"
>the precision</a
>
or
<a id="switch-2-3-2"
>enter the sampling rate for analysis</a
>.
</p>
</label>
<div class="d-flex flex-row mt-2">
<input
type="text"
name="number-2-3"
id="2-3-2-number"
inputmode="numeric"
class="form-control bg-light border rounded-3 number-big fs-2 text-black fw-bold px-3 py-2 input-number"
placeholder="44100"
data-phixer-pref="analysisSampleRate"
autocomplete="off"
/>
<p class="text-muted fs-6 align-self-center m-3">
samples per second
</p>
</div>
</div>
</div>
</div>
</section>
<hr class="border mt-2 mb-0" />
<button
type="button"
class="col-md-4 col-sm-6 col-12 btn btn-primary text-black fs-3 fw-bold text-start px-4 py-2 my-3 rounded-3 button-next"
id="btn-step2"
>
Phix →
</button>
</div>
<!-- Step 3: choose output format -->
<div class="container step-container" id="step-3" style="opacity: 0">
<h1 class="fw-bold">Step 3</h1>
<hr id="header-hr" class="col-lg-2 col-md-3 col-4 m-0" />
<section class="py-4">
<div class="container-fluid d-flex px-0 fs-5">
<div class="text-muted fw-bold">
<p>1.</p>
</div>
<div class="container-fluid pe-0">
<form>
<fieldset>
<legend class="fs-5">Choose the output format.</legend>
<div class="form-check">
<input
type="radio"
class="form-check-input"
phixer-output-format="none"
checked
id="3-1-1-radio"
name="output-format"
/>
<label for="3-1-1-radio" class="form-check-label fs-5"
>None</label
>
</div>
<div class="form-check">
<input
type="radio"
class="form-check-input"
phixer-output-format="wav"
id="3-1-2-radio"
name="output-format"
/>
<label for="3-1-2-radio" class="form-check-label fs-5"
>WAV</label
>
</div>
<div class="form-check">
<input
type="radio"
class="form-check-input"
phixer-output-format="mp3"
id="3-1-3-radio"
name="output-format"
/>
<label for="3-1-3-radio" class="form-check-label fs-5"
>MP3</label
>
</div>
</fieldset>
</form>
</div>
</div>
</section>
<hr class="border mt-2 mb-0" />
<button
type="button"
class="col-md-4 col-sm-6 col-12 btn btn-primary text-black fs-3 fw-bold text-start px-4 py-2 my-3 rounded-3 button-next"
id="btn-step3"
>
Phix →
</button>
</div>
<!-- Step 4: results -->
<div class="container step-container" id="results" style="opacity: 0">
<h1 class="fw-bold">Results</h1>
<hr id="header-hr" class="col-lg-2 col-md-3 col-4 m-0" />
<section class="py-4">
<div class="container-fluid d-flex px-0 fs-5 pb-2">
<div class="container-fluid pe-0">
<p class="m-0 p-0">LCC:</p>
<div class="bg-light p-4 mt-3">
<p class="fw-bold fs-3 m-0 p-0">
<span id="initial-lcc"></span> →
<span id="result-lcc"></span>
</p>
</div>
</div>
</div>
<div class="container-fluid d-flex px-0 fs-5 py-2">
<div class="container-fluid pe-0">
<p class="m-0 p-0">Nudging advice (approximate):</p>
<div class="bg-light p-4 mt-3">
<p class="m-0 p-0">
<span id="take-name"></span><br />
<span
class="fw-bold fs-3 what-is-that me-2"
id="inverted"
data-bs-toggle="tooltip"
data-bs-offset="0,3"
data-bs-html="true"
data-bs-placement="bottom"
title="Invert the polarity of this channel."
hidden
aria-hidden="true"
><img
src="inverted.svg"
alt="Inverted"
id="inverted-svg" /></span
><span class="fw-bold fs-3" id="sign"></span
><span class="fw-bold fs-3" id="samples"></span
><span class="fw-bold fs-3"> samples</span>
</p>
</div>
</div>
</div>
</section>
<hr class="border mt-2 mb-0" />
<a href="/#">
<button
type="button"
class="col-md-4 col-sm-6 col-12 btn btn-primary text-black fs-3 fw-bold text-start px-4 py-2 my-3 rounded-3 button-next"
id="btn-step4"
>
<i class="bi bi-file-earmark-arrow-down-fill me-2"></i>Download
</button>
</a>
</div>
</main>
<footer class="container">
<p class="text-muted text-end py-2" id="footer">
© 2022 UoY Exam Number Y3903676<br /><a
href="https://github.com/grintroy/phixer/blob/main/credits.md"
class="text-muted"
target="_blank"
>Credits</a
>
</p>
</footer>
</div>
<!-- Popper and Bootstrap JS -->
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
crossorigin="anonymous"
></script>
<!-- Main JS -->
<script src="script.js" charset="utf-8"></script>
</body>
</html>