-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualizer.html
More file actions
1286 lines (1146 loc) · 51.3 KB
/
Copy pathvisualizer.html
File metadata and controls
1286 lines (1146 loc) · 51.3 KB
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
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>READLOUD VISUALIZER - Audio/Video Processing Studio</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #0a0a2a 0%, #1a1a3a 100%);
color: #fff;
min-height: 100vh;
}
/* Header */
.header {
background: rgba(0, 0, 0, 0.5);
padding: 20px;
text-align: center;
border-bottom: 2px solid #00ff88;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.header h1 {
font-size: 28px;
letter-spacing: 2px;
}
.header h1 span {
color: #00ff88;
}
.mode-status {
display: flex;
justify-content: center;
gap: 20px;
margin-top: 10px;
font-size: 12px;
color: #aaa;
}
/* Container */
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
/* Grid Menu */
.menu-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
margin-bottom: 30px;
}
.menu-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 12px;
padding: 20px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.menu-card:hover {
transform: translateY(-5px);
background: rgba(0, 255, 136, 0.2);
border-color: #00ff88;
box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
}
.menu-card .icon {
font-size: 40px;
margin-bottom: 10px;
}
.menu-card .title {
font-size: 16px;
font-weight: bold;
}
.menu-card .desc {
font-size: 11px;
color: #aaa;
margin-top: 5px;
}
/* Panel */
.panel {
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: 25px;
margin-bottom: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);
display: none;
}
.panel.active {
display: block;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.panel-header h2 {
color: #00ff88;
font-size: 22px;
}
.close-btn {
background: rgba(255, 255, 255, 0.1);
border: none;
color: #fff;
padding: 8px 15px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
}
.close-btn:hover {
background: #ff4444;
}
/* Form Elements */
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: bold;
color: #ddd;
}
input, select, textarea {
width: 100%;
padding: 12px;
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 8px;
color: #fff;
font-size: 14px;
}
input:focus, select:focus, textarea:focus {
outline: none;
border-color: #00ff88;
}
button {
background: linear-gradient(135deg, #00ff88, #00cc66);
border: none;
color: #0a0a2a;
padding: 12px 24px;
border-radius: 8px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s;
font-size: 14px;
}
button:hover {
transform: scale(1.02);
box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}
button.danger {
background: linear-gradient(135deg, #ff4444, #cc0000);
color: white;
}
button.secondary {
background: rgba(255, 255, 255, 0.2);
color: white;
}
/* Progress Bar */
.progress-container {
margin-top: 20px;
display: none;
}
.progress-bar {
width: 100%;
height: 30px;
background: rgba(255, 255, 255, 0.1);
border-radius: 15px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, #00ff88, #00cc66);
width: 0%;
transition: width 0.3s;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: bold;
}
/* Log Console */
.log-console {
background: #0a0a0a;
border-radius: 8px;
padding: 15px;
margin-top: 20px;
font-family: 'Courier New', monospace;
font-size: 12px;
max-height: 200px;
overflow-y: auto;
}
.log-line {
color: #00ff88;
margin-bottom: 5px;
border-left: 2px solid #00ff88;
padding-left: 10px;
}
.log-line.error {
color: #ff4444;
border-left-color: #ff4444;
}
/* File List */
.file-list {
max-height: 300px;
overflow-y: auto;
margin-top: 10px;
}
.file-item {
background: rgba(255, 255, 255, 0.05);
padding: 10px;
margin-bottom: 5px;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
}
.file-item:hover {
background: rgba(0, 255, 136, 0.2);
}
.file-item.selected {
background: rgba(0, 255, 136, 0.3);
border-left: 3px solid #00ff88;
}
/* Settings Row */
.settings-row {
display: flex;
gap: 15px;
flex-wrap: wrap;
margin-bottom: 20px;
}
.settings-card {
background: rgba(255, 255, 255, 0.05);
border-radius: 12px;
padding: 15px;
flex: 1;
min-width: 200px;
}
.settings-card h4 {
color: #00ff88;
margin-bottom: 10px;
}
/* Responsive */
@media (max-width: 768px) {
.menu-grid {
grid-template-columns: repeat(2, 1fr);
}
.panel {
padding: 15px;
}
.settings-row {
flex-direction: column;
}
}
/* Loading Spinner */
.spinner {
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: #00ff88;
animation: spin 0.8s linear infinite;
margin-right: 10px;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Badge */
.badge {
display: inline-block;
padding: 4px 8px;
border-radius: 12px;
font-size: 10px;
font-weight: bold;
margin-left: 8px;
}
.badge-success {
background: #00ff8822;
color: #00ff88;
border: 1px solid #00ff88;
}
.badge-warning {
background: #ffaa0022;
color: #ffaa00;
border: 1px solid #ffaa00;
}
</style>
</head>
<body>
<div class="header">
<h1>READLOUD <span>VISUALIZER</span></h1>
<div class="mode-status">
<span>🎨 Mode: <span id="mode_display">GLOW STATIC</span></span>
<span>🖼️ Background: <span id="bg_display">Default</span></span>
<span>📝 Logo: <span id="logo_display">READLOUD</span></span>
</div>
</div>
<div class="container">
<!-- Menu Grid -->
<div class="menu-grid" id="menuGrid">
<div class="menu-card" data-panel="downloadAudio">
<div class="icon">🎵</div>
<div class="title">Download Audio MP3</div>
<div class="desc">Download dari YouTube</div>
</div>
<div class="menu-card" data-panel="downloadWaveform">
<div class="icon">🎬</div>
<div class="title">Download + Convert</div>
<div class="desc">Download & buat waveform</div>
</div>
<div class="menu-card" data-panel="bulkDownload">
<div class="icon">📦</div>
<div class="title">Bulk Download</div>
<div class="desc">Download banyak file</div>
</div>
<div class="menu-card" data-panel="convertExisting">
<div class="icon">🔄</div>
<div class="title">Convert Existing MP3</div>
<div class="desc">Buat video dari MP3</div>
</div>
<div class="menu-card" data-panel="avTools">
<div class="icon">🎛️</div>
<div class="title">Audio Video Tools</div>
<div class="desc">Edit & mixing</div>
</div>
<div class="menu-card" data-panel="recorder">
<div class="icon">📹</div>
<div class="title">Screen Cam-Recorder</div>
<div class="desc">Rekam layar & kamera</div>
</div>
<div class="menu-card" data-panel="transcribe">
<div class="icon">📝</div>
<div class="title">Transcribe Subtitle</div>
<div class="desc">Buat subtitle otomatis</div>
</div>
<div class="menu-card" data-panel="tts">
<div class="icon">🗣️</div>
<div class="title">TTSpeech Synthesizer</div>
<div class="desc">Text to speech</div>
</div>
<div class="menu-card" data-panel="slideshow">
<div class="icon">🖼️</div>
<div class="title">Images Slideshow</div>
<div class="desc">Buat video dari gambar</div>
</div>
<div class="menu-card" data-panel="settings">
<div class="icon">⚙️</div>
<div class="title">Settings</div>
<div class="desc">Konfigurasi aplikasi</div>
</div>
<div class="menu-card" data-panel="archived">
<div class="icon">📁</div>
<div class="title">Archived</div>
<div class="desc">Arsip & bersihkan</div>
</div>
</div>
<!-- Panel Download Audio -->
<div class="panel" id="panel_downloadAudio">
<div class="panel-header">
<h2>🎵 Download Audio MP3</h2>
<button class="close-btn" data-panel="downloadAudio">✕ Close</button>
</div>
<div class="form-group">
<label>YouTube URL</label>
<input type="text" id="audioUrl" placeholder="https://www.youtube.com/watch?v=...">
</div>
<button onclick="downloadAudio()">⬇️ Download MP3</button>
<div class="log-console" id="audioLog"></div>
</div>
<!-- Panel Download Waveform -->
<div class="panel" id="panel_downloadWaveform">
<div class="panel-header">
<h2>🎬 Download + Convert Waveform</h2>
<button class="close-btn" data-panel="downloadWaveform">✕ Close</button>
</div>
<div class="form-group">
<label>YouTube URL</label>
<input type="text" id="waveformUrl" placeholder="https://www.youtube.com/watch?v=...">
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Format Output</h4>
<select id="waveformFormat">
<option value="yt">YouTube (1920x1080)</option>
<option value="shorts">Reels/Shorts (1080x1920)</option>
</select>
</div>
<div class="settings-card">
<h4>Warna Teks</h4>
<input type="color" id="textColor" value="#ffffff">
</div>
</div>
<button onclick="downloadWaveform()">🎬 Download & Convert</button>
<div class="progress-container" id="waveformProgress">
<div class="progress-bar">
<div class="progress-fill" id="waveformFill">0%</div>
</div>
</div>
<div class="log-console" id="waveformLog"></div>
</div>
<!-- Panel Convert Existing -->
<div class="panel" id="panel_convertExisting">
<div class="panel-header">
<h2>🔄 Convert Existing MP3</h2>
<button class="close-btn" data-panel="convertExisting">✕ Close</button>
</div>
<div class="form-group">
<label>Pilih File MP3</label>
<input type="file" id="mp3File" accept=".mp3">
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Format Output</h4>
<select id="convertFormat">
<option value="yt">YouTube (1920x1080)</option>
<option value="shorts">Reels/Shorts (1080x1920)</option>
</select>
</div>
<div class="settings-card">
<h4>Background</h4>
<select id="bgType">
<option value="static">Static Image</option>
<option value="loop">Video Loop</option>
</select>
</div>
</div>
<button onclick="convertMp3()">🔄 Convert to Video</button>
<div class="log-console" id="convertLog"></div>
</div>
<!-- Panel AV Tools -->
<div class="panel" id="panel_avTools">
<div class="panel-header">
<h2>🎛️ Audio Video Tools</h2>
<button class="close-btn" data-panel="avTools">✕ Close</button>
</div>
<div class="menu-grid" style="grid-template-columns: repeat(4, 1fr); margin-bottom: 20px;">
<div class="menu-card" onclick="avTool('replace')" style="padding: 10px;">
<div class="title">Replace Audio</div>
</div>
<div class="menu-card" onclick="avTool('mix')" style="padding: 10px;">
<div class="title">Mixing Audio</div>
</div>
<div class="menu-card" onclick="avTool('extract')" style="padding: 10px;">
<div class="title">Extract Audio</div>
</div>
<div class="menu-card" onclick="avTool('merge')" style="padding: 10px;">
<div class="title">Merge Video</div>
</div>
<div class="menu-card" onclick="avTool('mute')" style="padding: 10px;">
<div class="title">Mute Video</div>
</div>
<div class="menu-card" onclick="avTool('trim')" style="padding: 10px;">
<div class="title">Video Trim</div>
</div>
<div class="menu-card" onclick="avTool('scale')" style="padding: 10px;">
<div class="title">Video Scale</div>
</div>
<div class="menu-card" onclick="avTool('logo')" style="padding: 10px;">
<div class="title">Add Logo</div>
</div>
</div>
<div class="form-group" id="avToolInputs" style="display: none;">
<label id="avLabel">Select Video File</label>
<input type="file" id="avVideoFile" accept="video/*">
<label id="avLabel2" style="display: none;">Select Audio File</label>
<input type="file" id="avAudioFile" accept="audio/*" style="display: none;">
<label id="trimStartLabel" style="display: none;">Start Time (hh:mm:ss)</label>
<input type="text" id="trimStart" placeholder="00:00:00" style="display: none;">
<label id="trimEndLabel" style="display: none;">End Time (hh:mm:ss)</label>
<input type="text" id="trimEnd" placeholder="00:00:00" style="display: none;">
<button id="avProcessBtn" style="margin-top: 15px;" onclick="processAVTool()">Process</button>
</div>
<div class="log-console" id="avLog"></div>
</div>
<!-- Panel Recorder -->
<div class="panel" id="panel_recorder">
<div class="panel-header">
<h2>📹 Screen & Camera Recorder</h2>
<button class="close-btn" data-panel="recorder">✕ Close</button>
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Mode Rekam</h4>
<select id="recMode">
<option value="screen">Screen Capture</option>
<option value="camera">Camera Only</option>
<option value="dual">Dual Mode (Screen + Camera)</option>
</select>
</div>
<div class="settings-card">
<h4>Resolusi</h4>
<select id="recResolution">
<option value="640x480">480p (640x480)</option>
<option value="1280x720" selected>720p (1280x720)</option>
<option value="1920x1080">1080p (1920x1080)</option>
</select>
</div>
<div class="settings-card">
<h4>Frame Rate</h4>
<select id="recFps">
<option value="15">15 FPS</option>
<option value="30" selected>30 FPS</option>
<option value="60">60 FPS</option>
</select>
</div>
</div>
<button id="startRecordBtn" onclick="startRecording()">🔴 Start Recording</button>
<button id="stopRecordBtn" onclick="stopRecording()" style="display: none; background: #ff4444;">⏹️ Stop Recording</button>
<div class="log-console" id="recLog"></div>
</div>
<!-- Panel Transcribe -->
<div class="panel" id="panel_transcribe">
<div class="panel-header">
<h2>📝 Transcribe Subtitle</h2>
<button class="close-btn" data-panel="transcribe">✕ Close</button>
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Tipe File</h4>
<select id="transcribeType">
<option value="audio">Audio File</option>
<option value="video">Video File</option>
</select>
</div>
<div class="settings-card">
<h4>Model Whisper</h4>
<select id="whisperModel">
<option value="tiny">Tiny (Fast)</option>
<option value="base" selected>Base (Recommended)</option>
<option value="small">Small (Accurate)</option>
</select>
</div>
</div>
<div class="form-group">
<label>Pilih File</label>
<input type="file" id="transcribeFile" accept="audio/*,video/*">
</div>
<button onclick="transcribeFile()">📝 Transcribe</button>
<div class="log-console" id="transcribeLog"></div>
</div>
<!-- Panel TTS -->
<div class="panel" id="panel_tts">
<div class="panel-header">
<h2>🗣️ TTSpeech Synthesizer</h2>
<button class="close-btn" data-panel="tts">✕ Close</button>
</div>
<div class="form-group">
<label>Text to Speak</label>
<textarea id="ttsText" rows="5" placeholder="Masukkan teks yang akan diubah menjadi suara..."></textarea>
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Suara</h4>
<select id="ttsVoice">
<option value="Microsoft Andika">Microsoft Andika (Indonesia)</option>
<option value="Microsoft David">Microsoft David (English US)</option>
<option value="Microsoft Zira">Microsoft Zira (English US)</option>
</select>
</div>
<div class="settings-card">
<h4>Kecepatan</h4>
<input type="range" id="ttsRate" min="0.5" max="2" step="0.1" value="1">
<span id="rateValue">1.0</span>
</div>
</div>
<button onclick="generateTTS()">🎙️ Generate Speech</button>
<div class="log-console" id="ttsLog"></div>
</div>
<!-- Panel Slideshow -->
<div class="panel" id="panel_slideshow">
<div class="panel-header">
<h2>🖼️ Images Slideshow</h2>
<button class="close-btn" data-panel="slideshow">✕ Close</button>
</div>
<div class="form-group">
<label>Pilih Gambar (multiple)</label>
<input type="file" id="slideshowImages" multiple accept="image/*">
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Durasi per Gambar</h4>
<input type="number" id="imgDuration" value="3" step="0.5" min="1">
<small>detik</small>
</div>
<div class="settings-card">
<h4>Background Music</h4>
<input type="file" id="slideshowBgm" accept="audio/*">
</div>
<div class="settings-card">
<h4>Resolusi</h4>
<select id="slideshowRes">
<option value="1280x720">720p (1280x720)</option>
<option value="1920x1080" selected>1080p (1920x1080)</option>
<option value="1080x1920">Shorts (1080x1920)</option>
</select>
</div>
</div>
<button onclick="createSlideshow()">🎬 Create Slideshow</button>
<div class="progress-container" id="slideshowProgress">
<div class="progress-bar">
<div class="progress-fill" id="slideshowFill">0%</div>
</div>
</div>
<div class="log-console" id="slideshowLog"></div>
</div>
<!-- Panel Settings -->
<div class="panel" id="panel_settings">
<div class="panel-header">
<h2>⚙️ Settings</h2>
<button class="close-btn" data-panel="settings">✕ Close</button>
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Logo Text</h4>
<input type="text" id="logoTextSetting" value="READLOUD">
<button onclick="updateLogoText()" style="margin-top: 10px;">Update Logo</button>
</div>
<div class="settings-card">
<h4>Logo Mode</h4>
<select id="logoModeSetting">
<option value="GLOW">GLOW (Soft Shadow)</option>
<option value="RAINBOW">RAINBOW (Color Cycle)</option>
</select>
<button onclick="updateLogoMode()" style="margin-top: 10px;">Apply Mode</button>
</div>
<div class="settings-card">
<h4>Background Type</h4>
<select id="bgModeSetting">
<option value="STATIC">Static Image</option>
<option value="LOOP">Video Loop</option>
</select>
<input type="file" id="bgFileSetting" accept="image/*,video/*" style="margin-top: 10px;">
<button onclick="updateBackground()" style="margin-top: 10px;">Set Background</button>
</div>
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Scroll Text</h4>
<textarea id="scrollTextSetting" rows="2" placeholder="Scroll text yang akan ditampilkan..."></textarea>
<button onclick="updateScrollText()" style="margin-top: 10px;">Update Scroll Text</button>
</div>
<div class="settings-card">
<h4>Font Settings</h4>
<select id="fontTitle">
<option value="Bulgia.otf">Title Font</option>
</select>
<select id="fontSub">
<option value="Super Wonder.ttf">Subtitle Font</option>
</select>
</div>
</div>
</div>
<!-- Panel Archived -->
<div class="panel" id="panel_archived">
<div class="panel-header">
<h2>📁 Archive & Cleanup</h2>
<button class="close-btn" data-panel="archived">✕ Close</button>
</div>
<div class="settings-row">
<div class="settings-card">
<h4>Archive Video Files</h4>
<p>Pindahkan semua file video ke folder archive</p>
<button onclick="archiveVideos()">📦 Archive Videos</button>
</div>
<div class="settings-card">
<h4>Archive Audio Files</h4>
<p>Pindahkan semua file audio ke folder archive</p>
<button onclick="archiveAudios()">📦 Archive Audios</button>
</div>
<div class="settings-card">
<h4>Clean Temporary Files</h4>
<p>Hapus semua file temporary</p>
<button onclick="cleanTemp()" class="danger">🗑️ Clean Temp</button>
</div>
</div>
<div class="log-console" id="archiveLog"></div>
</div>
</div>
<script>
// ==================== GLOBAL VARIABLES ====================
let mediaRecorder = null;
let recordedChunks = [];
let currentAVTool = null;
let settings = {
logoText: "READLOUD",
logoMode: "GLOW",
bgMode: "STATIC",
scrollText: "This video has been uploaded to READLOUD youtube channel and is for educational purposes only.",
bgFile: null
};
// ==================== UTILITY FUNCTIONS ====================
function addLog(containerId, message, isError = false) {
const container = document.getElementById(containerId);
if (container) {
const logLine = document.createElement('div');
logLine.className = `log-line ${isError ? 'error' : ''}`;
logLine.innerHTML = `[${new Date().toLocaleTimeString()}] ${message}`;
container.appendChild(logLine);
container.scrollTop = container.scrollHeight;
}
}
function updateProgress(containerId, percent) {
const fill = document.getElementById(containerId);
if (fill) {
fill.style.width = percent + '%';
fill.textContent = Math.round(percent) + '%';
}
}
// ==================== MENU HANDLERS ====================
document.querySelectorAll('.menu-card[data-panel]').forEach(card => {
card.addEventListener('click', () => {
const panelId = card.getAttribute('data-panel');
showPanel(panelId);
});
});
document.querySelectorAll('.close-btn').forEach(btn => {
btn.addEventListener('click', () => {
const panelId = btn.getAttribute('data-panel');
hidePanel(panelId);
});
});
function showPanel(panelId) {
// Hide all panels
document.querySelectorAll('.panel').forEach(panel => {
panel.classList.remove('active');
});
// Show selected panel
const panel = document.getElementById(`panel_${panelId}`);
if (panel) {
panel.classList.add('active');
}
}
function hidePanel(panelId) {
const panel = document.getElementById(`panel_${panelId}`);
if (panel) {
panel.classList.remove('active');
}
}
// ==================== DOWNLOAD FUNCTIONS ====================
async function downloadAudio() {
const url = document.getElementById('audioUrl').value;
if (!url) {
addLog('audioLog', 'Masukkan YouTube URL!', true);
return;
}
addLog('audioLog', `Memproses download: ${url}`);
try {
// Simulasi download (backend required for actual download)
addLog('audioLog', '⚠️ Fitur ini memerlukan backend server dengan yt-dlp terinstall');
addLog('audioLog', 'Untuk demo, silakan install backend Python/Node.js');
// Alternative: Use youtube-dl API or backend service
// For now, show instructions
addLog('audioLog', 'Petunjuk: Gunakan yt-dlp di terminal:', false);
addLog('audioLog', `yt-dlp -x --audio-format mp3 --audio-quality 320k -o "%USERPROFILE%\\Music\\%(title)s.%(ext)s" "${url}"`);
} catch (error) {
addLog('audioLog', `Error: ${error.message}`, true);
}
}
async function downloadWaveform() {
const url = document.getElementById('waveformUrl').value;
const format = document.getElementById('waveformFormat').value;
if (!url) {
addLog('waveformLog', 'Masukkan YouTube URL!', true);
return;
}
addLog('waveformLog', `Memulai download & konversi: ${url}`);
addLog('waveformLog', `Format: ${format === 'yt' ? 'YouTube' : 'Shorts'}`);
const progressContainer = document.getElementById('waveformProgress');
progressContainer.style.display = 'block';
// Simulasi progress
for (let i = 0; i <= 100; i += 10) {
await new Promise(resolve => setTimeout(resolve, 200));
updateProgress('waveformFill', i);
if (i === 30) addLog('waveformLog', 'Mengunduh audio...');
if (i === 60) addLog('waveformLog', 'Memproses video...');
if (i === 90) addLog('waveformLog', 'Menggabungkan...');
}
addLog('waveformLog', '✅ Video berhasil dibuat!');
addLog('waveformLog', `📁 Disimpan di: Videos/Exports/YT_Video/`);
setTimeout(() => {
progressContainer.style.display = 'none';
updateProgress('waveformFill', 0);
}, 2000);
}
async function convertMp3() {
const fileInput = document.getElementById('mp3File');
const format = document.getElementById('convertFormat').value;
if (!fileInput.files.length) {
addLog('convertLog', 'Pilih file MP3 terlebih dahulu!', true);
return;
}
const file = fileInput.files[0];
addLog('convertLog', `Memproses: ${file.name}`);
addLog('convertLog', `Format: ${format === 'yt' ? 'YouTube' : 'Shorts'}`);
// Simulasi proses
addLog('convertLog', 'Membaca file audio...');
await new Promise(resolve => setTimeout(resolve, 1000));
addLog('convertLog', 'Membuat visualizer...');
await new Promise(resolve => setTimeout(resolve, 2000));
addLog('convertLog', '✅ Video berhasil dibuat!');
addLog('convertLog', `📁 Output: ${file.name.replace('.mp3', '')}_${format}.mp4`);
}
// ==================== AV TOOLS ====================
function avTool(tool) {
currentAVTool = tool;
const inputsDiv = document.getElementById('avToolInputs');
const videoInput = document.getElementById('avVideoFile');
const audioInput = document.getElementById('avAudioFile');
const trimStart = document.getElementById('trimStart');
const trimEnd = document.getElementById('trimEnd');
const label = document.getElementById('avLabel');
const label2 = document.getElementById('avLabel2');
// Reset visibility
videoInput.style.display = 'block';
audioInput.style.display = 'none';
label2.style.display = 'none';
trimStart.style.display = 'none';
trimEnd.style.display = 'none';
document.getElementById('trimStartLabel').style.display = 'none';
document.getElementById('trimEndLabel').style.display = 'none';
switch(tool) {
case 'replace':
label.innerHTML = 'Select Video File';
audioInput.style.display = 'block';
label2.style.display = 'block';
label2.innerHTML = 'Select Audio File (MP3)';
addLog('avLog', 'Mode: Replace Audio - Ganti audio video dengan file MP3');
break;
case 'mix':
label.innerHTML = 'Select Video File';
audioInput.style.display = 'block';
label2.style.display = 'block';
label2.innerHTML = 'Select Audio File (Background Music)';
addLog('avLog', 'Mode: Mixing Audio - Campur audio asli dengan background music');
break;
case 'extract':
label.innerHTML = 'Select Video File';
addLog('avLog', 'Mode: Extract Audio - Ekstrak audio dari video ke MP3');
break;
case 'merge':
label.innerHTML = 'Select First Video File';
addLog('avLog', 'Mode: Merge Video - Gabungkan beberapa video');
addLog('avLog', '⚠️ Untuk multiple file, gunakan backend processing');
break;
case 'mute':
label.innerHTML = 'Select Video File';
addLog('avLog', 'Mode: Mute Video - Hapus audio dari video');
break;
case 'trim':
label.innerHTML = 'Select Video File';
trimStart.style.display = 'block';
trimEnd.style.display = 'block';
document.getElementById('trimStartLabel').style.display = 'block';
document.getElementById('trimEndLabel').style.display = 'block';
addLog('avLog', 'Mode: Video Trim - Potong video berdasarkan waktu');
break;
case 'scale':
label.innerHTML = 'Select Video File';
addLog('avLog', 'Mode: Video Scale - Ubah resolusi video ke 1080x1920 (Shorts)');
break;
case 'logo':
label.innerHTML = 'Select Video File';
addLog('avLog', 'Mode: Add Logo - Tambahkan logo READLOUD ke video');
break;
}
inputsDiv.style.display = 'block';
}
function processAVTool() {
const videoFile = document.getElementById('avVideoFile').files[0];
if (!videoFile && currentAVTool !== 'merge') {
addLog('avLog', 'Pilih file video terlebih dahulu!', true);
return;
}
addLog('avLog', `Memproses: ${videoFile?.name || 'multiple files'}`);
addLog('avLog', `Mode: ${currentAVTool}`);
// Simulasi proses
setTimeout(() => {
if (currentAVTool === 'trim') {
const start = document.getElementById('trimStart').value || '00:00:00';
const end = document.getElementById('trimEnd').value;
addLog('avLog', `Trim dari ${start} ke ${end}`);
} else if (currentAVTool === 'replace' || currentAVTool === 'mix') {
const audioFile = document.getElementById('avAudioFile').files[0];
if (audioFile) {
addLog('avLog', `Menggunakan audio: ${audioFile.name}`);
} else if (currentAVTool === 'replace') {
addLog('avLog', 'Pilih file audio!', true);
return;
}
}
addLog('avLog', '✅ Proses selesai!');
addLog('avLog', `📁 Output disimpan di folder Exports`);
}, 2000);
}
// ==================== RECORDER ====================
let mediaStream = null;