-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
334 lines (293 loc) · 15.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>VizHap :: SCI_LAB</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Sharp|Material+Icons+Two+Tone|Material+Icons+Outlined" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="fonts/icomoon/style.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link href="css/style.css" media="screen and (min-width: 512px) and (max-width: 1024px)" rel="stylesheet">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- Style -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<script>
// 다중메뉴 - 한번에 하나만 보여주기 & 오디오 인풋 들어오면 보여주기
function change(box, delimiter) {
target = document.getElementById('thefile');
let OtherOption;
if(delimiter=='customMenu-Line'){
OtherOption = 'customMenu-Ring'
document.getElementById('check-VisuoRing').checked = false;
}else if(delimiter=='customMenu-Ring'){
OtherOption = 'customMenu-Line'
document.getElementById('check-VisuoLine').checked = false;
}
if (target.files.length == 1){
if (box.checked == true) {
document.getElementById(delimiter).style.display = "inline-block";
document.getElementById(OtherOption).style.display = "none";
} else {
document.getElementById(delimiter).style.display = "none";
}
}
};
// 단일메뉴 - 그냥 클릭하면 보여주기 & 오디오 인풋 들어오면 보여주기
function check(box, delimiter) {
target = document.getElementById('thefile');
if (target.files.length == 1){
if (box.checked == true) {
document.getElementById(delimiter).style.display = "inline-block";
} else {
document.getElementById(delimiter).style.display = "none";
}
}
};
// 시각 하이라이트(강조)
function highlight_visual(box, delimiter) {
let OtherOption;
if(delimiter=='active-line'){
OtherOption = 'active-ring'
}else if(delimiter=='active-ring'){
OtherOption = 'active-line'
}
if (box.checked == true) {
document.getElementById(delimiter).style.color = "rgba(255, 52, 91)";
document.getElementById(delimiter).style.fontWeight = "600";
document.getElementById(OtherOption).style.backgroundColor = "rgba(0, 0, 0, 0)";
document.getElementById(OtherOption).style.color = "#8b8b8b";
} else {
document.getElementById(delimiter).style.backgroundColor = "rgba(0, 0, 0, 0)";
document.getElementById(delimiter).style.color = "#8b8b8b";
}
}
// 햅틱 하이라이트(강조)
function highlight_haptic(box, delimiter) {
if (box.checked == true) {
document.getElementById(delimiter).style.color = "rgba(255, 52, 91)";
document.getElementById(delimiter).style.fontWeight = "600";
} else {
document.getElementById(delimiter).style.backgroundColor = "rgba(0, 0, 0, 0)";
document.getElementById(delimiter).style.color = "#8b8b8b";
}
}
</script>
<aside class="sidebar">
<div class="toggle">
<a href="#" class="burger js-menu-toggle" data-toggle="collapse" data-target="#main-navbar">
</a>
</div>
<div class="side-inner">
<div class="profile">
<img src="images/cutecat.jpeg" alt="Image" class="img-fluid">
<h3 class="name">User#01</h3>
<span class="identity">Deaf</span>
</div>
<div id="sidebar-content">
<label for="thefile" class="file"> Pick a Music 🎺
<input type="file" id="thefile" accept="audio/mp3" />
</label>
<audio id="audio" controls></audio>
<div class="thetitle" id="title"></div>
</div>
<div class="nav-menu">
<ul>
<li class="accordion">
<hr>
<p id="VisuoMenu" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne" class="collapsible">
<!-- <a href="#" id="VisuoMenu" data-toggle="collapse" data-target="#collapseOne" aria-expanded="false" aria-controls="collapseOne" class="collapsible"> -->
<span class="material-icons" style="font-size:25px; vertical-align: top;">palette</span> Visualization
<!-- </a> -->
</p>
<div id="collapseOne" class="collapse" aria-labelledby="headingOne">
<div>
<ul>
<li type="button" class="VisuoMenus" id="VisuoLine">
<input class="check-btn" id="check-VisuoLine" type="checkbox" onclick="change(this, 'customMenu-Line'); highlight_visual(this, 'active-line');">
<label for="check-VisuoLine"> <div id="active-line">Line</div> </label>
</li>
<!-- <li type="button" class="VisuoMenus" id="VisuoSphere">
<input class="check-btn" id="check-VisuoSphere" type="checkbox" onclick="check(this, 'customMenu-Sphere'); highlight(this, 'active-sphere');">
<label for="check-VisuoSphere"> <div id="active-sphere">Sphere</div> </label>
</li> -->
<li type="button" class="VisuoMenus" id="VisuoRing">
<input class="check-btn" id="check-VisuoRing" type="checkbox" onclick="change(this, 'customMenu-Ring'); highlight_visual(this, 'active-ring');">
<label for="check-VisuoRing"> <div id="active-ring">Ring</div> </label>
</li>
<!-- <li type="button" class="VisuoMenus" id="VisuoTorus">
<input class="check-btn" id="check-VisuoTorus" type="checkbox" onclick="check(this, 'customMenu-Torus'); highlight(this, 'active-torus');">
<label for="check-VisuoTorus"> <div id="active-torus">Torus</div> </label>
</li>
<li type="button" class="VisuoMenus" id="VisuoCone">
<input class="check-btn" id="check-VisuoCone" type="checkbox" onclick="check(this, 'customMenu-Cone'); highlight(this, 'active-cone');">
<label for="check-VisuoCone"> <div id="active-cone">Cone</div> </label>
</li> -->
</ul>
</div>
</div>
</li>
<br>
<li class="accordion">
<p id="HapticMenu" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo" class="collapsible">
<span class="material-icons" style="font-size:25px; vertical-align: top;">vibration</span> Haptic </p>
<div id="collapseTwo" class="collapse" aria-labelledby="headingOne">
<div>
<ul>
<li type="button" class="HapticMenus">
<input class="check-btn" id="check-Haptic" type="checkbox" onclick="check(this, 'hapticCustom'); highlight_haptic(this, 'active-haptic');">
<label for="check-Haptic"> <div id="active-haptic">Pattern Filter</div> </label>
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
</aside>
<div id="userCustom">#000000</div>
<div class="customMenu">
<div class="visualCustomMenu" id="customMenu-Line">
<h5 class="menuTitle">Line Visualization</h5>
<hr class="menuTitleHR_visual">
<p id="menusmallTitle_visual"> Pitch </p>
<button class="pitchMenu" id="pitchLineHeight"> Line Height </button>
<button class="pitchMenu" id="pitchLineThickness"> Line Thickness </button>
<button class="pitchMenu" id="pitchLineType"> Line Type </button>
<br>
<p id="menusmallTitle_visual"> Dynamics </p>
<button class="dynamicMenu" id="dynamicLineHeight"> Line Height </button>
<button class="dynamicMenu" id="dynamicLineThickness"> Line Thickness </button>
<button class="dynamicMenu" id="dynamicLineColor"> Line Color </button>
<br>
<p id="menusmallTitle_visual" class="bgcolor"> Background </p>
<button class="visualButtonColors" type="button"> Colors </button>
</div>
<div class="visualCustomMenu" id="customMenu-Sphere">
<h5 class="menuTitle">Sphere Visualization</h5>
<hr class="menuTitleHR_visual">
<p id="menusmallTitle_visual"> Pitch </p>
<button class="pitchMenu" id="pitchSphereSize"> Sphere Size </button>
<button class="pitchMenu" id="pitchSphereHeight"> Sphere Height </button>
<button class="pitchMenu" id="pitchSphereColor"> Sphere Color </button>
<br>
<p id="menusmallTitle_visual"> Dynamics </p>
<button class="dynamicMenu" id="dynamicSphereSize"> Sphere Size </button>
<button class="dynamicMenu" id="dynamicSpherePhiLength"> Sphere PhiLength </button>
<button class="dynamicMenu" id="dynamicSphereThetaStart"> Sphere ThetaStart </button>
<br>
<p id="menusmallTitle_visual" class="bgcolor"> Background </p>
<button class="visualButtonColors" type="button"> Colors </button>
</div>
<div class="visualCustomMenu" id="customMenu-Ring">
<h5 class="menuTitle">Ring Visualization</h5>
<hr class="menuTitleHR_visual">
<p id="menusmallTitle_visual"> Pitch </p>
<button class="pitchMenu" id="pitchRingThickness"> Ring Thickness </button>
<button class="pitchMenu" id="pitchRingSize"> Ring Size </button>
<button class="pitchMenu" id="pitchRingType"> Ring Type </button>
<br>
<p id="menusmallTitle_visual"> Dynamics </p>
<button class="dynamicMenu" id="dynamicRingThickness"> Ring Thickness </button>
<button class="dynamicMenu" id="dynamicRingSize"> Ring Size </button>
<button class="dynamicMenu" id="dynamicRingType"> Ring Type </button>
<br>
<p id="menusmallTitle_visual" class="bgcolor"> Background </p>
<button class="visualButtonColors" type="button"> Colors </button>
</div>
</div>
<main>
<!--시각 output-->
<div class="visual-container">
<div id="canvas">
</div>
</div>
<!-- 햅틱 output -->
<div id="demo">
<div id="waveform">
</div>
</div>
<div id="music-controls">
<br>
<button class="btn btn-primary" data-action="play">
<i class="glyphicon glyphicon-play"></i>
Play
/
<i class="glyphicon glyphicon-pause"></i>
Pause
</button>
<button class="btn btn-success" data-action="toHaptic">
Select Instruments & toHaptic
</button>
<button class="btn btn-info" data-action="SearchHapticDevice">
SearchHapticDevice
</button>
<button class="btn btn-info" data-action="SendHapticPattern">
<i class="glyphicon glyphicon-play"></i>
SendHapticPattern
</button>
<!-- <button class="btn btn-info" data-action="DisconnectHapticDevice">
<i class="glyphicon glyphicon-stop"></i>
DisconnectHapticDevice
</button> -->
</div>
<div class="haptic-container">
<div class="customMenu">
<div class="hapticCustomMenu" id="hapticCustom">
<div class="haptic-controls">
<h5 class="menuTitle"> Haptic Pattern Filter </h5>
<br>
<p id="menusmallTitle_haptic"> Tempo </p>
<div class="haptic-tempo">
<input data-action="tempo" type="range" min="0" max="100" value="70" style="width: 100%" />
← Empty
Full vibration →
</div>
<br>
<p id="menusmallTitle_haptic"> Frequency </p>
<div class="haptic-frequency">
<input data-action="frequency" type="range" min="0" max="100" value="50" style="width: 100%"/>
← Rough
Sharp →
</div>
<br>
<p id="menusmallTitle_haptic"> Amplitude </p>
<div class="haptic-amplitude">
<input data-action="amplitude" type="range" min="0" max="100" value="20" style="width: 100%"/>
← Sharp
Strong →
</div>
<br>
<p id="menusmallTitle_haptic"> Timbre </p>
<div class="haptic-timbre">
<input data-action="symmetry" type="range" min="0" max="100" value="30" style="width: 100%" />
← Asymmetry
Symmetry →
</div>
</div>
</div>
</div>
</div>
</main>
<!-- Javascript -->
<script type="module" defer src="./js/main.js"></script>
<script type="module" defer src="./js/showCanvas.js"></script>
<script src="https://unpkg.com/wavesurfer.js/dist/wavesurfer.js"></script>
<script src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.minimap.js"></script>
<script src="https://unpkg.com/meyda/dist/web/meyda.min.js"></script>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrapmain.js"></script>
</body>
</html>