-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
333 lines (314 loc) · 16.2 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
<!DOCTYPE html>
<html>
<head>
<title>sentences.101</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- tailwind start -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
spacing: {
'screenshort': "100vmin"
}
}
}
}
</script>
<style type="text/tailwindcss">
@layer utilities {
/* general */
.button { @apply m-2 px-3 py-2 border }
.tab li { @apply p-2 inline-block }
.tab li.hidden { display: none }
.tab li.active { @apply bg-blue-500/20 }
#filebrowser-container .treeview a,
#filebrowser-container .listview a {
@apply cursor-pointer truncate hover:underline
}
#filePathList .active,
#filebrowser-container .active {
@apply text-blue-400
}
dl div {display: flex; justify-content: space-between; gap: 0.7em}
dt, dd {display: inline-block}
dt { @apply decoration-blue-400 }
dd { @apply text-gray-300 }
.mark-comment { @apply block text-gray-500 }
.mark-id { @apply inline-block text-blue-400; margin-right: 1ch }
.mark-path { @apply inline-block underline decoration-2 decoration-green-600 }
.mark-word { @apply inline-block underline decoration-2 decoration-blue-400 }
.mark-mod-all { @apply inline-block underline decoration-2 decoration-amber-500 }
.mark-mod-one { @apply inline-block underline decoration-2 decoration-yellow-300 }
/* phone screen */
.section-collapsed:not(.sidebar) {
height: fit-content !important; /* to override flex-splitter */
}
.section-collapsed > :not(header) {
display: none;
}
div[role="separator"] {
display: none !important /* to override flex-splitter */
}
.section-collapsed button[data-act="toggle"] {
transform: scaleY(-1);
}
/* computer screen */
@media screen(lg) {
.section-collapsed:not(#legend) > :not(header) {
display: flex;
}
div[role="separator"] {
display: flex !important /* to override flex-splitter */
}
}
}
</style>
<!-- tailwind end -->
<!-- flex-splitter: https://luncheon.github.io/flex-splitter-directive/ -->
<link rel="stylesheet" href="flex-splitter.min.css">
<script src="flex-splitter.min.js"></script>
<!-- flex-splitter end -->
<link rel="stylesheet" href="main.css">
<script src="sentences.js"></script>
<script src="handlebars.js"></script>
<script src="ui.js"></script>
</head>
<body class="font-mono bg-gray-900 text-white p-0 transition
flex flex-col
lg:h-screen lg:grid lg:grid-cols-12
gap-2">
<!-- all the icons -->
<svg class="hidden" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" version="1.1"><symbol id="svg-bin" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m5.75 4.25v-2.5h4.5v2.5m-6.5 1v9h8.5v-9m-9.5-.5h10.5"/></symbol><symbol id="svg-chevron-down" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m3.75 5.75 4.25 4.5 4.25-4.5"/></symbol><symbol id="svg-chevron-up" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m12.25 10.25-4.25-4.5-4.25 4.5"/></symbol><symbol id="svg-cog" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><circle cx="8" cy="8" r="1.75"/><path d="m6.75 1.75-.5 1.5-1.5 1-2-.5-1 2 1.5 1.5v1.5l-1.5 1.5 1 2 2-.5 1.5 1 .5 1.5h2.5l.5-1.5 1.5-1 2 .5 1-2-1.5-1.5v-1.5l1.5-1.5-1-2-2 .5-1.5-1-.5-1.5z"/></symbol><symbol id="svg-cross" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m11.25 4.75-6.5 6.5m0-6.5 6.5 6.5"/></symbol><symbol id="svg-download" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m3.25 13.25h9m-8.5-6.5 4 3.5 4-3.5m-4-5v8.5"/></symbol><symbol id="svg-file" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><polygon points="2.75 1.75,8.25 1.75,13.25 6.75,13.25 14.25,2.75 14.25"/><polyline points="7.75 2.25,7.75 7.25,12.75 7.25"/></symbol><symbol id="svg-folder" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><polygon points="1.75 2.75,1.75 13.25,14.25 13.25,14.25 4.75,8.25 4.75,6.75 2.75"/></symbol><symbol id="svg-github" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m5.75 14.25s-.5-2 .5-3c0 0-2 0-3.5-1.5s-1-4.5 0-5.5c-.5-1.5.5-2.5.5-2.5s1.5 0 2.5 1c1-.5 3.5-.5 4.5 0 1-1 2.5-1 2.5-1s1 1 .5 2.5c1 1 1.5 4 0 5.5s-3.5 1.5-3.5 1.5c1 1 .5 3 .5 3"/><path d="m5.25 13.75c-1.5.5-3-.5-3.5-1"/></symbol><symbol id="svg-link-external" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><polyline points="8.25 2.75,2.75 2.75,2.75 13.25,13.25 13.25,13.25 7.75"/><path d="m13.25 2.75-5.5 5.5m3-6.5h3.5v3.5"/></symbol><symbol id="svg-media-play" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><polygon points="2.75 2.75,2.75 13.25,12.25 8"/></symbol><symbol id="svg-menu-hamburger" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m2.75 12.25h10.5m-10.5-4h10.5m-10.5-4h10.5"/></symbol><symbol id="svg-menu-kebab" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><circle cx="8" cy="2.5" r=".75"/><circle cx="8" cy="8" r=".75"/><circle cx="8" cy="13.5" r=".75"/></symbol><symbol id="svg-menu-meatball" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><circle cx="2.5" cy="8" r=".75"/><circle cx="8" cy="8" r=".75"/><circle cx="13.5" cy="8" r=".75"/></symbol><symbol id="svg-minus" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m13.25 7.75h-10.5"/></symbol><symbol id="svg-music" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><circle cx="4" cy="12" r="2.25"/><circle cx="12" cy="11" r="2.25"/><polyline points="6.25 12,6.25 2.75,14.25 1.75,14.25 11"/></symbol><symbol id="svg-pencil" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><polygon points="1.75 11.25,1.75 14.25,4.75 14.25,14.25 4.75,11.25 1.75"/><line x1="8.75" y1="4.75" x2="11.25" y2="7.25"/></symbol><symbol id="svg-plus" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="m12.75 7.75h-10m5-5v10"/></symbol><symbol id="svg-square" width="16px" height="16px" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><rect height="10.5" width="10.5" y="2.75" x="2.75"/></symbol></svg>
<aside class="sidebar col-span-2 p-2 bg-gray-800 section-collapsed
lg:h-full flex flex-col">
<header class="p-2 -m-2 bg-gray-700">
<button data-act="toggle" class="inline-block lg:hidden">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-menu-hamburger"/>
</svg>
</button>
<h2 class="text-lg inline-block">sentences.101</h2>
</header>
<nav class="mt-2 flex-grow flex lg:flex-col justify-between gap-2">
<form id="sidebar-settings">
<ul class="topmenu flex flex-row lg:flex-col gap-2">
<li class="bold lg:mb-2 flex-shrink-0">Games
<ul id="sound-paths" class="submenu">
<!--
<li><label><input type="checkbox" id="soundPath" value="valve_sound" checked readonly> Half-Life</label>
<li><label><input type="checkbox" id="soundPath" value="gearbox_sound" disabled> Opposing Force</label>
<li><label><input type="checkbox" id="soundPath" value="bshift_sound" disabled> Blue Shift</label>
-->
</ul>
</li>
<li class="bold lg:mb-2 flex-shrink-0">Settings
<ul class="submenu">
<li><label><input type="checkbox" name="logonspeak" checked> Welcome speak</label>
<li><label><input type="checkbox" name="historyEnable" checked> Auto-add history</label>
<li><label><input type="checkbox" name="fileAutoPlay" checked> Auto-play files</label>
<li><label><input type="checkbox" name="txtWordWrap" checked> Word-wrap</label>
<li class="separator">
<li><button type="button" class="button" onclick="doClearAudioCache(e)">Clear audio cache</button>
</ul>
</li>
</ul>
</form>
<div>
<a href="https://github.com/mfaizsyahmi/sentences.101" target="_blank">
Github
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-github"/>
</svg>
</a>
</div>
</nav>
</aside>
<main id="v-c" class="col-span-5
flex flex-col gap-2 lg:gap-0
lg:h-screen lg:overflow-hidden"
data-flex-splitter-vertical>
<section id="section-input" class="flex flex-col lg:h-1/3">
<header class="p-2 bg-gray-700 flex gap-2">
<button data-act="toggle" class="inline-block lg:hidden">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-chevron-up"/>
</svg>
</button>
<h2 class="text-lg inline-block">speak</h2>
<div class="flex-grow">
<img id="speak-icon" title="Speaking..." alt="Speaking..."
class="hidden inline-block w-6 h-6 align-middle" src="icons/voiceicon_trans.png">
<img id="loading-icon" title="Media is loading..." alt="Media loading..."
class="hidden inline-block align-middle" src="icons/moths.webp">
</div>
</header>
<form class="flex-grow flex flex-col w-full" onsubmit="doSpeak(event)">
<textarea id="sentences"
class="flex-grow w-full h-48 lg:h-auto resize-none bg-gray-900 text-gray-200 border border-gray-500 p-2"
>doop (e95 p103) doctor freeman, (e95) to(e70) anomalous materials test lab immediately(e100)</textarea>
<div class="flex flex-wrap justify-between">
<div class="self-center m-2 align-middle justify-between">
Volume:
<input id="vol" class="align-middle" type="range"
min="0" max="100" value="100" oninput="doAdjustVolume(event)"/>
</div>
<div class="flex-shrink-0 mr-2 lg:m-0">
<button type="submit" class="m-2 mr-0 px-3 py-2 border" id="play">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-media-play"/>
</svg>
Play
</button><!--
--><button type="button" class="m-2 mr-0 px-3 py-2 border" id="stop"
onclick="doStop()">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-square"/>
</svg>
Stop
</button><!--
--><button type="button" class="m-2 mr-0 px-3 py-2 border" id="download"
title="Download sentence"
onclick="doDownloadSpeech(event)">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-download"/>
</svg>
</button>
</div>
</div>
</form>
</section>
<div role="separator" class="hidden lg:block"></div>
<section id="section-history" class="lg:h-2/3">
<header class="p-2 bg-gray-700 flex items-stretch">
<button data-act="toggle" class="inline-block lg:hidden">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-chevron-up"/>
</svg>
</button>
<h2 class="text-lg flex-grow">history</h2>
<button class="px-2 ml-2" onclick="doAddHistory(event)"
title="Save current sentence">Save</button>
<button class="px-2 ml-2" onclick="doClearHistory(event)"
title="Clear history">Clear</button>
</header>
<div id="history" class="flex flex-col">
<script type="text/x-handlebars-template" id="sentence-history-template">
<div class="flex items-center border border-t-0 border-gray-700 p-2">
<div class="flex-grow max-h-24 overflow-auto">{{text}}</div>
<button data-act="insert" class="m-2 mr-0 px-3 py-1 text-lg border"
title="add to the speak textbox">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-pencil"/>
</svg>
</button>
<button data-act="remove" class="m-2 mr-0 px-3 py-1 text-lg border"
title="remove from history">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-bin"/>
</svg>
</button>
</div>
</script>
</div>
</section>
</main>
<aside id="v-r" class="files col-span-5
flex flex-col gap-2
lg:h-screen lg:overflow-hidden">
<section id="section-filebrowser" class="flex-grow flex-shrink flex flex-col">
<header class="p-2 bg-gray-700 flex">
<button data-act="toggle" class="inline-block lg:hidden">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-chevron-up"/>
</svg>
</button>
<h2 class="text-lg flex-grow">files</h2>
<div id="previewing" class="hidden">
<audio id="audioPreview" class="hidden" onended="stopPreview()"></audio>
<img title="Playing sound..." alt="Playing sound..."
class="inline-block w-6 h-6 align-middle" src="icons/voiceicon_trans.png">
<button class="px-2" onclick="stopPreview()">Stop</button>
</div>
</header>
<ul class="tab bg-gray-700 flex" id="filePathList">
<!-- <li>valve/sound</li> -->
</ul>
<div class="flex-initial flex gap-2 lg:gap-0"
style="height: 0; flex-grow: 1; flex-shrink: 1;"
data-flex-splitter-vertical>
<div id="filebrowser-container" class="overflow-hidden h-40 lg:h-1/2">
<!-- folder viwes here -->
</div>
<div role="separator" class="hidden lg:block"></div>
<div id="section-txt" class="border border-gray-500 lg:h-1/2">
<!-- // TODO: sentences.txt files here -->
</div>
</div>
</section>
<section id="legend" class="h-fit ">
<header class="p-2 bg-gray-700 flex">
<button data-act="toggle" class="inline-block">
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-chevron-up"/>
</svg>
</button>
<h2 class="text-lg inline-block flex-grow">reference</h2>
<a href="https://twhl.info/wiki/page/Sentences.txt" target="_blank">
twhl.info
<svg class="icon " viewBox="0 0 16 16">
<use xlink:href="#svg-link-external"/>
</svg>
</a>
</header>
<div class="p-2 border border-gray-700 flex flex-col md:flex-row md:gap-2">
<dl>
<!-- <div><dt>hgrunt/clik clik oh! shit! clik</dt></div> -->
<div>
<dt class="mark-path">hgrunt/</dt>
<dd>Switch folder (default: vox/)</dd>
</div>
<div>
<dt><span class="mark-word">oh!</span> <span class="mark-word">shit!</span></dt>
<dd>Play files (no .wav)</dd>
</div>
<div>
<dt class="mark-mod-all">(p110 t40)</dt>
<dd>global modifier</dd>
</div>
<div>
<dt>
<span class="mark-word"><name></span><span class="mark-mod-one">(t30)</span>
</dt>
<dd>local modifier</dd>
</div>
</dl>
<dl>
<div>
<dt>s</dt>
<dd>start (0-100, def. 0)</dd>
</div>
<div>
<dt>e</dt>
<dd>end (0-100, def. 100)</dd>
</div>
<div>
<dt>v</dt>
<dd>volume (0-100, def. 100)</dd>
</div>
<div>
<dt>p</dt>
<dd>pitch (0-255, def. 100)</dd>
</div>
<div>
<dt>t</dt>
<dd>time compression (0-100, def. 0)</dd>
</div>
</dl>
</div>
</section>
</aside>
<script src="main.js"></script>
</body>
</html>