forked from DanRuta/xVA-Synth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
446 lines (430 loc) · 26.7 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>xVA Synth</title>
</head>
<link rel="stylesheet" type="text/css" href="style.css">
<style id="cssHack">
::selection {
background: gray;
}
::-webkit-scrollbar-thumb {
background: rgba(218,142,58, 0.5) !important;
}
a {
color: rgba(218,142,58);;
}
</style>
<style id="css_hack_pitch_editor">.slider::-webkit-slider-thumb {height: 50px;}</style>
<body>
<div id="chrome">
<div id="dragBar">xVA Synth</div>
<div id="chromeActions">
<div id="chromeMin">🗕</div>
<div id="chromeMax">🗖</div>
<div id="chromeQuit">✖</div>
</div>
</div>
<div id="appcontent">
<div id="left">
<div class="top" id="topLeft">
<div id="selectedGameDisplay"></div>
<button id="changeGameButton">⇄</button>
</div>
<div id="searchContainer">
<input type="text" id="voiceSearchInput" name="" placeholder="Search voices...">
</div>
<div class="content">
<div id="voiceTypeContainer"></div>
</div>
</div>
<div id="right">
<div id="rightBG1"></div>
<div id="rightBG2"></div>
<div id="topRight" class="top">
<span></span>
<div id="title">Select Voice Type</div>
<svg style="display:none;" id="cogButton" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
<path fill="black" stroke="white" stroke-width="3" d="M47.16,21.221l-5.91-0.966c-0.346-1.186-0.819-2.326-1.411-3.405l3.45-4.917c0.279-0.397,0.231-0.938-0.112-1.282 l-3.889-3.887c-0.347-0.346-0.893-0.391-1.291-0.104l-4.843,3.481c-1.089-0.602-2.239-1.08-3.432-1.427l-1.031-5.886 C28.607,2.35,28.192,2,27.706,2h-5.5c-0.49,0-0.908,0.355-0.987,0.839l-0.956,5.854c-1.2,0.345-2.352,0.818-3.437,1.412l-4.83-3.45 c-0.399-0.285-0.942-0.239-1.289,0.106L6.82,10.648c-0.343,0.343-0.391,0.883-0.112,1.28l3.399,4.863 c-0.605,1.095-1.087,2.254-1.438,3.46l-5.831,0.971c-0.482,0.08-0.836,0.498-0.836,0.986v5.5c0,0.485,0.348,0.9,0.825,0.985 l5.831,1.034c0.349,1.203,0.831,2.362,1.438,3.46l-3.441,4.813c-0.284,0.397-0.239,0.942,0.106,1.289l3.888,3.891 c0.343,0.343,0.884,0.391,1.281,0.112l4.87-3.411c1.093,0.601,2.248,1.078,3.445,1.424l0.976,5.861C21.3,47.647,21.717,48,22.206,48 h5.5c0.485,0,0.9-0.348,0.984-0.825l1.045-5.89c1.199-0.353,2.348-0.833,3.43-1.435l4.905,3.441 c0.398,0.281,0.938,0.232,1.282-0.111l3.888-3.891c0.346-0.347,0.391-0.894,0.104-1.292l-3.498-4.857 c0.593-1.08,1.064-2.222,1.407-3.408l5.918-1.039c0.479-0.084,0.827-0.5,0.827-0.985v-5.5C47.999,21.718,47.644,21.3,47.16,21.221z M25,32c-3.866,0-7-3.134-7-7c0-3.866,3.134-7,7-7s7,3.134,7,7C32,28.866,28.866,32,25,32z"></path>
</svg>
</div>
<div class="content">
<div id="description"></div>
<textarea id="dialogueInput" placeholder="Type your text here..."></textarea>
<div id="buttonContainer">
<button style="display:none;" id="keepSampleButton">Keep sample</button>
<div style="display:none;" id="spinner" class="spinner"></div>
<div id="samplePlay" style="display:none;width: 150px;"></div>
<button id="generateVoiceButton" disabled>Generate Voice</button>
</div>
<div id="adv">
<div id="editorContainer">
<div id="editor"></div>
</div>
<div id="editorTooltip"></div>
<div id="adv_opts">
<div>
<div>
<span>Length:</span>
<input id="letterLength" disabled="true" type="range" name="length" min="0.1" step="0.1" max="20">
<input id="letterLengthNumb" disabled="true" type="number" name="lengthNum" min="0.1" step="0.1" max="15">
</div>
<div>
<span>Pitch:</span>
<input id="letterPitchNumb" disabled="true" type="number" name="lengthNum" min="-3" step="0.1" max="3">
</div>
<button id="resetLetter_btn">Reset Letter</button>
<div>
<span>Auto regenerate:</span>
<input id="autoplay_ckbx" type="checkbox" name="">
</div>
<div>
<span>Vocoder:</span>
<select id="vocoder_select">
<option value="256_waveglow">WaveGlow</option>
<option value="big_waveglow">Big WaveGlow</option>
<option value="qnd">Quick-and-dirty</option>
</select>
<span id="bespoke_hifi_bolt">🗲</span>
</div>
</div>
<div>
<button id="reset_btn">Reset</button>
<button id="amplify_btn">Amplify</button>
<button id="flatten_btn">Flatten</button>
<button id="increase_btn">Increase</button>
<button id="decrease_btn">Decrease</button>
<div>
<span>Pacing:</span>
<input id="pace_slid" type="range" name="length" min="0.5" step="0.01" max="2" value="1">
</div>
</div>
</div>
</div>
<div id="voiceSamples"></div>
</div>
</div>
<div id="settingsContainer" style="display:none">
<div class="modal">
<h2>Settings</h2>
<div id="settingsOptionsContainer" class="flexTable">
<div>
<div>Use GPU (requires CUDA)</div>
<div>
<input id="useGPUCbx" type="checkbox" name="">
</div>
</div>
<div>
<div>Autoplay generated audio</div>
<div>
<input id="setting_autoplaygenCbx" type="checkbox" name="">
</div>
</div>
<div>
<div>Default to loading the HiFi vocoder on voice change, if available</div>
<div>
<input id="setting_defaultToHiFi" type="checkbox" name="">
</div>
</div>
<div>
<div>Keep the same pacing value on new text generations</div>
<div>
<input id="setting_keepPaceOnNew" type="checkbox" name="">
</div>
</div>
<div>
<div>Show the sliders tooltip</div>
<div>
<input id="setting_slidersTooltip" type="checkbox" name="">
</div>
</div>
<div>
<div>Dark mode text prompt</div>
<div>
<input id="setting_darkprompt" type="checkbox" name="">
</div>
</div>
<hr style="width:100%">
<div>
<div>Use ffmpeg post-processing (requires ffmpeg >=4.3)</div>
<div>
<input id="setting_audio_ffmpeg" name="" type="checkbox">
</div>
</div>
<div>
<div>Audio format (wav, mp3, etc)</div>
<div>
<input id="setting_audio_format" name="" placeholder="wav">
</div>
</div>
<div>
<div>Audio sample rate (Hz)</div>
<div>
<input id="setting_audio_hz" name="" placeholder="22050">
</div>
</div>
<div>
<div>Silence padding start (ms)</div>
<div>
<input id="setting_audio_pad_start" name="" placeholder="0">
</div>
</div>
<div>
<div>Silence padding end (ms)</div>
<div>
<input id="setting_audio_pad_end" name="" placeholder="0">
</div>
</div>
<div>
<div>Audio bit depth</div>
<div>
<select id="setting_audio_bitdepth">
<option value="pcm_s16le">pcm_s16le</option>
<option value="pcm_s32le">pcm_s32le</option>
</select>
</div>
</div>
<div>
<div>Amplitude multiplier</div>
<div>
<input id="setting_audio_amplitude" name="" placeholder="1">
</div>
</div>
<hr style="width:100%">
<div>
<div>Use fast mode for Batch synth</div>
<div>
<input id="setting_batch_fastmode" type="checkbox" name="">
</div>
</div>
<hr style="width:100%">
<div id="setting_models_path_container">
<div id="setting_models_path_label"></div>
<div>
<input id="setting_models_path_input" name="">
</div>
</div>
<div id="setting_out_path_container" style="display: none">
<div id="setting_out_path_label"></div>
<div>
<input id="setting_out_path_input" name="">
</div>
</div>
</div>
<div id="app_version">v1.0.0</div>
</div>
</div>
<div id="updatesContainer" style="display:none">
<div class="modal">
<div id="updatesVersions">This app version: 1.0.0</div>
<div>Updates log:</div>
<div id="updatesLogList">
</div>
<button id="checkUpdates">Check for updates now</button>
</div>
</div>
<div id="infoContainer" style="display:none">
<div class="modal">
<h2>App info</h2>
For instructions on how to use the app, please watch <a href="https://www.youtube.com/watch?v=xqJ-ujWvu7s">this short video</a> showcase on YouTube.
<hr>
<div>Keyboard shortcuts reference</div>
<div class="flexTable">
<div>
<div>Enter</div>
<div>Generate the audio</div>
</div>
<div>
<div>Escape</div>
<div>Close modals and menus</div>
</div>
<div>
<div>Space</div>
<div>Bring focus to the input textarea</div>
</div>
<div>
<div>Ctrl+S</div>
<div>Keep sample</div>
</div>
<div>
<div>Ctrl+Shift-S</div>
<div>Keep sample (but with naming prompt)</div>
</div>
<div>
<div>Y/N</div>
<div>Yes/No options in prompt modals</div>
</div>
<div>
<div>Left/Right arrows:</div>
<div>Move left/right along which letter is focused</div>
</div>
<div>
<div>Shift-Left/Right arrows:</div>
<div>Create multi-letter selection range</div>
</div>
<div>
<div>Up/Down arrows:</div>
<div>Move pitch up/down for the letter(s) selected</div>
</div>
<div>
<div>Ctrl+Left/Right arrows:</div>
<div>Move the sequence-wide pacing slider</div>
</div>
<div>
<div>Ctrl+Up/Down arrows:</div>
<div>Pitch increase/decrease buttons</div>
</div>
<div>
<div>Ctrl+Shift+Up/Down arrows:</div>
<div>Pitch amplify/flatten buttons</div>
</div>
</div>
</div>
</div>
<div id="gameSelectionContainer" style="display:none">
<div class="modal">
<div>
<input id="searchGameInput" placeholder="Search games...">
</div>
<div id="gameSelectionListContainer"></div>
</div>
</div>
<div id="batchGenerationContainer" style="display:none">
<div class="modal">
<h2>Batch synthesis</h2>
<div id="batch_container">
<div id="batch_intro">
<div>
<span>Batch size:</span>
<input type="number" id="batch_batchSizeInput" value="1" placeholder="1" min="1" step="1">
</div>
<div>Place the .csv batch file(s) into the box below. Click the "Generate sample" button to generate an example .csv file. The mandatory columns are "game_id", "voice_id", and "text". The rest are optional.</div>
<div>
<button id="batch_generateSample">Generate Sample</button>
</div>
</div>
<div id="batch_main">
<span id="batchDropZoneNote">Drag and drop .csv files here</span>
<div id="batchRecordsHeader" style="display: none;">
<div>#</div>
<div>Status</div>
<div>Game</div>
<div>Voice</div>
<div>Text</div>
<div>Vocoder</div>
<div>Out Path</div>
<div>Pacing</div>
</div>
<div id="batchRecordsContainer">
</div>
</div>
<div id="batch_footer">
<div style="max-height: 35px;display: flex;justify-content: center;">
<input type="text" id="batch_outputFolderInput">
<div style="display: none;" id="batch_progressBar"></div>
</div>
<div id="batch_out_opts">
<span></span>
<span id="batch_clearDirOpts">
<input type="checkbox" id="batch_clearDirFirstCkbx">
<span>Clear out the directory first</span>
</span>
<span id="batch_skipExistingOpts">
<input type="checkbox" id="batch_skipExisting">
<span>Skip existing output</span>
</span>
<span style="display:none" id="batch_progressItems">
<span id="batch_progressNotes">currently doing...</span>
</span>
</div>
<div>
<button style="display: none;" id="batch_synthesizeBtn">Synthesize Batch</button>
<button style="display: none;" id="batch_pauseBtn">Pause</button>
<button style="display: none;" id="batch_stopBtn">Stop</button>
<button style="display: none;" id="batch_clearBtn">Clear</button>
<button id="batch_openDirBtn">Open Output</button>
</div>
</div>
</div>
</div>
</div>
<div id="modalContainer" style="display:none"></div>
</div>
</div>
<div id="batchIcon">
<svg id="batchSVGIcon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="25" viewBox="0, 0, 400,310.24930747922434"><g id="svgg"><path id="path0" d="M5.549 99.446 C 5.515 149.266,5.829 215.831,6.246 247.368 L 7.004 304.709 198.516 304.709 L 390.028 304.709 390.028 157.523 L 390.028 10.338 282.825 9.602 C 223.864 9.197,137.371 8.865,90.617 8.865 L 5.611 8.864 5.549 99.446 M107.479 67.590 L 107.479 97.507 70.914 97.507 L 34.349 97.507 34.349 67.590 L 34.349 37.673 70.914 37.673 L 107.479 37.673 107.479 67.590 M362.327 67.590 L 362.327 97.507 249.307 97.507 L 136.288 97.507 136.288 67.590 L 136.288 37.673 249.307 37.673 L 362.327 37.673 362.327 67.590 M107.479 157.341 L 107.479 187.258 70.914 187.258 L 34.349 187.258 34.349 157.341 L 34.349 127.424 70.914 127.424 L 107.479 127.424 107.479 157.341 M362.327 157.341 L 362.327 187.258 249.307 187.258 L 136.288 187.258 136.288 157.341 L 136.288 127.424 249.307 127.424 L 362.327 127.424 362.327 157.341 M107.479 247.091 L 107.479 277.008 70.914 277.008 L 34.349 277.008 34.349 247.091 L 34.349 217.175 70.914 217.175 L 107.479 217.175 107.479 247.091 M362.327 247.091 L 362.327 277.008 249.307 277.008 L 136.288 277.008 136.294 257.895 C 136.297 247.382,136.621 233.920,137.015 227.978 L 137.730 217.175 250.029 217.175 L 362.327 217.175 362.327 247.091 " stroke="none" fill="#ffffff" fill-rule="evenodd"></path></g></svg>
</div>
<div id="updatesIcon">
<svg id="update_nothing" version="1.0" xmlns="http://www.w3.org/2000/svg"
width="25.000000pt" height="25.000000pt" viewBox="0 0 250.000000 344.000000"
preserveAspectRatio="xMidYMid meet"><g transform="translate(300.000000,344.000000) scale(0.100000,-0.100000) rotate(90 0 0)"
fill="#ffffff" stroke="none"><path d="M2150 2507 l0 -357 -875 0 c-950 0 -901 3 -955 -55 l-25 -27 0 -348
0 -348 25 -27 c54 -58 5 -55 955 -55 l875 0 0 -357 0 -358 572 573 573 572
-573 572 -572 573 0 -358z"/></g></svg>
<svg id="update_something" style="display: none;" version="1.0" xmlns="http://www.w3.org/2000/svg"
width="50.000000pt" height="25.000000pt" viewBox="0 0 250.000000 344.000000"
preserveAspectRatio="xMidYMid meet"><g transform="translate(300.000000,344.000000) scale(0.100000,-0.100000) rotate(90 0 0)"
fill="#ff9800" stroke="none"><path d="M2150 2507 l0 -357 -875 0 c-950 0 -901 3 -955 -55 l-25 -27 0 -348
0 -348 25 -27 c54 -58 5 -55 955 -55 l875 0 0 -357 0 -358 572 573 573 572
-573 572 -572 573 0 -358z"/></g></svg>
</div>
<div id="patreonIcon">
<img src="./assets/patreon.png">
</div>
<div id="infoIcon">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1024.000000pt" height="1024.000000pt" viewBox="0 0 1024.000000 1024.000000" preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,1024.000000) scale(0.100000,-0.100000)" fill="#ffffff" stroke="none"><path d="M4920 9273 c-776 -41 -1504 -285 -2137 -715 -72 -49 -192 -137 -265 -196 -171 -136 -504 -469 -640 -639 -514 -646 -816 -1390 -899 -2218 -16 -155 -16 -615 0 -770 84 -830 387 -1575 905 -2225 131 -164 467 -499 634 -632 962 -766 2166 -1066 3378 -843 652 121 1287 413 1824 841 174 138 506 470 644 644 794 997 1091 2288 810 3525 -267 1174 -1048 2190 -2119 2756 -644 340 -1416 511 -2135 472z m640 -658 c708 -97 1329 -373 1855 -825 128 -110 355 -346 458 -475 851 -1069 1008 -2537 403 -3755 -182 -365 -370 -625 -670 -926 -233 -232 -422 -382 -676 -535 -1022 -614 -2304 -665 -3370 -135 -344 172 -619 367 -894 636 -268 262 -450 500 -629 821 -218 390 -358 827 -419 1309 -17 140 -17 640 0 780 103 811 427 1495 977 2059 266 272 502 454 826 634 390 218 862 369 1304 416 55 6 118 13 140 15 96 10 585 -4 695 -19z"/> <path d="M4960 7674 c-143 -24 -221 -54 -321 -120 -146 -97 -256 -255 -300 -434 -17 -70 -17 -248 0 -320 65 -268 273 -475 541 -541 71 -17 249 -17 320 0 285 70 495 293 545 580 19 105 19 137 0 242 -49 281 -253 503 -526 574 -59 15 -214 27 -259 19z"/> <path d="M4870 5724 c-476 -18 -902 -33 -947 -33 l-83 -1 0 -160 0 -160 203 0 c212 0 290 -11 366 -49 50 -26 98 -82 111 -130 7 -27 10 -369 8 -1083 -3 -1040 -3 -1043 -24 -1089 -23 -49 -67 -88 -124 -109 -23 -9 -109 -15 -257 -18 l-223 -4 0 -164 0 -164 1250 0 1250 0 0 164 0 164 -197 5 c-225 5 -281 17 -342 73 -26 23 -42 48 -50 79 -8 31 -11 430 -11 1379 l0 1336 -32 -1 c-18 -1 -422 -17 -898 -35z"/> </g> </svg>
</div>
<div id="settingsCog">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="1280.000000pt" height="1280.000000pt" viewBox="0 0 1280.000000 1280.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,1280.000000) scale(0.100000,-0.100000)"
fill="#ffffff" stroke="none">
<path d="M6010 12794 c-25 -2 -103 -9 -175 -15 -143 -12 -390 -49 -503 -74
l-72 -17 0 -529 0 -530 -139 -207 c-158 -234 -272 -376 -371 -461 -174 -150
-329 -225 -570 -277 -67 -15 -129 -18 -290 -18 -216 0 -338 13 -540 59 l-103
23 -366 366 -367 367 -139 -112 c-409 -327 -760 -689 -1070 -1102 l-58 -78
355 -357 356 -357 40 -105 c99 -258 137 -439 137 -655 0 -152 -9 -214 -47
-339 -97 -315 -393 -608 -871 -861 l-104 -55 -510 0 c-437 0 -512 -2 -516 -14
-10 -26 -55 -336 -69 -471 -8 -82 -13 -266 -12 -495 0 -373 10 -553 54 -954
11 -99 20 -183 20 -188 0 -4 227 -8 504 -8 l503 0 84 -34 c417 -169 661 -374
800 -672 141 -299 140 -732 -2 -1218 l-21 -71 -356 -357 -356 -357 27 -40 c45
-68 219 -281 350 -427 251 -282 517 -537 771 -740 l130 -105 371 371 371 370
79 10 c142 17 511 23 645 11 434 -40 741 -184 989 -464 75 -86 193 -261 250
-373 l41 -81 0 -525 0 -525 103 -16 c144 -23 406 -54 577 -69 189 -17 765 -16
935 0 137 14 468 59 498 68 16 5 17 39 17 538 l0 532 46 95 c141 290 366 525
634 659 117 59 291 114 445 141 113 20 164 23 385 24 154 0 302 -5 375 -14
l120 -13 397 -400 398 -401 37 29 c85 63 356 286 468 384 302 265 573 556 755
813 l34 48 -397 397 -397 397 -34 170 c-59 293 -70 384 -70 585 -1 143 4 204
18 270 48 220 136 387 291 549 142 149 293 255 533 375 l132 66 575 0 575 0 5
23 c7 35 34 248 50 407 52 515 43 1075 -26 1529 -11 75 -22 144 -25 154 -5 16
-42 17 -589 17 l-584 0 -128 64 c-540 271 -784 609 -818 1136 -10 155 22 485
75 760 l10 55 405 405 405 405 -64 93 c-205 303 -507 614 -872 897 -182 143
-372 278 -382 273 -5 -1 -184 -174 -396 -383 -279 -274 -397 -384 -424 -393
-20 -8 -100 -27 -177 -43 -747 -155 -1306 99 -1725 786 l-60 99 0 553 c0 455
-2 553 -13 553 -8 0 -94 9 -193 20 -364 40 -536 51 -829 54 -165 2 -320 2
-345 0z m725 -4200 c242 -29 482 -102 720 -219 252 -124 440 -260 636 -461
291 -300 495 -679 589 -1095 65 -289 67 -678 4 -964 -181 -817 -764 -1463
-1548 -1714 -241 -77 -425 -105 -691 -105 -372 0 -669 68 -1000 229 -332 161
-616 393 -826 675 -113 152 -159 227 -239 392 -117 239 -193 507 -221 777 -16
153 -6 431 20 586 123 727 562 1329 1214 1665 420 217 856 293 1342 234z"/>
</g>
</svg>
</div>
</body>
<script>
"use strict"
const {remote} = require("electron")
// createElem
"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};window.createElem=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=1;if(Number.isInteger(t[0])){if(!(t[0]>0))throw new Error("Element count must be larger than 0. Actual value: "+t[0]);n=t[0],t.shift()}else if(Number(t[0])===t[0]&&t[0]%1!=0)throw new Error("Floats are not supported for element count.");var o=t[0]?t[0]:"div";if(t.shift(),"string"!=typeof o)throw new Error("Tag name must be a string");var a=document.createElement(o.replace(/(#.*)|(\..*)/g,"")),s=o.match(/#(?:(?![#\.]).)*/),c=o.match(/\.(?:(?![#\.]).)*/g);if(s&&(a.id=s[0].substr(1,s[0].length)),c&&(a.className=c.map(function(e){return e.substr(1,e.length)}).join(" ")),t.length)if("string"==typeof t[0])a.innerHTML=t[0],t.shift();else if(!(Object(t[0])!==t[0]||t[0]instanceof HTMLElement||Array.isArray(t[0]))){for(var i in t[0])!function(){switch(i){case"class":a.className=t[0].class;break;case"style":var e=t[0].style;if(null!=e&&void 0!=e&&e.constructor===Object)a.style.cssText=Object.keys(e).map(function(t){return t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()})+":"+("number"==typeof e[t]?e[t]+"px":e[t])}).join(";");else{if("string"!=typeof e)throw new Error("Style value must be either object or string.");a.style.cssText=e}break;case"events":Object.keys(t[0].events).forEach(function(e){var r=t[0].events[e];Array.isArray(r)?r.forEach(function(t){return a.addEventListener(e,t)}):"function"==typeof r&&a.addEventListener(e,r)});break;default:a.setAttribute(i,t[0][i])}}();t.shift()}var u=function e(t){switch(!0){case t instanceof HTMLElement:a.appendChild(t);break;case Array.isArray(t):t.forEach(e);break;case!!t&&t.constructor===Object:throw new Error("Multiple attributes objects not supported");default:null!=t&&console.warn("Unsupported parameter. Type: "+(void 0===t?"undefined":_typeof(t))+" Value:",t)}};return t.forEach(u),n>1?[].concat(_toConsumableArray(new Array(n))).map(function(e){return a.cloneNode()}):a};
// Chrome
chromeMin.addEventListener("click", () => remote.getCurrentWindow().minimize())
chromeMax.addEventListener("click", () => {
const w = remote.getCurrentWindow()
w.isMaximized() ? w.unmaximize() : w.maximize()
})
chromeQuit.addEventListener("click", () => remote.getCurrentWindow().close())
</script>
<script src="script.js"></script>
</html>