-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
625 lines (577 loc) · 34.5 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
<!DOCTYPE html>
<html>
<head>
<title>IntelliNote | Custom Sheet Music</title>
<!-- favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="assets/img/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/icons/favicon-16x16.png">
<link rel="manifest" href="assets/img/icons/site.webmanifest">
<!-- bulma css -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
<!-- bulma extension - tooltip -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bulma-tooltip.min.css">
<!-- font awesome (for icons) -->
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<!-- custom css -->
<link rel="stylesheet" href="assets/css/custom.css">
<!-- tonejs -->
<script src="https://unpkg.com/[email protected]/build/Tone.js"></script>
<!-- Google OAuth -->
<meta name="google-signin-client_id" content="551645492483-lal6djpa0n6d64u6k2bvqmfvgoverdak.apps.googleusercontent.com">
<!-- Hotjar -->
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:1850543,hjsv:6};
a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1;
r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
a.appendChild(r);
})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
</head>
<body>
<nav class="navbar is-dark navbar-gradient" role="navigation" aria-label="main navigation">
<div class="container">
<div class="navbar-brand">
<p class="navbar-item is-size-5 poppins" style="font-weight: 600;padding-right:0.3rem"><a
class="has-text-white" href="index.html">IntelliNote</a></p>
<p class="navbar-item is-size-6 poppins" style="font-weight: 400;padding-left:0px;top:0.1rem">Custom
Sheet Music</p>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
data-target="navbarMain">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarMain" class="navbar-menu">
<div class="navbar-start">
</div>
<div class="navbar-end">
<p class="navbar-item has-text-weight-light karla"><a class="has-text-white" href='explore.html'>Explore</a></p>
<p class="navbar-item has-text-weight-light karla" id="open-login-modal"><a class="has-text-white">Sign In</a></p>
<div class="navbar-item has-dropdown is-hoverable is-hidden" id="navbar-dropdown">
<a class="navbar-link is-arrowless">
<span class="icon is-small">
<i class="fas fa-bars"></i>
</span>
</a>
<div class="navbar-dropdown is-right">
<a href='profile.php' class="navbar-item karla">
Profile
</a>
<a href='index.html' onclick="signOut()" class="navbar-item karla">
Sign Out
</a>
</div>
</div>
</div>
</div>
</nav>
<!-- padding container for style points-->
<div class="empty-padding"></div>
<!-- main body div -->
<div class="container site-content">
<!-- div for alerts -->
<div class="container karla" id="createDialog" style="position: relative; z-index: 5" hidden></div>
<!-- div for columns -->
<div class="columns" id="main-content">
<!-- first column -->
<div class="column is-one-quarter">
<nav class="panel has-background-white">
<div class="panel-heading">
<p class="poppins">Settings
<button id="open-info-modal" style="float:right"
class="button gradient is-small is-info is-rounded karla">
<span>How-To</span>
<span class="icon is-small">
<i class="fas fa-info-circle"></i>
</span>
</button>
</p>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem;">
<div class="container">
<!-- play/stop buttons -->
<div class="field has-addons">
<p class="control">
<button class="button is-info is-small is-rounded karla gradient" id="start"
onclick="startPlaying()">
<span class="icon is-small">
<i class="fas fa-play"></i>
</span>
<span>Play</span>
</button>
</p>
<p class="control">
<button class="button is-info is-small is-rounded karla gradient" id="stop"
onclick="stopPlaying()" disabled>
<span class="icon is-small">
<i class="fas fa-stop"></i>
</span>
<span>Stop</span>
</button>
</p>
</div>
</div>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem">
<div class="container">
<p class="subtitle is-6 poppins"
style="margin-bottom: 0.5rem;font-weight: 500;font-size:small">Tempo</p>
<!-- Tempo Slider -->
<div class="sliderDiv">
<input type="range" min="30" max="240" value="120" id="tempoSlider"
oninput="updateTempo(this.value);">
</div>
<p class="karla" style="font-size: 0.85rem">Current tempo: <input class="karla is-small"
type="text" size="3" style="text-align:right" value="120" id="tempoBox"
onchange="updateTempo(this.value)"> BPM</p>
</div>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem">
<div class="container">
<p class="subtitle is-6 poppins"
style="margin-bottom: 0.5rem;font-weight: 500;font-size:small">Time Signature</p>
<div class="control has-icons-left">
<div class="select">
<select class="karla" id="timeSig" onchange="changeTimeSig()">
<option value="2">2/4</option>
<option value="3">3/4</option>
<option selected="selected" value="4">4/4</option>
</select>
</div>
<span class="icon is-left">
<i class="fas fa-clock"></i>
</span>
</div>
</div>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem;">
<div class="container">
<p class="subtitle is-6 poppins"
style="margin-bottom: 0.5rem;font-weight: 500;font-size:small">Change Note</p>
<!-- note lengths -->
<form id="lengthForm">
<input type="radio" name="note" value="eighthNote"
onclick="assignNote()" checked>
<label for="eighthNote"> <img src="assets/img/eighthNote.png" style="height: 2rem;">
</label>
<input type="radio" name="note" value="quarterNote"
onclick="assignNote()">
<label for="quarterNote"> <img src="assets/img/quarterNote.png" style="height: 2rem;">
</label>
<input type="radio" name="note" value="halfNote" onclick="assignNote()">
<label for="halfNote"> <img src="assets/img/halfNote.png" style="height: 2rem;">
</label>
<input type="radio" name="note" value="wholeNote" onclick="assignNote()">
<label for="wholeNote"> <img src="assets/img/wholeNote.png" style="height: 2rem;">
</label>
</form>
<br>
<!-- accidentals -->
<form id="accidentalForm">
<input type="radio" name="accidental" value="" onclick="assignNote()"
checked>
<label for="natural"> <img src="assets/img/Natural.png" style="height: 1.75rem;">
</label>
<input type="radio" name="accidental" value="#" onclick="assignNote()">
<label for="sharp"> <img src="assets/img/Sharp.png" style="height: 1.75rem;">
</label>
<input type="radio" name="accidental" value="b" onclick="assignNote()">
<label for="sharp"> <img src="assets/img/Flat.png" style="height: 1.75rem;"> </label>
</form>
</div>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem;">
<div class="container">
<p class="subtitle is-6 poppins"
style="margin-bottom: 0.5rem;font-weight: 500;font-size:small">Sheet</p>
<!-- add/remove row buttons -->
<div class="field is-grouped">
<p class="control">
<button class="button is-info is-small is-rounded karla gradient"
onclick="addRow()">
<span class="icon is-small">
<i class="fas fa-plus"></i>
</span>
<span>Add row</span>
</button>
</p>
<p class="control">
<button class="button is-info is-small is-rounded karla gradient"
onclick="removeRow()" id="removeButton" disabled>
<span class="icon is-small">
<i class="fas fa-minus"></i>
</span>
<span>Remove row</span>
</button>
</p>
</div>
<!-- clear sheet button -->
<div class="field">
<p class="control">
<button class="button is-info is-small is-rounded karla gradient"
id="clearButton" onclick="clearSheet()">
<span class="icon is-small">
<i class="fas fa-ban"></i>
</span>
<span>Clear sheet</span>
</button>
</p>
</div>
</div>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem;">
<div class="container">
<p class="subtitle is-6 poppins"
style="margin-bottom: 0.5rem;font-weight: 500;font-size:small">Share</p>
<!-- textbox modal button -->
<div class="field is-grouped">
<p class="control">
<button class="button is-info is-small is-rounded karla gradient"
id="saveButton" onclick="saveLogic()">
<span class="icon is-small">
<i class="fas fa-save"></i>
</span>
<span>Save</span>
</button>
</p>
<p class="control">
<button class="button is-info is-small is-rounded karla gradient"
id="open-export-modal">
<span class="icon is-small">
<i class="fas fa-upload"></i>
</span>
<span>Import/Export</span>
</button>
</p>
</div>
</div>
</div>
<div class="panel-block" style="padding: 0.5rem 1.5rem;">
<div class="container">
<p class="subtitle is-6 poppins"
style="margin-bottom: 0.5rem;font-weight: 500;font-size:small">Preset Songs</p>
<div class="control has-icons-left">
<div class="select">
<select class="karla" id="songDropdown" onchange="loadSong(this.value)">
<option selected value="none"> None </option>
<option value="miiTheme"> Mii Theme</option>
<option value="tetris">Tetris Theme</option>
<option value="fallinginlove">Can't Help Falling In Love</option>
<option value="epilogue">Epilogue - La La Land</option>
</select>
</div>
<span class="icon is-left">
<i class="fas fa-folder-open"></i>
</span>
</div>
</div>
</div>
</nav>
</div>
<!-- second column -->
<div class="column is-three-fifths" id="sheet-rows">
<!-- title -->
<div class="columns">
<div class="column is-2"></div>
<div class="column is-10 karla" data-tooltip="Rename" contenteditable="true"
id="title" spellcheck="false" autocomplete="false">My Masterpiece</div>
</div>
<div class="empty-padding" style="padding: 0.5rem"></div>
<!-- treble clef -->
<div class="columns">
<div class="column is-2" style="padding-right:0" id="column-left">
<div id="timeSigImgT">
</div>
<img src="assets/img/treble-clef.png"
style="height:4.5rem;float:right;position:relative;top:1rem">
</div>
<div class="column is-10" id="t-col">
<table class="sheet" id="treble-sheet-1">
</table>
</div>
</div>
<!-- bass clef -->
<div class="columns">
<div class="column is-2" style="padding-right:0" id="column-left">
<div id="timeSigImgB">
</div>
<img src="assets/img/bass-clef.png"
style="height:2.5rem;float:right;position:relative;top:1.5rem">
</div>
<div class="column is-10" id="b-col">
<table class="sheet" id="bass-sheet-1">
</table>
</div>
</div>
<!-- hidden settings panel -->
<div class="panel is-hidden is-contextMenu" id="customContext" style="position:absolute; width: 250px; z-index: 20;">
<p class="panel-heading poppins is-contextMenu">
Quick Edit
</p>
<div class="panel-block has-background-white is-contextMenu">
<form class="is-contextMenu" id="lengthFormContext">
<input type="radio" name="note" value="eighthNote"
onclick="assignNoteContext()" checked>
<label class="is-contextMenu" for="eighthNote"> <img src="assets/img/eighthNote.png" style="height: 2rem;">
</label>
<input type="radio" name="note" value="quarterNote"
onclick="assignNoteContext()">
<label class="is-contextMenu" for="quarterNote"> <img src="assets/img/quarterNote.png" style="height: 2rem;">
</label>
<input type="radio" name="note" value="halfNote" onclick="assignNoteContext()">
<label class="is-contextMenu" for="halfNote"> <img src="assets/img/halfNote.png" style="height: 2rem;">
</label>
<input type="radio" name="note" value="wholeNote" onclick="assignNoteContext()">
<label class="is-contextMenu" for="wholeNote"> <img src="assets/img/wholeNote.png" style="height: 2rem;">
</label>
</form>
</div>
<div class="panel-block has-background-white is-contextMenu">
<!-- accidentals -->
<form class="is-contextMenu" id="accidentalFormContext">
<input type="radio" name="accidental" value="" onclick="assignNoteContext()"
checked>
<label class="is-contextMenu" for="natural"> <img src="assets/img/Natural.png" style="height: 1.75rem;">
</label>
<input type="radio" name="accidental" value="#" onclick="assignNoteContext()">
<label class="is-contextMenu" for="sharp"> <img src="assets/img/Sharp.png" style="height: 1.75rem;">
</label>
<input type="radio" name="accidental" value="b" onclick="assignNoteContext()">
<label class="is-contextMenu" for="sharp"> <img src="assets/img/Flat.png" style="height: 1.75rem;"> </label>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="empty-padding"></div>
<!-- login modal-->
<div class="modal" id="loginModal">
<div class="modal-background" id="background-login"></div>
<div class="modal-content">
<nav class="panel has-background-white">
<p class="panel-heading poppins">
Sign In
</p>
<div class="container" style="padding: 1rem 1.5rem;">
<div class="g-signin2" data-theme="dark" data-longtitle="true" data-width="250" data-height="50" data-onsuccess="onSignIn"></div>
</div>
</nav>
</div>
<button class="modal-close is-large" id="close-login" aria-label="close"></button>
</div>
<!-- textbox modal for import/export -->
<div class="modal" id="exportModal">
<div class="modal-background" id="background-export"></div>
<div class="modal-content">
<nav class="panel has-background-white">
<p class="panel-heading poppins">
Import/Export
</p>
<div class="container" style="padding: 1rem 1.5rem;">
<p class="karla">Press the "Export" button to generate plaintext for you to store your current song,
or paste a song you exported earlier and press "Import" to bring it back up.</p><br>
<div class="field">
<div class="control relative">
<textarea class="textarea is-info is-small karla" id="exportBox"
placeholder="If you don't know what to put in here, try pressing Export first!"></textarea>
<button class="button has-background-light is-small is-text karla" id="copy"
onclick="copy()">Copy to clipboard</button>
</div>
</div>
<!-- import/export buttons -->
<div class="container">
<button class="button is-info is-small is-rounded karla gradient" id="import"
onclick="importSong()">Import</button>
<button class="button is-info is-small is-rounded karla gradient" id="export"
onclick="exportSong()">Export</button>
</div>
</div>
</nav>
</div>
<button class="modal-close is-large" id="close-export" aria-label="close"></button>
</div>
<!-- textbox modal for instructions -->
<div class="modal" id="infoModal">
<div class="modal-background" id="background-info"></div>
<div class="modal-content">
<nav class="panel has-background-white">
<p class="panel-heading poppins">
How-To
</p>
<div class="container" style="padding: 1rem 1.5rem;">
<div class="slideshow">
<div class="mySlides">
<h5 class="title is-5 poppins has-text-info"> Tempo and Time </h5>
<p class="karla">
Tempo is controlled from the Settings panel, either by using the slider
or by inputting a value in the text box. The time signature can also be changed
from the Settings panel by selecting an option from the dropdown menu.
</p>
<img src="https://i.imgur.com/BAgOm7r.png" style="margin-top:20px;">
</div>
<div class="mySlides">
<h5 class="title is-5 poppins has-text-info"> Adding Notes </h5>
<p class="karla">
Notes can be added or removed by clicking on a specific spot
on the staff. You can specify note length and accidental from the
Settings panel. Keep in mind your currently set number of beats per measure!
</p>
<img src="https://i.imgur.com/pgsjZNe.gif">
</div>
<div class="mySlides">
<h5 class="title is-5 poppins has-text-info"> Importing Songs </h5>
<p class="karla">
Using the Import/Export button, you can either copy your music
to your clipboard to send to a friend or import music that someone sent you.
The Preset Songs dropdown allows you to auto-import preset songs.
</p>
<img src="https://i.imgur.com/5wTeVx3.gif" style="margin-top:20px;">
</div>
<div class="mySlides">
<h5 class="title is-5 poppins has-text-info"> Note Logic </h5>
<p class="karla">
Each measure is separated into a number of columns equal to two
times the beats per measure (i.e. 8 columns in 4/4). This enables
you to <strong> assign invisible rests </strong> by skipping columns or
create dotted notes with less gaps.
</p>
<div style="width:100%; text-align:left;">
<img src="https://i.imgur.com/4d4x8pR.png" style="width:48%;margin-right:1%;">
<img src="https://i.imgur.com/2kYqHZS.png" style="width:48%;">
</div>
</div>
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
<div style="text-align:center">
<span class="dot" onclick="currentSlide(1)"></span>
<span class="dot" onclick="currentSlide(2)"></span>
<span class="dot" onclick="currentSlide(3)"></span>
<span class="dot" onclick="currentSlide(4)"></span>
</div>
</div>
</nav>
</div>
<button class="modal-close is-large" id="close-info" aria-label="close"></button>
</div>
<!-- textbox modal for registering new user -->
<div class="modal" id="registerModal">
<div class="modal-background"></div>
<div class="modal-content">
<nav class="panel has-background-white">
<p class="panel-heading poppins">
Register
</p>
<div class="container" style="padding: 1rem 1.5rem;">
<p class="karla has-text-grey">Looks like you haven't created a username yet! Take some time to fill in the field below, and then you'll be able to save your creations.</p></br>
<div class="field is-horizontal">
<div class="field-label is-normal">
<label class="label poppins" for="username">Username</label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<input class="input is-info karla" type="text" id="username" placeholder="Think up something cool!">
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal"></div>
<div class="field-body">
<div class="field">
<div class="control">
<button class="button is-info is-small is-rounded karla gradient" id="registerButton"
onclick="registerUser()">Register</button>
</div>
</div>
</div>
</div>
<div class="field is-horizontal">
<div class="field-label is-normal"></div>
<div class="field-body" id="registerDialog"></div>
</div>
</div>
</nav>
</div>
</div>
<!-- footer -->
<footer class="footer" style="padding-top: 4rem; padding-bottom: 4rem;">
<div class="content has-text-centered">
<p class="karla">
<b>IntelliNote</b> © 2020. Source code available on <a class="has-text-info"
href="https://github.com/thejykim/intellinote"><i class="fab fa-github"></i> GitHub</a>. Built
with <a class="has-text-info" href="https://tonejs.github.io/">Tone.js</a> and <a class="has-text-info"
href="https://bulma.io/">Bulma</a>.
</p>
<p class="karla is-inline-block">
Home to <span class="tag is-normal has-text-weight-medium has-text-white gradient karla" id="totalSongs">
<i class="fas fa-sync-alt fa-pulse"></i>
</span> songs made by people like you.
</p>
<p class="karla is-size-7"><a class="has-text-info" href="privacy.html">Privacy Policy</a> | <a class="has-text-info" href="about.html">About Us</a></p>
</div>
</footer>
<!-- js files -->
<script src="assets/js/globalVars.js"></script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="assets/js/generateSheet.js"></script>
<script src="assets/js/player.js"></script>
<script src="assets/js/noteLogic.js"></script>
<script src="assets/js/timeSig.js"></script>
<script src="assets/js/export.js"></script>
<script src="assets/js/notification.js"></script>
<script src="assets/js/parseTextFromServer.js"></script>
<script src="assets/js/displaySongs.js"></script>
<script src="assets/js/presetSongs.js"></script>
<script src="assets/js/instructions.js"></script>
<script src="assets/js/createSong.js"></script>
<script src="assets/js/login.js"></script>
<script src="assets/js/saveLogic.js"></script>
<script src="assets/js/userMap.js"></script>
<script src="assets/js/contextMenu.js"></script>
<!-- start everything off -->
<script>
window.onload = function () {
isIndex = true;
generateSheet(clefEnum.TREBLE, 'treble-sheet-1');
generateSheet(clefEnum.BASS, 'bass-sheet-1');
setLoginModalJS();
setExportModalJS();
setInfoModalJS();
getTotalSongs();
setupContext();
}
</script>
<!-- cookies -->
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#edeff5",
"text": "#838391"
},
"button": {
"background": "#4b81e8"
}
},
"theme": "classic",
"position": "bottom-left",
"content": {
"message": "Our login system uses cookies so that you don't have to sign in as often.",
"dismiss": "Got it!",
"href": "https://www.intellinote.io/privacy.html"
}
});
</script>
</body>
</html>