-
Notifications
You must be signed in to change notification settings - Fork 0
/
classify-keys.html
166 lines (156 loc) · 9.38 KB
/
classify-keys.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
<html>
<body>
<header class="d-flex flex-wrap justify-content-center py-3 mb-4 border-bottom">
<a href="#" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-dark text-decoration-none">
<span class="fs-4" data-english="Which chord is this?" data-german="Wie heißt der Akkord?"></span>
</a>
<ul class="nav nav-pills">
<!-- <li class="nav-item"><a href="#" class="nav-link active" aria-current="page">Keyboard</a></li> -->
<li class="nav-item"><a class="nav-link" data-english="Settings" data-german="Einstellungen" data-bs-toggle="offcanvas" href="#offcanvasExample" role="button"></a></li>
</ul>
</header>
<svg xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
width="100%" viewBox="1 -2 1400 480" xml:space="preserve">
<!-- the notes represented by a key are coded from 0 (B#, C), 1 (C#, Db) to 11 (B, Cb)-->
<g>
<!-- white keys -->
<rect class="white key" data-keyindex="0" x="2.0"/>
<rect class="white key" data-keyindex="2" x="101.8823242"/>
<rect class="white key" data-keyindex="4" x="201.7651367"/>
<rect class="white key" data-keyindex="5" x="301.6445313"/>
<rect class="white key" data-keyindex="7" x="401.5273438"/>
<rect class="white key" data-keyindex="9" x="501.6308594"/>
<rect class="white key" data-keyindex="11" x="601.5078125"/>
<rect class="white key" data-keyindex="0" x="701.3896484"/>
<rect class="white key" data-keyindex="2" x="801.2675781"/>
<rect class="white key" data-keyindex="4" x="901.1503906"/>
<rect class="white key" data-keyindex="5" x="1001.0292969"/>
<rect class="white key" data-keyindex="7" x="1100.9121094"/>
<rect class="white key" data-keyindex="9" x="1201.015625"/>
<rect class="white key" data-keyindex="11" x="1300.8925781"/>
<!-- black keys (need to be declared after the white keys to render them above the white keys)
They have their notes annotated to add a css class for each accidental,
e.g., note=D ==> add D# and Eb as CSS classes -->
<rect class="black key" data-keyindex="1" x="70.7202148"/>
<rect class="black key" data-keyindex="3" x="171.2246094"/>
<rect class="black key" data-keyindex="6" x="370.5078125"/>
<rect class="black key" data-keyindex="8" x="470.6118164"/>
<rect class="black key" data-keyindex="10" x="570.4882813"/>
<rect class="black key" data-keyindex="1" x="770.0351563"/>
<rect class="black key" data-keyindex="3" x="870.5351563"/>
<rect class="black key" data-keyindex="6" x="1069.8183594"/>
<rect class="black key" data-keyindex="8" x="1169.9228516"/>
<rect class="black key" data-keyindex="10" x="1269.7988281"/>
</g>
</svg>
<table id="solution-options"style="width:100%; font-weight: bold; font-size: large;">
<thead>
<td>6♭</td><td>5♭</td><td>4♭</td><td>3♭</td><td>2♭</td><td>♭</td><td></td><td>♯</td><td>2♯</td><td>3♯</td><td>4♯</td><td>5♯</td><td>6♯</td>
</thead>
<tr class="solution-option key-and-mode" data-mode="major">
<td data-key="0" data-english="G♭"></td>
<td data-key="1" data-english="D♭"></td>
<td data-key="2" data-english="A♭"></td>
<td data-key="3" data-english="E♭"></td>
<td data-key="4" data-english="B♭" data-german="B"></td>
<td data-key="5" data-english="F"></td>
<td data-key="6" data-english="C"></td>
<td data-key="7" data-english="G"></td>
<td data-key="8" data-english="D"></td>
<td data-key="9" data-english="A"></td>
<td data-key="10" data-english="E"></td>
<td data-key="11" data-english="B" data-german="H"></td>
<td data-key="12" data-english="F♯"></td>
</tr>
<tr class="solution-option key-and-mode" data-mode="minor">
<td data-key="0" data-english="e♭"></td>
<td data-key="1" data-english="b♭" data-german="b"></td>
<td data-key="2" data-english="f"></td>
<td data-key="3" data-english="c"></td>
<td data-key="4" data-english="g"></td>
<td data-key="5" data-english="d"></td>
<td data-key="6" data-english="a"></td>
<td data-key="7" data-english="e"></td>
<td data-key="8" data-english="b" data-german="h"></td>
<td data-key="9" data-english="f♯"></td>
<td data-key="10" data-english="c♯"></td>
<td data-key="11" data-english="g♯"></td>
<td data-key="12" data-english="d♯"></td>
</tr>
</table>
<table style="width: 600px; margin: auto;">
<tr class="solution-option inversion">
<td data-inversion="0" data-english="Root position" data-german="Grundstellung"></td>
<td data-inversion="1" data-english="1st inversion" data-german="1. Umkehrung"></td>
<td data-inversion="2" data-english="2nd inversion" data-german="2. Umkehrung"></td>
</tr>
</table>
<button data-english="Next Chord" data-german="Nächster Akkord" id="nextTask" onclick="nextChord()" class="btn-outline-primary"></button>
<div id="stats">
<div class="progress" onclick="if(confirm('Reset?')) resetStats()">
<div class="progress-bar bg-success" role="progressbar" style="width: 70%"><span id="correctAnswers">7</span></div>
<div class="progress-bar bg-danger" role="progressbar" style="width: 30%"><span id="wrongAnswers">3</span></div>
</div>
</div>
<!-- Settings -->
<div class="offcanvas offcanvas-start" tabindex="-1" id="offcanvasExample">
<div class="offcanvas-header">
<h5 class="offcanvas-title" data-english="Settings" data-german="Einstellungen"></h5>
<button class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<div>
<!-- Keys -->
<h5 data-english="Keys" data-german="Tonarten"></h5>
<div>
<span data-english="Up to " data-german="Bis zu "></span>
<span class="range-input-value">6</span>♭
<input type="range" onchange="accidentalRangeChanged(this)" id="input_maxFlats" data-accidental="flat" min="0" max="6" value="6" class="form-range" />
</div>
<div>
<span data-english="Up to " data-german="Bis zu "></span>
<span class="range-input-value">6</span>♯
<input type="range" onchange="accidentalRangeChanged(this)" id="input_maxSharps" data-accidental="sharp" min="0" max="6" value="6" class="form-range" />
</div>
<!-- Modes -->
<div class="list-group mx-0">
<label class="list-group-item">
<input type="checkbox" onchange="modeSelectionChanged()" class="allow-mode form-check-input" data-mode="major"></input>
<span data-english="major" data-german="Dur"></span>
</label>
<label class="list-group-item">
<input type="checkbox" onchange="modeSelectionChanged()" class="allow-mode form-check-input" data-mode="minor"></input>
<span data-english="minor" data-german="moll"></span>
</label>
</div>
</div>
<div class="pt-4">
<!-- Inversions -->
<h5 data-english="Inversions" data-german="Umkehrungen"></h5>
<div class="list-group mx-0">
<label class="list-group-item">
<input type="checkbox" onchange="inversionSelectionChanged()" class="allow-inversion form-check-input" data-inversion="0"></input>
<span data-english="Root position" data-german="Grundstellung"></span>
</label>
<label class="list-group-item">
<input type="checkbox" onchange="inversionSelectionChanged()" class="allow-inversion form-check-input" data-inversion="1"></input>
<span data-english="1st inversion" data-german="1. Umkehrung"></span>
</label>
<label class="list-group-item">
<input type="checkbox" onchange="inversionSelectionChanged()" class="allow-inversion form-check-input" data-inversion="2"></input>
<span data-english="2nd inversion" data-german="2. Umkehrung"></span>
</label>
</div>
</div>
<div class="pt-4">
<!-- Language -->
<h5 data-english="Language" data-german="Sprache"></h5>
<select id="input_language" class="form-select">
<option value="german" data-english="german" data-german="Deutsch"></option>
<option value="english" data-english="english" data-german="Englisch"></option>
</select>
</div>
</div>
</div>
</body>
</html>