-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.html
861 lines (727 loc) · 40.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=M+PLUS+1p" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=M+PLUS+Rounded+1c" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Hachi+Maru+Pop" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Yusei+Magic" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Reggae+One" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+JP" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Sawarabi+Gothic" rel="stylesheet">
<link href="https://fonts.googleapis.com/earlyaccess/nicomoji.css" rel="stylesheet">
<link href="./font.css" rel="stylesheet">
<link rel="icon" href="./img/favicon2/favicon.ico" />
<script src="js/bouyomichan_client.js"></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5RNP0LDER8"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-5RNP0LDER8');
</script>
<!-- END: Google tag (gtag.js) -->
<title>jimakuChan: 音声認識字幕ちゃん [CONFIG]</title>
<style type="text/css">
button, input, select, textarea {
/* font-family : inherit; */
/* font-family: 'メイリオ', Meiryo,sans-serif; */
/* font-size : 300%; */
/* color : black; */
font-weight : 0;
/*text-align : center; /* left, center, right */
vertical-align : top; /* top, middle, bottom */
-webkit-text-stroke-color: rgb(21, 0, 141);
-webkit-text-stroke-width: 0px;
}
html {
height: 100%;
width: 100%;
}
body {
height: 100%;
width: 100%;
margin: 0;
font-family: 'M PLUS Rounded 1c', sans-serif;
/* font-family:'07NikumaruFont'; */
}
table {
width: 100%;
/* table-layout: fixed; */
}
table.btm_table {
position:absolute;
/* bottom:0; */
}
table td {
/*word-break: break-all;*/
overflow-wrap : break-word;
}
</style>
<style>
/* prepare the selectors to add a stroke to */
.stroke-single-imb{
/* position: absolute; */
left: 0;
right: 0;
margin: 0;
/* -webkit-text-stroke: 0px #0000FF; */
}
.stroke-single-bg{
position: absolute;
left: 0;
right: 0;
margin: auto;
/* -webkit-text-stroke: 3px #FF0000; */
}
/* add a single stroke */
.stroke-single-fg{
position: absolute;
left: 0;
right: 0;
margin: auto;
/* -webkit-text-stroke: 0px #FFFFFF; */
}
</style>
</head>
<body>
<!-- # 注意事項 ######################### -->
<!-- <iframe src="" name="sample" width="100%" height="30%" id="asr_frame" onclick="toggleIframeHeight()"></iframe> -->
<iframe src="" name="sample" width="100%" height="30%" id="asr_frame"></iframe>
上の画面をクリックすると設定画面が閉じ,もう一度押すと再度開きます.<BR>
<HR>
<!-- # 設定セーブ&ロードボタン ################## -->
<button onclick="saveSettings()">設定ファイルをPCに保存</button>
<button onclick="loadSettings()">設定ファイルをブラウザに読込</button> :設定が完成したら,設定ファイルを保存しておきましょう <BR>
<HR>
<!-- # API key text box ##################### -->
翻訳用 Google API-KEY: <input type="text" name="gas_key" id="gas_key" size="60" oninput="updateOptionValues();" /> キーの作成方法 → <a target="_blank" href="http://www.sayonari.com/trans_asr/index_asr.html">[LINK]</a><BR>
翻訳回数:<div id="displayTransCount" style="display: inline-block; _display: inline;"></div><font color="gray">(上限 無料:5,000回,有料:20,000回)←僕じゃなくてGoogle にお金払う</font><BR>
<HR>
<!-- # 背景の色 ############################## -->
文字色 フチ色<BR>
認識 :<input id="color1" type="color" value="#ffffff" oninput="changeTextColor('fg',this.value,1); updateOptionValues(only_url=true)" />
<input id="st_color1" type="color" value="#000000" oninput="changeTextColor('bg',this.value,1); updateOptionValues(only_url=true)" />
背景色:<input id="bgcolor" type="color" value="#00ff00" oninput="document.getElementById('asr_frame').contentWindow.document.bgColor=this.value; changeTextColor('imb',this.value,1); updateOptionValues(only_url=true)" />
<BR>
翻訳1:<input id="color2" type="color" value="#ffffff" oninput="changeTextColor('fg',this.value,2); updateOptionValues(only_url=true)" />
<input id="st_color2" type="color" value="#000000" oninput="changeTextColor('bg',this.value,2); updateOptionValues(only_url=true)" /><BR>
翻訳2:<input id="color3" type="color" value="#ffffff" oninput="changeTextColor('fg',this.value,3); updateOptionValues(only_url=true)" />
<input id="st_color3" type="color" value="#000000" oninput="changeTextColor('bg',this.value,3); updateOptionValues(only_url=true)" /><BR>
翻訳3:<input id="color4" type="color" value="#ffffff" oninput="changeTextColor('fg',this.value,4); updateOptionValues(only_url=true)" />
<input id="st_color4" type="color" value="#000000" oninput="changeTextColor('bg',this.value,4); updateOptionValues(only_url=true)" /><BR>
<HR>
<!-- # テキストフォント ########################
フォント名: <input type="text" name="font" id="font" size="60" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('result_text').style.fontFamily = getParam('font'); updateOptionValues()"><BR>
-->
<!-- # テキストサイズ ######################### -->
サイズ ウェイト 縁取り <BR>
認識 :
<input id="size1" type="range" value="25" min="0" max="40" step="0.1" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('speech_text').style.fontSize = this.value + 'pt'; document.getElementById('text_size_view1').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_size_view1">25</span>px
<input id="weight1" type="range" value="900" min="100" max="900" step="100" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('speech_text').style.fontWeight = this.value; document.getElementById('text_weight_view1').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_weight_view1">900</span>
<input id="st_width1" type="range" value="6" min="0" max="20" step="0.1" oninput="setTextBorder(this.value,1); document.getElementById('text_st_size_view1').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_st_size_view1">6</span>pt
<BR>
翻訳1:
<input id="size2" type="range" value="25" min="0" max="40" step="0.1" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text').style.fontSize = this.value + 'pt'; document.getElementById('text_size_view2').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_size_view2">25</span>px
<input id="weight2" type="range" value="900" min="100" max="900" step="100" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text').style.fontWeight = this.value; document.getElementById('text_weight_view2').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_weight_view2">900</span>
<input id="st_width2" type="range" value="6" min="0" max="20" step="0.1" oninput="setTextBorder(this.value,2); document.getElementById('text_st_size_view2').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_st_size_view2">6</span>pt
<BR>
翻訳2:
<input id="size3" type="range" value="25" min="0" max="40" step="0.1" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text2').style.fontSize = this.value + 'pt'; document.getElementById('text_size_view3').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_size_view3">25</span>px
<input id="weight3" type="range" value="900" min="100" max="900" step="100" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text2').style.fontWeight = this.value; document.getElementById('text_weight_view3').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_weight_view3">900</span>
<input id="st_width3" type="range" value="6" min="0" max="20" step="0.1" oninput="setTextBorder(this.value,3); document.getElementById('text_st_size_view3').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_st_size_view3">6</span>pt
<BR>
翻訳3:
<input id="size4" type="range" value="25" min="0" max="40" step="0.1" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text3').style.fontSize = this.value + 'pt'; document.getElementById('text_size_view4').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_size_view4">25</span>px
<input id="weight4" type="range" value="900" min="100" max="900" step="100" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text3').style.fontWeight = this.value; document.getElementById('text_weight_view4').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_weight_view4">900</span>
<input id="st_width4" type="range" value="6" min="0" max="20" step="0.1" oninput="setTextBorder(this.value,4); document.getElementById('text_st_size_view4').innerHTML=this.value; updateOptionValues(only_url=true)" />
<span id="text_st_size_view4">6</span>pt
<BR>
<HR>
<!-- # テキストの揃え ######################### -->
テキストの位置:
左右:
<select id="textAlign" onchange="updateOptionValues()">
<option value="left">左寄せ</option>
<option value="center" selected>中央寄せ</option>
<option value="right">右寄せ</option>
</select>
上下:
<select id="v_align" onchange="updateOptionValues()">
<option value="top" selected>上</option>
<option value="bottom">下</option>
</select><BR>
<!-- # テキストの改行 ######################### -->
テキストの改行:
<select id="whiteSpace" onchange="updateOptionValues()">
<option value="nowrap">改行しない</option>
<option value="" selected>画面端で改行</option>
</select><BR>
<HR>
<!-- # テキスト表示項目 ####################### -->
音声認識言語 :
<select id="recog" onchange="updateOptionValues(only_url=false);">
<option value="ja" selected>日本語</option>
<option value="en">英語</option>
<option value="ko">韓国語</option>
<option value="zh-CN">中国語</option>
<option value="zh-TW">台湾語</option>
<option value="fr">フランス語</option>
<option value="it">イタリア語</option>
<option value="de">ドイツ語</option>
<option value="tr">トルコ語</option>
<option value="sv">スウェーデン語</option>
<option value="pl">ポーランド語</option>
<option value="uk">ウクライナ語</option>
<option value="ru">ロシア語</option>
<option value="es">スペイン語</option>
<option value="pt">ポルトガル語</option>
<option value="nl">オランダ語</option>
<option value="id">インドネシア語</option>
<option value="vi">ベトナム語</option>
<option value="th">タイ語</option>
<option value="ar">アラビア語</option>
<option value="so">ソマリ語</option>
</select>
フォント :
<select name="speech_text_font_selector" id="speech_text_font_selector" onchange="document.getElementById('asr_frame').contentWindow.document.getElementById('speech_text').style.fontFamily = this.value; selectFont();">
<option value="direct">[直接指定]</option>
<option value="M PLUS\ 1p">M PLUS 1p</option>
<option value="M PLUS Rounded\ 1c" selected>M PLUS Rounded 1c</option>
<option value="Mamelon">マメロン</option>
<option value="YasashisaB">やさしさB</option>
<option value="HuiFont29">ふい字</option>
<option value="Hachi Maru Pop">Hachi Maru Pop</option>
<option value="MkPOP">851マカポップ</option>
<option value="bananaslipplus">バナナスリップplus</option>
<option value="katyou">花鳥風月</option>
<option value="TanukiMagic">たぬき油性マジック</option>
<option value="hakidame">吐き溜</option>
<option value="umeboshi">梅干し</option>
<option value="Jiyucho">じゆうちょう</option>
<option value="HitmoR">Hitmo</option>
<option value="nishikiteki">にしき的</option>
<option value="Yusei Magic">Yusei Magic</option>
<option value="Nikumaru">にくまる</option>
<option value="KTEGAKI">kawaii手書き</option>
<option value="JKGL">JK Gothic L</option>
<option value="Reggae One">Reggae One</option>
<option value="OhisamaFont">おひさま</option>
<option value="nukamiso">ぬかみそ</option>
<option value="genkai">源界明朝</option>
<option value="CP">チェックポイント</option>
<option value="Noto Sans JP">Noto Sans JP</option>
<option value="Sawarabi Gothic">さわらびゴシック</option>
<option value="Nico Moji">ニコモジ</option>
</select>
フォント(直接指定):<input type="text" name="speech_text_font" id="speech_text_font" size="30" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('speech_text').style.fontFamily = this.value; updateOptionValues();" disabled /><br>
翻訳言語(1):
<select id="trans" onchange="updateOptionValues(only_url=false);">
<option value="none">なし</option>
<option value="ja">日本語</option>
<option value="en" selected>英語</option>
<option value="ko">韓国語</option>
<option value="zh-CN">中国語</option>
<option value="zh-TW">台湾語</option>
<option value="fr">フランス語</option>
<option value="it">イタリア語</option>
<option value="de">ドイツ語</option>
<option value="tr">トルコ語</option>
<option value="sv">スウェーデン語</option>
<option value="pl">ポーランド語</option>
<option value="uk">ウクライナ語</option>
<option value="ru">ロシア語</option>
<option value="es">スペイン語</option>
<option value="pt">ポルトガル語</option>
<option value="nl">オランダ語</option>
<option value="id">インドネシア語</option>
<option value="vi">ベトナム語</option>
<option value="th">タイ語</option>
<option value="ar">アラビア語</option>
<option value="so">ソマリ語</option>
</select>
フォント :
<select name="trans_text_font_selector" id="trans_text_font_selector" onchange="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text').style.fontFamily = this.value; selectFont();">
<option value="direct">[直接指定]</option>
<option value="M PLUS\ 1p">M PLUS 1p</option>
<option value="M PLUS Rounded\ 1c" selected>M PLUS Rounded 1c</option>
<option value="Mamelon">マメロン</option>
<option value="YasashisaB">やさしさB</option>
<option value="HuiFont29">ふい字</option>
<option value="Hachi Maru Pop">Hachi Maru Pop</option>
<option value="MkPOP">851マカポップ</option>
<option value="bananaslipplus">バナナスリップplus</option>
<option value="katyou">花鳥風月</option>
<option value="TanukiMagic">たぬき油性マジック</option>
<option value="hakidame">吐き溜</option>
<option value="umeboshi">梅干し</option>
<option value="Jiyucho">じゆうちょう</option>
<option value="HitmoR">Hitmo</option>
<option value="nishikiteki">にしき的</option>
<option value="Yusei Magic">Yusei Magic</option>
<option value="Nikumaru">にくまる</option>
<option value="KTEGAKI">kawaii手書き</option>
<option value="JKGL">JK Gothic L</option>
<option value="Reggae One">Reggae One</option>
<option value="OhisamaFont">おひさま</option>
<option value="nukamiso">ぬかみそ</option>
<option value="genkai">源界明朝</option>
<option value="CP">チェックポイント</option>
<option value="Noto Sans JP">Noto Sans JP</option>
<option value="Sawarabi Gothic">さわらびゴシック</option>
<option value="Nico Moji">ニコモジ</option>
</select>
フォント(直接指定):<input type="text" name="trans_text_font" id="trans_text_font" size="30" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text').style.fontFamily = this.value; updateOptionValues();" disabled /><br>
翻訳言語(2):
<select id="trans2" onchange="updateOptionValues(only_url=false);">
<option value="none" selected>なし</option>
<option value="ja">日本語</option>
<option value="en">英語</option>
<option value="ko">韓国語</option>
<option value="zh-CN">中国語</option>
<option value="zh-TW">台湾語</option>
<option value="fr">フランス語</option>
<option value="it">イタリア語</option>
<option value="de">ドイツ語</option>
<option value="tr">トルコ語</option>
<option value="sv">スウェーデン語</option>
<option value="pl">ポーランド語</option>
<option value="uk">ウクライナ語</option>
<option value="ru">ロシア語</option>
<option value="es">スペイン語</option>
<option value="pt">ポルトガル語</option>
<option value="nl">オランダ語</option>
<option value="id">インドネシア語</option>
<option value="vi">ベトナム語</option>
<option value="th">タイ語</option>
<option value="ar">アラビア語</option>
<option value="so">ソマリ語</option>
</select>
フォント :
<select name="trans_text2_font_selector" id="trans_text2_font_selector" onchange="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text2').style.fontFamily = this.value; selectFont();">
<option value="direct">[直接指定]</option>
<option value="M PLUS\ 1p">M PLUS 1p</option>
<option value="M PLUS Rounded\ 1c" selected>M PLUS Rounded 1c</option>
<option value="Mamelon">マメロン</option>
<option value="YasashisaB">やさしさB</option>
<option value="HuiFont29">ふい字</option>
<option value="Hachi Maru Pop">Hachi Maru Pop</option>
<option value="MkPOP">851マカポップ</option>
<option value="bananaslipplus">バナナスリップplus</option>
<option value="katyou">花鳥風月</option>
<option value="TanukiMagic">たぬき油性マジック</option>
<option value="hakidame">吐き溜</option>
<option value="umeboshi">梅干し</option>
<option value="Jiyucho">じゆうちょう</option>
<option value="HitmoR">Hitmo</option>
<option value="nishikiteki">にしき的</option>
<option value="Yusei Magic">Yusei Magic</option>
<option value="Nikumaru">にくまる</option>
<option value="KTEGAKI">kawaii手書き</option>
<option value="JKGL">JK Gothic L</option>
<option value="Reggae One">Reggae One</option>
<option value="OhisamaFont">おひさま</option>
<option value="nukamiso">ぬかみそ</option>
<option value="genkai">源界明朝</option>
<option value="CP">チェックポイント</option>
<option value="Noto Sans JP">Noto Sans JP</option>
<option value="Sawarabi Gothic">さわらびゴシック</option>
<option value="Nico Moji">ニコモジ</option>
</select>
フォント(直接指定):<input type="text" name="trans_text2_font" id="trans_text2_font" size="30" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text2').style.fontFamily = this.value; updateOptionValues();" disabled /><br>
翻訳言語(3):
<select id="trans3" onchange="updateOptionValues(only_url=false);">
<option value="none" selected>なし</option>
<option value="ja">日本語</option>
<option value="en">英語</option>
<option value="ko">韓国語</option>
<option value="zh-CN">中国語</option>
<option value="zh-TW">台湾語</option>
<option value="fr">フランス語</option>
<option value="it">イタリア語</option>
<option value="de">ドイツ語</option>
<option value="tr">トルコ語</option>
<option value="sv">スウェーデン語</option>
<option value="pl">ポーランド語</option>
<option value="uk">ウクライナ語</option>
<option value="ru">ロシア語</option>
<option value="es">スペイン語</option>
<option value="pt">ポルトガル語</option>
<option value="nl">オランダ語</option>
<option value="id">インドネシア語</option>
<option value="vi">ベトナム語</option>
<option value="th">タイ語</option>
<option value="ar">アラビア語</option>
<option value="so">ソマリ語</option>
</select>
フォント :
<select name="trans_text3_font_selector" id="trans_text3_font_selector" onchange="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text3').style.fontFamily = this.value; selectFont();">
<option value="direct">[直接指定]</option>
<option value="M PLUS\ 1p">M PLUS 1p</option>
<option value="M PLUS Rounded\ 1c" selected>M PLUS Rounded 1c</option>
<option value="Mamelon">マメロン</option>
<option value="YasashisaB">やさしさB</option>
<option value="HuiFont29">ふい字</option>
<option value="Hachi Maru Pop">Hachi Maru Pop</option>
<option value="MkPOP">851マカポップ</option>
<option value="bananaslipplus">バナナスリップplus</option>
<option value="katyou">花鳥風月</option>
<option value="TanukiMagic">たぬき油性マジック</option>
<option value="hakidame">吐き溜</option>
<option value="umeboshi">梅干し</option>
<option value="Jiyucho">じゆうちょう</option>
<option value="HitmoR">Hitmo</option>
<option value="nishikiteki">にしき的</option>
<option value="Yusei Magic">Yusei Magic</option>
<option value="Nikumaru">にくまる</option>
<option value="KTEGAKI">kawaii手書き</option>
<option value="JKGL">JK Gothic L</option>
<option value="Reggae One">Reggae One</option>
<option value="OhisamaFont">おひさま</option>
<option value="nukamiso">ぬかみそ</option>
<option value="genkai">源界明朝</option>
<option value="CP">チェックポイント</option>
<option value="Noto Sans JP">Noto Sans JP</option>
<option value="Sawarabi Gothic">さわらびゴシック</option>
<option value="Nico Moji">ニコモジ</option>
</select>
フォント(直接指定):<input type="text" name="trans_text3_font" id="trans_text3_font" size="30" oninput="document.getElementById('asr_frame').contentWindow.document.getElementById('trans_text3').style.fontFamily = this.value; updateOptionValues();" disabled /><br>
<HR>
<!-- # テキスト表示を●秒後に消す ######################### -->
何ミリ秒後に文を消す? :
<input type="text" name="timer" id="timer" size="10" oninput="updateOptionValues();" />ミリ秒(半角数字で入れてね.1000ミリ秒 = 1秒)<BR>
<!-- # 文の終わり ######################### -->
何ミリ秒黙ったら文を区切る?:
<input type="text" name="short_pause" value="750" id="short_pause" size="10" oninput="updateOptionValues();" />ミリ秒(半角数字で入れてね.1000ミリ秒 = 1秒)<BR>
(500:すぐ切る|750:普通|1000:つなぐ 調整して.何も入れないと,これまでと同じ動作になる.)<BR>
<HR>
<!-- # 棒読みちゃん連携 ######################### -->
- 棒読みちゃん連携を使う:<input type="checkbox" id="bouyomi" onchange="updateOptionValues()"> ← 使う場合チェック入れる.詳細 → <a target="_blank" href="https://twitter.com/sayonari/status/1386937837682003968">twitter</a><BR>
<!-- # センシティブワード対応する! ######################### -->
- センシティブワード対応(***に置き換え)を<font color="red">やめる</font>:<input type="checkbox" id="anti_sexual" onchange="updateOptionValues()"> <BR>
<HR>
<!-- # URL view & copy button ############### -->
<!-- URL : -->
<!-- <textarea name="url" id="url" rows="7" cols="90"></textarea><BR> -->
<!-- <input type="button" value="copy to clipboard" id="textarea_copy" onclick="document.getElementsByTagName('textarea')[0].select();document.execCommand('copy');"> -->
<!-- <a id="open_link" target="_self" href="">[同じタブで開く]</a><BR>
別窓で開くと2つ起動して両方止まるよ!多重起動しないように気をつけて!<BR> -->
<!-- <HR> -->
<!-- # .bat download ボタン ############################## -->
.bat ファイル生成:<BR>
これ使ったら,<font color="red">全画面ゲームしてても止まらない!</font>詳しくはこちら→(<a target="_blank" href="https://www.youtube.com/watch?v=8-UXx_tVeYk">解説動画</a>)<BR>
.batファイルと,設定ファイルをダウンロードしてください.<BR>
<table border="1" style="width: auto;"><tr><td>
<table style="width: auto;">
<tr>
<td width="180">Windowsの人:</td>
<td><button onclick="generateBatFile('win')">Windows用 起動 .batファイル生成</button></td>
<td><button onclick="saveSettings()">設定ファイルをPCに保存</button></td>
</tr>
</tr>
</table>
</td></tr></table>
<BR>
<table border="1" style="width: auto;"><tr><td>
<table style="width: auto;">
<tr>
<td width="180">Macの人:</td>
<td><button onclick="generateBatFile('mac')">Mac用 起動 .commandファイル生成</button></td>
<td><button onclick="saveSettings()">設定ファイルをPCに保存</button></td>
</tr>
</table>
</td></tr></table>
<HR>
<!-- # dummy 見えない数字 ############################## -->
<input style="display: none;" type="text" name="frame_height" id="frame_height" value="30%" size="10" oninput="updateOptionValues();" />
<BR><BR><BR>
</div><BR>
</body>
<!-- # スクリプト ########################################### -->
<!-- # 字幕ちゃん設定項目のロードと,画面への反映 ############################## -->
<script type="text/javascript">
const currentURL = window.location.origin + window.location.pathname;
let base_url = currentURL.replace("index.html", "");
base_url += "main.html?";
base_url = base_url.replace("??", "?");
// config 値 一覧 ////////////////
config_values = ["gas_key", "textAlign", "v_align", "whiteSpace", "bgcolor", "frame_height"
, "recog", "size1", "weight1", "color1", "st_color1", "st_width1"
, "trans", "size2", "weight2", "color2", "st_color2", "st_width2"
, "trans2", "size3", "weight3", "color3", "st_color3", "st_width3"
, "trans3", "size4", "weight4", "color4", "st_color4", "st_width4"
, "timer", "short_pause"
, "bouyomi", "anti_sexual"
, "speech_text_font_selector", "trans_text_font_selector", "trans_text2_font_selector", "trans_text3_font_selector"
, "speech_text_font", "trans_text_font", "trans_text2_font", "trans_text3_font"];
// 翻訳画面とURLを初期化 ///////////////
document.getElementById('asr_frame').src = base_url;
// document.getElementById('url').innerHTML = base_url;
// 設定の復元 ////////////////////
const config = JSON.parse(localStorage.jimakuChan_config || '{}');
for (const p of config_values) {
if(config[p] != null) document.getElementById(p).value = config[p];
}
for (var i=0; i<3; i++) {
if(config['size' + String(i+1)] != null) document.getElementById('text_size_view' + String(i+1)).innerHTML = config['size' + String(i+1)];
if(config['weight' + String(i+1)] != null) document.getElementById('text_weight_view' + String(i+1)).innerHTML = config['weight' + String(i+1)];
if(config['st_width' + String(i+1)] != null) document.getElementById('text_st_size_view' + String(i+1)).innerHTML = config['st_width' + String(i+1)];
}
if (config['bouyomi'] !== null && config['bouyomi'] !== undefined) {
document.getElementById('bouyomi').checked = config['bouyomi'];
}
if (config['anti_sexual'] !== null && config['anti_sexual'] !== undefined) {
document.getElementById('anti_sexual').checked = config['anti_sexual'];
}
if (config['frame_height'] !== null && config['frame_height'] !== undefined) {
var iframe = document.getElementById('asr_frame');
var body = document.body;
iframe.style.height = config['frame_height'];
if (config['frame_height'] === '100%') {
body.style.overflow = 'hidden'; // ページスクロールを禁止する
} else {
body.style.overflow = 'auto'; // ページスクロールを有効にする
}
}
// フォントの直接入力の場合,テキストフィールドを有効化 ////////////////////
function selectFont() {
var speech_text_font_selector = document.getElementById('speech_text_font_selector').value;
var trans_text_font_selector = document.getElementById('trans_text_font_selector').value;
var trans_text2_font_selector = document.getElementById('trans_text2_font_selector').value;
var trans_text3_font_selector = document.getElementById('trans_text3_font_selector').value;
console.log("フォントテキストエリア: " + speech_text_font_selector);
if (speech_text_font_selector === "direct") {
speech_text_font.disabled = false;
} else {
speech_text_font.disabled = true;
}
if (trans_text_font_selector === "direct") {
trans_text_font.disabled = false;
} else {
trans_text_font.disabled = true;
}
if (trans_text2_font_selector === "direct") {
trans_text2_font.disabled = false;
} else {
trans_text2_font.disabled = true;
}
if (trans_text3_font_selector === "direct") {
trans_text3_font.disabled = false;
} else {
trans_text3_font.disabled = true;
}
updateOptionValues();
}
// URLに付けるオプションの値をアップデート //////////
function updateOptionValues(only_url=false) {
for (const p of config_values) {
eval("var " + p + " = document.getElementById('" + p + "').value;");
}
var bouyomi = document.getElementById('bouyomi').checked;
var anti_sexual = document.getElementById('anti_sexual').checked;
var new_url = base_url + "textAlign=" + textAlign + "&v_align=" + v_align
+ "&recog=" + recog
+ "&bgcolor=" + bgcolor
+ "&size1=" + size1 + "&weight1=" + weight1 + "&color1=" + color1
+ "&st_color1=" + st_color1 + "&st_width1=" + st_width1
+ "&size2=" + size2 + "&weight2=" + weight2 + "&color2=" + color2
+ "&st_color2=" + st_color2 + "&st_width2=" + st_width2
+ "&size3=" + size3 + "&weight3=" + weight3 + "&color3=" + color3
+ "&st_color3=" + st_color3 + "&st_width3=" + st_width3
+ "&size4=" + size4 + "&weight4=" + weight4 + "&color4=" + color4
+ "&st_color4=" + st_color4 + "&st_width4=" + st_width4;
if(whiteSpace != '') {new_url = new_url + "&whiteSpace=" + whiteSpace;}
if(trans != 'none') {new_url = new_url + "&trans=" + trans;}
if(trans2 != 'none') {new_url = new_url + "&trans2=" + trans2;}
if(trans3 != 'none') {new_url = new_url + "&trans3=" + trans3;}
// font の処理
if (speech_text_font_selector !== "direct") {
speech_text_font = speech_text_font_selector;
}
if (trans_text_font_selector !== "direct") {
trans_text_font = trans_text_font_selector;
}
if (trans_text2_font_selector !== "direct") {
trans_text2_font = trans_text2_font_selector;
}
if (trans_text3_font_selector !== "direct") {
trans_text3_font = trans_text3_font_selector;
}
if(speech_text_font != '') {new_url = new_url + "&speech_text_font=" + speech_text_font;}
if(trans_text_font != '') {new_url = new_url + "&trans_text_font=" + trans_text_font;}
if(trans_text2_font != '') {new_url = new_url + "&trans_text2_font=" + trans_text2_font;}
if(trans_text3_font != '') {new_url = new_url + "&trans_text3_font=" + trans_text3_font;}
if(timer != '') {new_url = new_url + "&timer=" + timer;}
if(short_pause != '') {new_url = new_url + "&short_pause=" + short_pause;}
if(bouyomi == true) {new_url = new_url + "&bouyomi=" + bouyomi;}
if(anti_sexual == true) {new_url = new_url + "&anti_sexual=" + "false";}
if(gas_key != '') {new_url = new_url + "&gas_key=" + gas_key;}
// config の更新
for (const p of config_values) {
config[p] = eval(p);
}
// 設定の保存
localStorage.jimakuChan_config = JSON.stringify(config);
// 認識ちゃん画面の更新 ///////
if(only_url == false) {
document.getElementById('asr_frame').src = new_url;
}
// document.getElementById('url').innerHTML = new_url;
// document.getElementById('open_link').href = new_url;
return 0;
}
updateOptionValues()
// テキストの色変え ---------------------------
function changeTextColor(type, color, id) {
var text_layer = ['fg','bg','imb'];
var lang_line = ['speech_text','trans_text','trans_text2','trans_text3'];
if(type == "fg") { document.getElementById('asr_frame').contentWindow.document.getElementById(lang_line[id-1] + '-' + type).style.color = color;}
else { document.getElementById('asr_frame').contentWindow.document.getElementById(lang_line[id-1] + '-' + type).style.webkitTextStrokeColor = color; }
// type が imb の場合は,全てのlang_lineに反映
if(type == "imb") {
for (const ll of lang_line){
document.getElementById('asr_frame').contentWindow.document.getElementById(ll + '-' + type).style.webkitTextStrokeColor = color;
document.getElementById('asr_frame').contentWindow.document.getElementById(ll + '-' + type).style.color = color;
}
}
}
function setTextBorder(width, id) {
var lang_line = ['speech_text','trans_text','trans_text2','trans_text3'];
document.getElementById('asr_frame').contentWindow.document.getElementById(lang_line[id-1] + "-bg").style.webkitTextStrokeWidth = width + 'pt';
document.getElementById('asr_frame').contentWindow.document.getElementById(lang_line[id-1] + "-imb").style.webkitTextStrokeWidth = width + 'pt';
}
function changeText(text, id){
var text_layer = ['fg','bg','imb'];
var lang_line = ['speech_text','trans_text','trans_text2','trans_text3'];
for (const tl of text_layer){
document.getElementById('asr_frame').contentWindow.document.getElementById(ll[id-1] + '-' + tl).innerHTML = text;
}
}
</script>
<!-- # ファイル生成用のスクリプト ############################## -->
<script>
function generateFile(content, fileName) {
const blob = new Blob([content], { type: 'text/plain' });
const link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
function generateBatFile(os) {
// let url = document.getElementById('url').value.trim();
let url = currentURL;
// URLデコードを行う
url = decodeURIComponent(url);
if (url === '') {
alert('URLがありません.エラーです.');
return;
}
let content, filename;
if (os === 'win') {
content = `@echo off\r\nset "USERPROFILE=%LOCALAPPDATA%\\Google\\Chrome\\User Data\\user_jimaku_001"\r\nstart chrome.exe --disable-features=CalculateNativeWinOcclusion --user-data-dir="%USERPROFILE%" --new-window "${url}"\r\nexit /b`;
filename = "jimakuChan_nonStop.bat";
} else {
content = `#!/bin/sh\n"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --disable-features=CalculateNativeWinOcclusion --user-data-dir="Library/Application Support/Google/Chrome/user_jimaku_001" --new-window "${url}"`;
filename = "jimakuChan_nonStop.command";
}
generateFile(content, filename);
}
</script>
<!-- # 設定ファイルの保存と読込 ############################## -->
<script>
// Save LocalStorage settings to a file
function saveSettings() {
const settings = localStorage.jimakuChan_config;
if (!settings) {
alert('No settings found to save!');
return;
}
const blob = new Blob([settings], { type: 'text/plain' });
const link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = 'jimakuChan_settings.json';
link.click();
URL.revokeObjectURL(link.href);
}
// Load LocalStorage settings from a file
function loadSettings() {
const input = document.createElement('input');
input.type = 'file';
input.onchange = e => {
const file = e.target.files[0];
const reader = new FileReader();
reader.onload = function(readEvent) {
try {
const settings = JSON.parse(readEvent.target.result);
localStorage.jimakuChan_config = JSON.stringify(settings);
// reload
location.reload();
} catch (error) {
alert('Failed to load settings: ' + error.message);
}
};
reader.readAsText(file);
};
input.click();
}
</script>
<!-- # 翻訳回数取得 ############################ -->
<script>
function getTranslationCount() {
var iframe = document.getElementById('asr_frame');
var transCount = iframe.contentWindow.document.getElementById('translationCount').innerHTML;
if(transCount == ''){
transCount = '[ココに回数出るよ!]';
}
return transCount;
}
// 1秒ごとに翻訳カウントを更新
setInterval(function() {
document.getElementById('displayTransCount').innerHTML = getTranslationCount();
}, 1000);
</script>
<!-- # iframeの高さを切り替える ############################ -->
<script>
function toggleIframeHeight() {
console.log("toggleIframeHeight");
var iframe = document.getElementById('asr_frame');
var body = document.body;
// ページのスクロール位置を一番上に戻す
window.scrollTo(0, 0);
if (iframe.style.height === '100%') {
iframe.style.height = '30%';
body.style.overflow = 'auto'; // ページスクロールを有効にする
} else {
iframe.style.height = '100%';
body.style.overflow = 'hidden'; // ページスクロールを禁止する
}
document.getElementById('frame_height').value = iframe.style.height;
updateOptionValues();
}
</script>
<!-- iframeの高さを自動調整する -->
<script>
window.addEventListener('load', function() {
var iframe = document.getElementById('asr_frame'); // iframeのIDに置き換えてください
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
iframeDoc.addEventListener('click', function() {
// ここにクリックされた時の処理を書く
toggleIframeHeight(); // 高さを切り替える関数を呼び出す
});
});
</script>
</html>