forked from sayonari/jimakuChan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
557 lines (468 loc) · 26.6 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
<!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"></iframe>
<!-- # API key text box ##################### -->
Google Script API-KEY: <input type="text" name="gas_key" id="gas_key" size="60" oninput="updateOptionValues();" /><BR>
↑ここにKEYを入れたら翻訳結果も出る.キーの作成方法はこちら:<a target="_blank" href="http://www.sayonari.com/trans_asr/index_asr.html">http://www.sayonari.com/trans_asr/index_asr.html</a><BR>
<BR>
<!-- # 背景の色 ############################## -->
文字色 フチ色<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>
<BR>
<!-- # テキストフォント ########################
フォント名: <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>
<BR>
<!-- # テキストの揃え ######################### -->
テキストの位置:
左右:
<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>
<BR>
<!-- # テキスト表示項目 ####################### -->
音声認識言語 :
<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="pl">ポーランド語</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="pl">ポーランド語</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="pl">ポーランド語</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>
<BR>
<!-- # テキスト表示を●秒後に消す ######################### -->
何ミリ秒後に文を消す? :
<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>
<BR>
<!-- # 棒読みちゃん連携 ######################### -->
棒読みちゃん連携を使う:<input type="checkbox" id="bouyomi" onchange="updateOptionValues()"> ← 使う場合チェック入れる.詳細 → <a target="_blank" href="https://twitter.com/sayonari/status/1386937837682003968">twitter</a><BR>
<BR>
<!-- # センシティブワード対応する! ######################### -->
センシティブワード対応(***に置き換え)を<font color="red">やめる</font>:<input type="checkbox" id="anti_sexual" onchange="updateOptionValues()"> <BR>
↑動作が重いときは,チェックを付けて機能をOFFにしたら,解決するかもね.<BR>
<BR>
<!-- # URL view & copy button ############### -->
URL : <textarea name="url" id="url" rows="7" cols="90"></textarea><BR>
<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="_blank" href="">[別窓で開く]</a><BR>
<BR><BR><BR><BR>
テスト中<BR>
</body>
<script type="text/javascript">
const currentURL = window.location.href;
let base_url = currentURL.replace("index.html", "");
base_url += "main.html?";
// config 値 一覧 ////////////////
config_values = ["gas_key", "textAlign", "v_align", "whiteSpace", "recog", "trans", "trans2", "bgcolor"
, "size1", "weight1", "color1", "st_color1", "st_width1"
, "size2", "weight2", "color2", "st_color2", "st_width2"
, "size3", "weight3", "color3", "st_color3", "st_width3"
, "timer", "short_pause"
, "bouyomi", "anti_sexual"
, "speech_text_font_selector", "trans_text_font_selector", "trans_text2_font_selector"
, "speech_text_font", "trans_text_font", "trans_text2_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)];
}
document.getElementById('bouyomi').checked = config['bouyomi'];
document.getElementById('anti_sexual').checked = config['anti_sexual'];
// フォントの直接入力の場合,テキストフィールドを有効化 ////////////////////
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;
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;
}
updateOptionValues();
}
// URLに付けるオプションの値をアップデート //////////
function updateOptionValues(only_url=false) {
for (const p of config_values) {
eval("var " + p + " = document.getElementById('" + p + "').value;");
}
eval("var bouyomi = document.getElementById('bouyomi').checked;");
eval("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;
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;}
// 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(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(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'];
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; }
}
function setTextBorder(width, id) {
var lang_line = ['speech_text','trans_text','trans_text2'];
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'];
for (const tl of text_layer){
document.getElementById('asr_frame').contentWindow.document.getElementById(ll[id-1] + '-' + tl).innerHTML = text;
}
}
</script>
</html>