-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathindex.html
2901 lines (2621 loc) · 199 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
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>
<head>
<title>Animebook</title>
<style>
:root {
--bw-000: hsl(0, 0%, 0%);
--bw-050: hsl(0, 0%, 5%);
--bwa-100: hsla(0, 0%, 6%, 0.95);
--bw-150: hsl(0, 0%, 15%);
--bw-200: hsl(0, 0%, 20%);
--bw-300: hsl(0, 0%, 30%);
--bw-400: hsl(0, 0%, 40%);
--bw-700: hsl(0, 0%, 70%);
--bw-750: hsl(0, 0%, 75%);
--bw-800: hsl(0, 0%, 80%);
--bw-850: hsl(0, 0%, 85%);
--bw-1000: hsl(0, 0%, 100%);
--green-400: hsl(118, 65%, 33%);
--green-500: hsl(112, 79%, 43%);
--pale-green-400: hsl(193, 17%, 42%);
--pale-green-500: hsl(193, 13%, 59%);
--pale-green-600: hsl(193, 17%, 63%);
--blue-200: hsl(240, 49%, 14%);
--blue-800: hsl(207, 82%, 81%);
--pale-blue-400: hsl(223, 7%, 47%);
--pale-blue-500: hsl(231, 10%, 59%);
--pale-blue-600: hsl(225, 6%, 59%);
--red-150: hsl(0, 100%, 7%);
--red-200: hsl(0, 100%, 10%);
--red-400: hsl(331, 47%, 19%);
--red-600: hsl(0, 83%, 23%);
--red-700: hsl(0, 83%, 28%);
--red-800: hsl(0, 20%, 33%);
--red-900: hsl(0, 50%, 40%);
--red-950: hsl(0, 83%, 46%);
--red-980: hsl(355, 100%, 63%);
--main-fg-color: var(--bw-300);
--main-bg-color: var(--bw-000);
--hint-fg-color: var(--bw-1000);
--subtitle-fg-color: var(--bw-850);
--subtitle-shadow-color: var(--bw-000);
--button-hover-fg-color: var(--bw-000);
--button-hover-bg-color: var(--pale-green-600);
--button-active-fg-color: var(--bw-000);
--button-active-bg-color: var(--pale-green-400);
--button-hover-active-fg-color: var(--bw-000);
--button-hover-active-bg-color: var(--pale-green-500);
--button-ap-hover-bg-color: var(--pale-blue-600);
--button-ap-active-bg-color: var(--pale-blue-400);
--button-ap-hover-active-bg-color: var(--pale-blue-500);
--cancel-button-fg-color: var(--bw-300);
--cancel-button-bg-color: var(--red-200);
--cancel-button-hover-fg-color: var(--bw-000);
--cancel-button-hover-bg-color: var(--red-600);
--input-focus-outline-color: var(--bw-200);
--caption-time-hint-color: var(--red-800);
--caption-time-hint-hover-color: var(--red-400);
--auto-pause-fg-color: var(--bw-400);
--auto-pause-bg-color: var(--blue-200);
--auto-pause-skip-bg-color: var(--red-400);
--help-fg-color: var(--bw-750);
--help-bg-color: var(--bwa-100);
--table-border-color: var(--bw-750);
--exit-button-fg-color: var(--bw-850);
--exit-button-bg-color: var(--bw-150);
--lowkey-delete-button-fg-color: var(--bw-400);
--lowkey-delete-button-bg-color: var(--bw-050);
--lowkey-delete-button-hover-fg-color: var(--bw-000);
--lowkey-delete-button-hover-bg-color: var(--red-600);
--error-fg-color: var(--red-900);
--monospace-fg-color: var(--bw-1000);
--monospace-bg-color: var(--bw-150);
--monospace-error-fg-color: var(--red-980);
--tab-fg-color: var(--bw-700);
--tab-bg-color: var(--bw-150);
--tab-active-fg-color: var(--bw-000);
--tab-active-bg-color: var(--bw-700);
--tab-hover-fg-color: var(--bw-000);
--tab-hover-bg-color: var(--bw-800);
--link-fg-color: var(--blue-800);
--scrollbar-gutter-color: var(--bw-050);
--scrollbar-thumb-color: var(--bw-300);
--regex-input-fg-color: var(--bw-800);
--regex-input-bg-color: var(--bw-000);
--add-button-fg-color: var(--bw-900);
--add-button-bg-color: var(--green-400);
--add-button-hover-fg-color: var(--bw-1000);
--add-button-hover-bg-color: var(--green-500);
--delete-button-fg-color: var(--bw-900);
--delete-button-bg-color: var(--red-700);
--delete-button-hover-fg-color: var(--bw-1000);
--delete-button-hover-bg-color: var(--red-950);
}
* {
box-sizing: border-box;
line-height: 1.3;
}
[v-cloak] {
display: none;
}
html,
body,
#app,
.drop-wrapper,
.app-container {
height: 100%;
width: 100%;
padding: 0;
margin: 0;
overflow: hidden;
font-family: Helvetica, sans-serif;
color: var(--main-fg-color);
background-color: var(--main-bg-color);
}
.drop-wrapper {
transition: background-color 100ms ease-out;
}
.drop-wrapper.dragging-file {
opacity: 0.4;
}
.app-container {
display: grid;
grid-template-rows: 100%;
position: relative;
z-index: 1;
}
.video-subtitles-missing {
grid-area: video;
z-index: 1;
}
.video-missing, .video-error {
grid-area: video;
position: relative;
z-index: 1;
}
.subtitles-missing, .subtitles-error {
grid-area: sidebar;
position: relative;
z-index: 1;
}
.video-container {
grid-area: video;
position: relative;
z-index: 1;
display: flex;
background-color: var(--main-bg-color);
}
.video-container.center {
align-items: center;
}
.video-container.top {
align-items: top;
}
.video-element {
height: min-content;
max-height: 100%;
width: 100%;
}
.sidebar {
grid-area: sidebar;
display: flex;
flex-direction: column;
}
.sidebar-captions {
position: relative;
height: 100%;
}
.captions-container {
height: 100%;
width: calc(100% + 135px);
overflow-y: auto;
overflow-x: hidden;
position: absolute;
right: 0;
}
.captions-list {
margin-left: 135px;
color: var(--main-fg-color);
background-color: var(--main-bg-color);
}
.caption-controls {
display: block;
position: relative;
}
.button {
color: var(--button-fg-color);
background-color: var(--button-bg-color);
}
.button:hover {
color: var(--button-hover-fg-color);
background-color: var(--button-hover-bg-color);
}
.button.active {
color: var(--button-active-fg-color);
background-color: var(--button-active-bg-color);
}
.button.active:hover {
color: var(--button-hover-active-fg-color);
background-color: var(--button-hover-active-bg-color);
}
.button.auto-pause:hover {
background-color: var(--button-ap-hover-bg-color);
}
.button.auto-pause.active {
background-color: var(--button-ap-active-bg-color);
}
.button.auto-pause.active:hover {
background-color: var(--button-ap-hover-active-bg-color);
}
.caption {
display: block;
position: relative;
font-size: 18px;
cursor: pointer;
margin: 0;
padding: 0.4em;
transition: background-color 100ms linear;
word-break: break-word;
}
.caption-text {
grid-area: subtitleLine;
display: inline-block;
padding: 0.4em;
}
.caption.active {
transition: background-color 250ms linear;
}
.caption.active:hover {
transition: background-color 100ms linear;
}
.current-caption {
text-align: center;
position: absolute;
bottom: 3.5%;
padding: 0.4vmin 2vmin;
left: 50%;
transform: translate(-50%, 0%);
width: max-content;
max-width: 82%;
z-index: 2;
}
.current-caption, .notify-text {
color: var(--subtitle-fg-color);
paint-order: stroke;
-webkit-text-stroke: unset;
text-shadow:
0.04em 0 0.03em var(--subtitle-shadow-color),
0 0.04em 0.03em var(--subtitle-shadow-color),
-0.04em 0 0.03em var(--subtitle-shadow-color),
0 -0.04em 0.03em var(--subtitle-shadow-color),
-0.04em -0.04em 0.03em var(--subtitle-shadow-color),
-0.04em 0.04em 0.03em var(--subtitle-shadow-color),
0.04em -0.04em 0.03em var(--subtitle-shadow-color),
0.04em 0.04em 0.03em var(--subtitle-shadow-color);
}
.resize-bar-wrapper {
grid-area: resizeBar;
height: 100%;
position: relative;
z-index: 1;
}
.resize-bar {
position: absolute;
height: 100%;
top: 0px;
left: -6px;
width: 8px;
z-index: 2;
cursor: ew-resize;
}
.controls {
display: flex;
width: 100%;
height: min-content;
flex-wrap: wrap-reverse;
flex-direction: row-reverse
}
.offset-input {
padding: 0;
font-size: 1.5vh;
text-align: left;
position: relative;
width: 3em;
min-width: 0;
flex-grow: 3;
}
.offset-input, .custom-offset-input {
border: 0;
margin: 0.2vh;
color: var(--main-fg-color);
background-color: var(--main-bg-color);
}
.offset-input:focus, .custom-offset-input:focus {
outline: 0.2vh solid var(--input-focus-outline-color);
}
.offset-button,
.help,
.audio-track {
padding: .2em;
font-size: 1.5vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
cursor: pointer;
transition: background-color 100ms linear;
overflow: hidden;
cursor: pointer;
outline: 0;
height: 2.8em;
border-radius: 0.2em;
}
.offset-button {
flex-grow: 1;
width: 4em;
}
.offset-button.on {
color: var(--cancel-button-fg-color);
background-color: var(--cancel-button-bg-color);
}
.offset-button.on:hover {
color: var(--cancel-button-hover-fg-color);
background-color: var(--cancel-button-hover-bg-color);
}
.caption-time-offset, .custom-time-offset {
position: absolute;
top: 0;
right: 2px;
font-size: 10px;
color: var(--caption-time-hint-color);
}
.caption.button:hover .caption-time-offset,
.caption-time-offset:hover,
.set-custom-offset-button:hover .custom-time-offset,
.custom-time-offset:hover {
color: var(--caption-time-hint-hover-color);
}
.custom-time-offset {
opacity: 0;
}
.set-custom-offset-button:hover .custom-time-offset,
.custom-time-offset:hover {
opacity: 1;
}
.set-custom-offset-button {
position: absolute;
left: -135px;
width: 135px;
top: 0;
height: 100%;
opacity: 0;
z-index: 2;
padding: 3px;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
cursor: pointer;
overflow: hidden;
transition: background-color 100ms linear;
}
.set-custom-offset-button:hover,
.caption-controls:hover .set-custom-offset-button {
opacity: 1;
}
.caption-custom-offset {
position: relative;
display: grid;
grid-template-areas: "customInput delete";
grid-template-columns: 80% 20%;
width: 100%;
}
.custom-offset-input {
padding: 0;
font-size: 16px;
text-align: center;
width: 100%;
min-height: 40px;
position: relative;
}
.custom-offset-too-negative {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
}
.error > .custom-offset-input,
.error > .custom-offset-too-negative {
color: var(--error-fg-color);
}
.delete-custom-offset {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
cursor: pointer;
overflow: hidden;
padding: 2px;
transition: background-color 100ms ease-out;
color: var(--lowkey-delete-button-fg-color);
background-color: var(--lowkey-delete-button-bg-color);
}
.delete-custom-offset:hover {
color: var(--lowkey-delete-button-hover-fg-color);
background-color: var(--lowkey-delete-button-hover-bg-color);
}
.offset-hint, .auto-pause-text {
display: flex;
justify-content: center;
padding: 1vh;
align-items: center;
text-align: center;
font-size: 1.5vh;
overflow: hidden;
}
.unselectable, label {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.hint {
font-size: 2em;
letter-spacing: 1.1px;
word-spacing: 0.05em;
line-height: 1.5;
font-weight: normal;
position: absolute;
top: 25%;
left: 50%;
transform: translate(-50%, -50%);
width: 90%;
max-width: 750px;
text-align: left;
color: var(--hint-fg-color);
}
.hint a, .help-inner a {
color: var(--link-fg-color);
}
.current-caption p {
margin-top: 0em;
margin-bottom: 0em;
line-height: 1.2em;
min-height: 1.2em;
}
.caption p {
margin-top: 0em;
margin-bottom: 0em;
line-height: 1.3em;
}
.auto-pause-icon {
display: inline-block;
margin-left: 0.6vh;
padding: 0.6vh;
border-radius: 0.2vh;
}
.auto-pause-icon.paused {
color: var(--auto-pause-fg-color);
background-color: var(--auto-pause-bg-color);
}
.auto-pause-icon.skipping {
color: var(--auto-pause-fg-color);
background-color: var(--auto-pause-skip-bg-color);
}
.notify-text {
font-size: 26px;
position: fixed;
top: 3.5%;
left: 3.5%;
z-index: 2;
opacity: 100%;
transition: opacity 0.0s ease-in-out;
}
.notify-text.off {
opacity: 0;
transition: opacity 0.2s ease-in-out;
}
.help-popup {
position: absolute;
top: 3%;
left: 50%;
transform: translate(-50%, 0%);
width: 55%;
min-height: 45%;
max-height: 90%;
padding: 5px;
z-index: 3;
color: var(--help-fg-color);
background-color: var(--help-bg-color);
}
.help-inner {
overflow-y: auto;
max-height: 75vh;
padding: 8px;
}
.exit-popup {
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
top: 2px;
right: 2px;
width: 32px;
height: 32px;
font-size: 32px;
cursor: pointer;
border-radius: 0px;
color: var(--exit-button-fg-color);
background-color: var(--exit-button-bg-color);
}
.table {
display: table;
width:100%;
}
.table-row {
display: table-row;
}
.table-cell, .table-head {
display: table-cell;
padding: 0.8em;
min-width: 150px;
border: var(--table-border-color) 1px solid;
}
.table-head {
font-weight: bold;
}
.monospace, .footnote {
font-family: consolas, "Liberation Mono", courier, monospace;
color: var(--monospace-fg-color);
background-color: var(--monospace-bg-color);
padding: 2px;
}
.monospace.error {
color: var(--monospace-error-fg-color);
}
.help-inner li {
padding: 0.2em;
}
.help-mode-tab-container {
display: flex;
margin-bottom: 0.4em;
}
.help-mode-tab {
padding: .3rem;
margin-right: .2em;
font-size: 1.5em;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
cursor: pointer;
transition: background-color 100ms linear;
overflow: hidden;
outline: 0;
color: var(--tab-fg-color);
background-color: var(--tab-bg-color);
border: 1px solid var(--tab-bg-color);
border-radius: 2px;
}
.help-mode-tab.selected {
color: var(--tab-active-fg-color);
background-color: var(--tab-active-bg-color);
}
.help-mode-tab:hover {
color: var(--tab-hover-fg-color);
background-color: var(--tab-hover-bg-color);
}
.offset-text {
width: min-content;
}
.help {
font-weight: bold;
}
input[type=number]
{
-moz-appearance: textfield;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button
{
position: absolute;
margin: auto;
filter: invert(90%) brightness(60%);
height: 90%;
top: 0;
bottom: 0;
right: 0;
}
.regex-table {
width: auto;
}
.regex-table .table-cell, .regex-table .table-head {
padding: 0.4em;
min-width: auto;
}
.regex-input {
height: 100%;
width: 100%;
border: 0;
margin: 0.2em;
padding: 0.2em;
color: var(--regex-input-fg-color);
background: var(--regex-input-bg-color);
}
.add-button, .delete-button {
padding: .4em;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
cursor: pointer;
transition: background-color 100ms linear;
overflow: hidden;
cursor: pointer;
outline: 0;
border: none;
border-radius: 0.2em;
}
.add-button {
margin-top: 0.4em;
color: var(--add-button-fg-color);
background-color: var(--add-button-bg-color);
}
.add-button:hover {
color: var(--add-button-hover-fg-color);
background-color: var(--add-button-hover-bg-color);
}
.delete-button {
color: var(--delete-button-fg-color);
background-color: var(--delete-button-bg-color);
}
.delete-button:hover {
color: var(--delete-button-hover-fg-color);
background-color: var(--delete-button-hover-bg-color);
}
.footnote {
padding: 0.2em;
margin-top: 2em;
font-size: 0.7em;
}
.caption-parent {
display: grid;
grid-template-areas: "subtitleLine ankiControls";
grid-template-rows: 100%;
grid-template-columns: 100% 0%;
}
.anki-export {
display: none;
}
#app *::-webkit-scrollbar {
width: 1vh;
height: 1vh;
background-color: var(--scrollbar-gutter-color);
}
#app *::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb-color);
}
#app * {
scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-gutter-color);
scrollbar-width: thin;
}
[data-pseudo-content]::before {
content: attr(data-pseudo-content);
}
</style>
</head>
<body>
<div
id="app"
@mousedown="onMouseDown"
@mouseup="onMouseUp"
@mousemove="onMouseMove"
@mouseout="onMouseOut"
>
<div
id="animebook-drop-wrapper"
class="drop-wrapper"
:class="dropWrapperClass"
@dragover.stop.prevent="onFileDragover"
@dragleave.stop.prevent="onFileDragleave"
@drop.stop.prevent="onFileDrop"
>
<div class="app-container" :style="calcAppStyle()" v-cloak>
<input
id="ab-file-browse-input"
@change="onFileInputChange"
type="file"
accept=".srt,.ass,.vtt,.mp3,.m4a,.aac,.flac,.ogg,.wav,.opus,.mkv,.mp4,.avi"
multiple
hidden
/>
<div style="display: none;">
<svg id="svg-library" viewBox="0 0 1792 1792">
<path id="plus-svg" d="M9.5 7.5v-1q0-0.203-0.148-0.352t-0.352-0.148h-2v-2q0-0.203-0.148-0.352t-0.352-0.148h-1q-0.203 0-0.352 0.148t-0.148 0.352v2h-2q-0.203 0-0.352 0.148t-0.148 0.352v1q0 0.203 0.148 0.352t0.352 0.148h2v2q0 0.203 0.148 0.352t0.352 0.148h1q0.203 0 0.352-0.148t0.148-0.352v-2h2q0.203 0 0.352-0.148t0.148-0.352zM12 7q0 1.633-0.805 3.012t-2.184 2.184-3.012 0.805-3.012-0.805-2.184-2.184-0.805-3.012 0.805-3.012 2.184-2.184 3.012-0.805 3.012 0.805 2.184 2.184 0.805 3.012z"></path>
<path id="spinner-svg" d="M526 1394q0 53-37.5 90.5t-90.5 37.5q-52 0-90-38t-38-90q0-53 37.5-90.5t90.5-37.5 90.5 37.5 37.5 90.5zm498 206q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-704-704q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm1202 498q0 52-38 90t-90 38q-53 0-90.5-37.5t-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-964-996q0 66-47 113t-113 47-113-47-47-113 47-113 113-47 113 47 47 113zm1170 498q0 53-37.5 90.5t-90.5 37.5-90.5-37.5-37.5-90.5 37.5-90.5 90.5-37.5 90.5 37.5 37.5 90.5zm-640-704q0 80-56 136t-136 56-136-56-56-136 56-136 136-56 136 56 56 136zm530 206q0 93-66 158.5t-158 65.5q-93 0-158.5-65.5t-65.5-158.5q0-92 65.5-158t158.5-66q92 0 158 66t66 158z"/>
<path id="success-svg" d="M1412 734q0-28-18-46l-91-90q-19-19-45-19t-45 19l-408 407-226-226q-19-19-45-19t-45 19l-91 90q-18 18-18 46 0 27 18 45l362 362q19 19 45 19 27 0 46-19l543-543q18-18 18-45zm252 162q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z"/>
<path id="alert-svg" d="M896 128q209 0 385.5 103t279.5 279.5 103 385.5-103 385.5-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103zm128 1247v-190q0-14-9-23.5t-22-9.5h-192q-13 0-23 10t-10 23v190q0 13 10 23t23 10h192q13 0 22-9.5t9-23.5zm-2-344l18-621q0-12-10-18-10-8-24-8h-220q-14 0-24 8-10 6-10 18l17 621q0 10 10 17.5t24 7.5h185q14 0 23.5-7.5t10.5-17.5z"/>
</svg>
</div>
<div class="video-subtitles-missing hint" v-show="!videoUrl && !captionsUrl">
<p>Drag-and-drop a video file and subtitle file to this page, or <a href="#" @click="onFileBrowse">browse</a></p>
</div>
<div class="video-missing" v-show="!videoUrl && captionsUrl && !shouldShowVideoError">
<div class="hint">
<p>Drag-and-drop a video file, or <a href="#" @click="onFileBrowse">browse</a></p>
</div>
</div>
<div class="subtitles-missing" v-show="videoUrl && !captionsUrl && !shouldShowSubtitlesError">
<div class="hint">
<p>Drag-and-drop a subtitles file (vtt, srt or ass), or <a href="#" @click="onFileBrowse">browse</a></p>
</div>
</div>
<div class="video-error" v-show="shouldShowVideoError">
<div class="hint">
<div>
There was an error loading the video file {{videoFileName}}.
Try a different file. Note that your browser may not support certain file formats like HEVC/H.265 video or AC3 audio.
See <a href="#" @click="toggleHelp(); enableHelpMode('tips')" class="monospace unselectable">Tips</a>.
</div>
<br>
<div style="font-size: 1.5rem;" v-if="videoErrorMessage">
Browser error message: <span class="monospace">{{videoErrorMessage}}</span>
</div>
</div>
</div>
<div class="subtitles-error" v-show="shouldShowSubtitlesError">
<div class="hint">
There was an error parsing the subtitles file {{subtitlesFileName}}.
<span v-if="subtitlesError">{{subtitlesError}}</span>
</div>
</div>
<div :class="notifyTextClass" v-if="notifyText" v-html="notifyText"></div>
<div :class="videoContainerClass" v-show="videoUrl && !shouldShowVideoError">
<video
id="ab-video-element"
class="video-element"
:style="videoStyle"
:src="videoUrl"
@error="onVideoError"
@timeupdate="onTimeUpdate"
crossorigin="anonymous"
:controls="savedSettings.showVideoControls"
disablePictureInPicture
disabled
tabIndex="-1"
@focus="onVideoFocus"
@click="onVideoClick"
@seeked="onVideoSeek"
@loadeddata="onVideoLoad"
:key="videoKey"
>
<track
v-if="captionsUrl"
:key="trackKey"
kind="subtitles"
:src="captionsUrl"
@load="onCaptionsLoad"
@cuechange="onCaptionsCueChange"
default
/>
</video>
<span class="current-caption" :style="'font-size: calc(' + (3.5 * savedSettings.subtitleFontSize) + 'vmin + 1.50rem);'" :key="shownCaptionsKey" lang="ja" v-html="displayedHtml"></span>
</div>
<span id="ab-meta-data" style="display: none;" :data-audio-track="selectedAudioTrack || 0"></span>
<div id="resize-bar-wrapper" class="resize-bar-wrapper" lang="ja">
<div id="ab-extension-popup-wrapper">
</div>
<div
class="resize-bar"
@click.stop.prevent="onResizeBarClick"
@mousedown.stop.prevent="onResizeBarMouseDown">
</div>
</div>
<div class="sidebar">
<caption-bar
@select-caption="selectCaption"
@set-custom-offset="setCustomOffset"
:captions="captions"
:custom-offsets="customOffsets"
:is-auto-pause-mode="isAutoPauseMode"
:is-offset-mode="isOffsetMode"
:current-time="currentTime"
v-if="captionsUrl"
></caption-bar>
<div v-if="captionsUrl && isOffsetMode" class="offset-hint unselectable">Select the subtitle that ends where the video currently is: {{displayAsVideoTime(currentTime)}}</div>
<div class="auto-pause-text unselectable" v-if="isAutoPauseMode">Auto Pause <span style="display: inline-block;">:</span><span v-html="autoPauseIcon"></span></div>
<div v-if="captionsUrl" class="controls">
<a tabindex="4" :class="helpClass" @click="toggleHelp(); enableHelpMode('hotkeys')"><span>?</span></a>
<a v-if="audioTracks && audioTracks.length > 1" tabindex="3" :class="audioTrackClass" @click="cycleAudioTrack()"><span>{{selectedAudioTrack + 1}}/{{audioTracks.length}}</span></a>
<input form="novalidatedform" type="number" step="0.1" tabindex="2" @keydown="onInputKeyDown" @wheel="onOffsetInputScroll" class="offset-input" v-model="subtitlesOffsetInput"></input>
<a tabindex="1" :class="offsetButtonClass" @click="toggleOffsetMode()">
<span class="offset-text">{{this.isOffsetMode ? 'Cancel' : 'Offset Subtitles'}}</span>
</a>
</div>
</div>
<div v-if="shouldShowHelpPopup" class="help-popup">
<div class="exit-popup unselectable" @click="toggleHelp()">×</div>
<div class="help-mode-tab-container">
<div :class="helpButtonClass('hotkeys')" @click="enableHelpMode('hotkeys')">Hotkeys</div>
<div :class="helpButtonClass('appearance')" @click="enableHelpMode('appearance')">Appearance</div>
<div :class="helpButtonClass('tips')" @click="enableHelpMode('tips')">Tips</div>
<div :class="helpButtonClass('anki-automatic-export')" @click="enableHelpMode('anki-automatic-export')">Anki Export</div>
</div>
<div v-if="helpMode === 'hotkeys'" class="help-inner">
<div class="table">
<div class="table-row"><div class="table-head">Command</div><div class="table-head">Description</div></div>
<div class="table-row"><div class="table-cell">Left/Right</div><div class="table-cell">Move backward/forward</div></div>
<div class="table-row"><div class="table-cell">Up/Down</div><div class="table-cell">Move backward/forward</div></div>
<div class="table-row"><div class="table-cell">Space</div><div class="table-cell">Pause/Play</div></div>
<div class="table-row"><div class="table-cell">Enter</div><div class="table-cell">Replay caption</div></div>
<div class="table-row"><div class="table-cell">a</div><div class="table-cell">Toggle auto pause mode</div></div>
<div class="table-row"><div class="table-cell">\</div><div class="table-cell">Skip next auto pause. Only applies in auto pause mode.</div></div>
<div class="table-row"><div class="table-cell">v</div><div class="table-cell">Toggle subtitle visibility on/off</div></div>
<div class="table-row"><div class="table-cell">c</div><div class="table-cell">Copy current subtitle text to clipboard</div></div>
<div class="table-row"><div class="table-cell">s</div><div class="table-cell">Copy screenshot of video to clipboard</div></div>
<div class="table-row"><div class="table-cell">,</div><div class="table-cell">Move video to the middle of the previous caption and take a screenshot. Hold 'Shift' to move only.</div></div>
<div class="table-row"><div class="table-cell">.</div><div class="table-cell">Move video to the middle of the next caption and take a screenshot. Hold 'Shift' to move only.</div></div>
<div class="table-row"><div class="table-cell">b (or double click sidebar edge)</div><div class="table-cell">Collapse/expand sidebar</div></div>
<div class="table-row"><div class="table-cell">h</div><div class="table-cell">Hide content in parentheses (configurable in the 'Appearance' tab)</div></div>
<div class="table-row"><div class="table-cell">?</div><div class="table-cell">Open help menu</div></div>
<div class="table-row"><div class="table-cell">t</div><div class="table-cell">Cycle through available audio tracks. Currently (as of July 2020), this only works in Chrome and other chromium-based browsers if <span class="monospace">enable-experimental-web-platform-features</span> is enabled in chrome://flags. On Firefox, <span class="monospace">media.track.enabled</span> must be set to true in about:config.</div></div>
<div class="table-row"><div class="table-cell">- / =</div><div class="table-cell">Decrease/Increase subtitle font size</div></div>
<div class="table-row"><div class="table-cell">Page Up/Page Down</div><div class="table-cell">OP Skip. Move backward/forward 87 seconds.</div></div>
<div class="table-row"><div class="table-cell">m / n</div><div class="table-cell">Increase/Decrease playback speed.</div></div>
<div class="table-row"><div class="table-cell">F11</div><div class="table-cell">Full screen toggle. This is a browser shortcut.</div></div>
<div class="table-row"><div class="table-cell">Shift D</div><div class="table-cell">Download retimed subs as an srt file</div></div>
<div class="table-row"><div class="table-cell">e</div><div class="table-cell">Add context to most recent anki card (requires the <a target="_blank" href="https://chrome.google.com/webstore/detail/animebook-anki-export/ohcbgkombhgcbjcikjlgdmjkpibafppa">Animebook Chrome extension</a> to be installed)</div></div>
</div>
</div>
<div v-if="helpMode === 'appearance'" class="help-inner" style="font-size: 1.2rem;">
<h3 class="monospace error" v-if="!isLocalStorageAvailable">
Error: could not load appearance settings from local storage. Your browser may be blocking sites from storing data in your browser.
</h3>
<h3 style="margin-bottom: 0.2rem;">Video alignment</h3>
<p style="margin-left: 1rem; margin-top: 0.2rem;">
<input type="radio" id="video-top" value="top" v-model="savedSettings.videoAlignment">
<label for="video-top">Top</label>
<br>
<input type="radio" id="video-center" value="center" v-model="savedSettings.videoAlignment">
<label for="video-center">Center</label>
</p>
<p>
<input type="checkbox" id="show-video-controls" v-model="savedSettings.showVideoControls">
<label for="show-video-controls">Show video controls on page open (play/pause, volume control, etc.)</label>
</p>
<p>
<h3 style="margin-bottom: 0.1rem;">Subtitle font size</h3>
<input style="width: 30%;" type="range" min="0.1" max="3.0" step="0.1" id="subtitle-font-size" v-model.number="savedSettings.subtitleFontSize">
<label for="subtitle-font-size">{{(this.savedSettings.subtitleFontSize * 100).toFixed(0)}}%</label>
</p>
<p>
<h3 style="margin-bottom: 0.1rem;">Hide text matching regex</h4>
<div style="margin-left: 1rem;">
<p>
Whenever you hit the <span class="monospace">h</span> key, any text content matching these regexes will be hidden.
Defaults to hiding parentheses.
</p>
<div class="regex-table table">
<div class="table-row">
<div class="table-head">Regex to hide</div>
<div class="table-head"></div>
</div>
<div v-for="(replacement, index) in savedSettings.regexReplacements" class="table-row">
<div class="table-cell"><input type="text" class="regex-input" v-model="replacement.regex"></div>
<div class="table-cell"><button @click="removeRegexReplacement(index)" class="delete-button unselectable">Delete</button></div>
</div>
</div>
<button @click="addRegexReplacement()" class="add-button unselectable">+ Add regex</button>
</div>
</p>
<p class="footnote">*Settings are stored in the browser's local storage. For Ungoogled Chromium users, these settings may not stick across browser sessions, since the default setting is to "Clear cookies and site data when you close all windows".</p>
</div>
<div v-if="helpMode === 'tips'" class="help-inner">
<h3>Video format support (last update January 2023)</h3>
<p>
If you find your video can't play, or that your video will play but there's no audio, it's almost always because your browser can't play the file's video or audio codec. This is the case with HEVC/H.265 video and AC3 audio, which browsers still have trouble supporting due to licensing issues. Current state of browser support:
</p>
<div class="table">
<div class="table-row"><div class="table-cell"><a target="_blank" href="https://chromium.woolyss.com">Marmaduke all-codecs+ builds of Chromium (Windows)</a></div><div class="table-cell">Will play almost any file</div></div>
<div class="table-row"><div class="table-cell">Chrome and other Chromium based browsers (Windows/Mac)</div><div class="table-cell">Will play almost any file that doesn't use AC3 audio</div></div>
<div class="table-row"><div class="table-cell">Microsoft Edge</div><div class="table-cell">Uses Chromium and technically supports AC3 audio, but I had visual jittering issues when I tried it with HEVC video; this may be because I didn't buy HEVC Video Extensions from the Microsoft Store*</div></div>
<div class="table-row"><div class="table-cell">Chromium based browsers (Linux)</div><div class="table-cell">Support for HEVC video is spotty at the moment, but some browsers like <a target="_blank" href="https://github.com/Alex313031/Thorium">Thorium</a> support it. AC3 audio is not supported</div></div>
<div class="table-row"><div class="table-cell">Firefox</div><div class="table-cell">Will play few video formats</div></div>
<div class="table-row"><div class="table-cell">Everything else</div><div class="table-cell">Probably not a good option</div></div>
</div>
<p>
So, if you want animebook to play basically everything, the Marmaduke all-codecs+ builds of chromium are your best bet, and you can install Yomichan on it (instructions below). However, these builds are only made for Windows, and I'm unaware of a way to get a Chromium build for OSX or Linux with both the HEVC and AC3 flags enabled (other than by compiling Chromium yourself). So for lack of a good option at the moment, I'll deflect to suggesting <a target="_blank" href="https://github.com/Alex313031/Thorium">Thorium</a> if you're not on Windows, which does support HEVC video. Just not AC3 audio, which is relatively rare for anime releases anyway.
</p>
<p>
Marmaduke Chromium installation instructions:
<ol>
<li>Find and install a Marmaduke all-codecs+ build of Chromium on <a target="_blank" href="https://chromium.woolyss.com">https://chromium.woolyss.com</a>. Make sure both the tags "Marmaduke" and "all-codecs+" (with the <b>PLUS</b> sign) are tagged on the release.</li>
<li>Enable the Chrome web store, by manually installing <a target="_blank" href="https://github.com/NeverDecaf/chromium-web-store">https://github.com/NeverDecaf/chromium-web-store</a> into Chromium (this is required because the Chromium build is ungoogled)</li>
</ol>
*I used to recommend Microsoft Edge with HEVC Video Extensions to watch HEVC video on animebook, but as of October 2020 the Microsoft store started charging money for HEVC support, so I removed it from the browser list. It technically does support AC3 audio though, unlike Ungoogled Chromium.
</p>