-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
588 lines (519 loc) · 22.1 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" lang= "en-US" content="DING DING">
<meta name="author" lang= "zh-CN" content="丁鼎">
<meta name="theme-color" content="#4a90e2" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)">
<meta name="google-site-verification" content="7-Emt81Inb9kd2Qk_Upn2i9O2KEGpXtxN13KMvpPQA4" />
<!-- 中文描述 -->
<meta name="description" lang="zh" content="西夏文自动标注工具是一个在线工具,帮助用户处理和研究西夏文字。支持西夏文字的笔画输入、语音语法标注,并提供中英双语输出。">
<!-- 英文描述 -->
<meta name="description" lang="en" content="The Tangut Script Annotation Tool is an online platform for processing and studying Tangut characters. Features stroke-based input, phonetic and grammatical annotation, with bilingual output support.">
<!-- 日文描述 -->
<meta name="description" lang="ja" content="西夏文字グロスツールは、西夏文字の処理と研究をサポートするオンラインツールです。筆画入力、音声文法注釈に対応し、中国語と英語の出力を提供します。">
<!-- 俄文描述 -->
<meta name="description" lang="ru" content="Инструмент аннотации тангутского письма - это онлайн-платформа для обработки и изучения тангутских символов. Поддерживает ввод по чертам, фонетическую и грамматическую аннотацию с двуязычным выводом.">
<meta name="keywords" content="tangut, tangut script, тангутский, 西夏, 西夏語, 西夏文, 西夏文字, 西夏文标注, 西夏文检索, 西夏文输入, tangut input, tangut annotation, 西夏文字入力, тангутское письмо, Tangut dictionary, Tangut script translator">
<meta name="robots" content="index, follow">
<!-- Open Graph 标签 - 多语言 -->
<!-- 中文 -->
<meta property="og:title" lang="zh" content="西夏文自动标注工具 α">
<meta property="og:description" lang="zh" content="在线西夏文处理工具,支持笔画输入和语音语法标注功能">
<!-- 英文 -->
<meta property="og:title" lang="en" content="Tangut Script Annotation Tool α">
<meta property="og:description" lang="en" content="Online Tangut script processing tool with stroke input and phonetic annotation features">
<!-- 日文 -->
<meta property="og:title" lang="ja" content="西夏文字グロスツール α">
<meta property="og:description" lang="ja" content="オンライン西夏文字処理ツール、筆画入力と音声文法注釈機能付き">
<!-- 俄文 -->
<meta property="og:title" lang="ru" content="Инструмент аннотации тангутского письма α">
<meta property="og:description" lang="ru" content="Онлайн-инструмент для обработки тангутского письма с функциями ввода черт и фонетической аннотации">
<meta property="og:type" content="website">
<meta property="og:locale" content="zh_CN">
<meta property="og:locale:alternate" content="en_US">
<meta property="og:locale:alternate" content="ja_JP">
<meta property="og:locale:alternate" content="ru_RU">
<!-- Twitter Card 标签 - 多语言 -->
<meta name="twitter:card" content="summary">
<!-- 中文 -->
<meta name="twitter:title" content="西夏文自动标注工具 α" lang="zh">
<meta name="twitter:description" content="在线西夏文处理工具,支持笔画输入和语音语法标注功能" lang="zh">
<!-- 英文 -->
<meta name="twitter:title" content="Tangut Script Annotation Tool α" lang="en">
<meta name="twitter:description" content="Online Tangut script processing tool with stroke input and phonetic annotation features" lang="en">
<!-- 日文 -->
<meta name="twitter:title" content="西夏文字グロスツール α" lang="ja">
<meta name="twitter:description" content="オンライン西夏文字処理ツール、筆画入力と音声文法注釈機能付き" lang="ja">
<!-- 俄文 -->
<meta name="twitter:title" content="Инструмент аннотации тангутского письма α" lang="ru">
<meta name="twitter:description" content="Онлайн-инструмент для обработки тангутского письма с функциями ввода черт и фонетической аннотации" lang="ru">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Noto+Serif+SC:wght@200..900&family=Noto+Serif+Tangut&display=swap" rel="stylesheet">
<link rel="canonical" href="https://tinbreaker.github.io/Tangut-Script-Annotation-Tool/">
<link rel="sitemap" type="application/xml" title="Sitemap" href="./sitemap.xml">
<link rel="icon" href="./icons/apple-touch-icon.png">
<link rel="icon" href="./icons/pwa-maskable-192x192" type="image/png" sizes="192x192">
<link rel="icon" href="./icons/pwa-maskable-512x512" type="image/png" sizes="512x512">
<link rel="icon" href="./icons/favicon-32x32.png" type="image/png" sizes="32x32">
<link rel="icon" href="./icons/favicon-16x16.png" type="image/png" sizes="16x16">
<link rel="icon" href="./icons/pwa-192x192.png" type="image/png" sizes="192x192">
<link rel="icon" href="./icons/pwa-512x512.png" type="image/png" sizes="512x512">
<link rel="icon" href="./icons/favicon.ico" type="image/x-icon" sizes="16x16">
<link rel="manifest" href="./site.webmanifest">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "西夏文自动标注工具",
"description": "西夏文自动标注工具是一个在线工具,帮助用户处理和研究西夏文字。",
"applicationCategory": "EducationalApplication",
"operatingSystem": "All",
"inLanguage": ["zh-CN", "en-US", "ja-JP", "ru-RU"],
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
}
}
</script>
<title>西夏文自动标注工具 α | Tangut Script Annotation Tool α</title>
<style>
:root {
--primary-color: #4a90e2;
--secondary-color: #f5f7fa;
--text-color: #333;
--border-radius: 8px;
--min-container-width: 420px;
--max-container-width: 1050px;
--standard-padding: 20px;
}
body {
font-family: 'Fira Sans', 'Noto Serif SC', 'Noto Serif Tangut', sans-serif;
max-width: var(--max-container-width);
min-width: var(--min-container-width);
margin: clamp(20px, 4vw, 40px) auto;
padding: 0 var(--standard-padding);
background-color: #f9fafb;
color: var(--text-color);
line-height: 1.6;
}
.container {
background-color: white;
padding: clamp(20px, 3vw, 30px);
border-radius: var(--border-radius);
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
gap: 10px;
min-width: calc(var(--min-container-width) - 2 * var(--standard-padding));
width: 100%;
box-sizing: border-box;
}
h1 {
color: var(--primary-color);
text-align: center;
margin: 0 0 clamp(15px, 2vw, 20px) 0;
font-weight: 600;
font-size: clamp(1.5em, 4vw, 2em);
}
.input-section {
display: flex;
flex-direction: column;
gap: 15px;
flex-wrap: wrap;
}
.input-section label {
font-weight: 500;
min-width: 90px;
}
.input-section textarea {
width: 100%;
min-height: 100px;
height: clamp(100px, 15vh, 150px);
padding: 12px 15px;
border: 2px solid #e1e4e8;
border-radius: var(--border-radius);
font-size: clamp(14px, 1.6vw, 16px);
transition: border-color 0.3s ease;
resize: vertical;
font-family: inherit;
box-sizing: border-box;
}
.input-section textarea:focus,
#stroke-entry-field:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}
/* 修改 explanation 相关样式 */
.explanation {
padding: 0;
margin: 0;
height: 1.2em; /* 减小高度 */
line-height: 1.2em; /* 确保文字垂直居中 */
font-size: 0.9em; /* 稍微减小字体大小 */
color: #666; /* 使用较浅的颜色 */
}
#rollover-info {
height: 1.2em; /* 与 .explanation 保持一致 */
margin: 0; /* 移除上边距 */
padding: 0 5px; /* 仅保留水平方向的内边距 */
overflow: hidden; /* 改为 hidden 而不是 auto,除非真的需要滚动 */
white-space: nowrap;
overflow: auto;
}
.controls {
display: flex;
flex-wrap: wrap;
width: 100%;
gap: clamp(10px, 2vw, 20px);
padding: 15px;
background-color: var(--secondary-color);
border-radius: var(--border-radius);
box-sizing: border-box;
}
.radio-group {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
min-width: 200px;
}
button {
padding: clamp(8px, 1.5vw, 10px) clamp(15px, 2vw, 20px);
border: none;
border-radius: var(--border-radius);
background-color: var(--primary-color);
color: white;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
font-size: clamp(14px, 1.6vw, 16px);
height: 40px; /* 添加固定高度 */
line-height: 1; /* 确保文本垂直居中 */
display: flex; /* 使用 flex 布局 */
align-items: center; /* 垂直居中 */
justify-content: center; /* 水平居中 */
}
button:hover {
background-color: #357abd;
transform: translateY(-1px);
}
button:active {
transform: translateY(0);
}
.button-group {
display: flex;
gap: 10px;
}
.button-group button {
flex: 1;
}
#copy-btn {
width: 100%;
max-width: 400px;
margin: 10px auto;
display: flex;
align-items: center;
justify-content: center;
}
#copy-btn:hover {
background-color: #218838;
}
.results-viewport {
width: 97%;
overflow-x: auto;
padding: clamp(8px, 1.5vw, 10px);
background: var(--secondary-color);
border-radius: var(--border-radius);
margin: 0 auto;
}
.results-wrapper {
display: inline-flex;
gap: 10px;
padding: 0;
margin: 0;
list-style: none;
}
.output-section {
width: 100%;
}
.output-section textarea {
width: 100%;
min-height: 200px;
height: clamp(200px, 25vh, 300px);
}
/* 美化 stroke-tab 样式 */
#stroke-tab {
width: 100%;
min-width: calc(var(--min-container-width) - 40px);
background: var(--secondary-color);
padding: clamp(15px, 2vw, 20px);
border-radius: var(--border-radius);
box-sizing: border-box;
}
.stroke-entry-container {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 15px;
width: 100%;
flex-wrap: nowrap;
}
#stroke-entry-field {
flex: 1;
min-width: 200px;
padding: 8px 12px;
border: 2px solid #e1e4e8;
border-radius: var(--border-radius);
font-size: clamp(14px, 1.6vw, 16px);
}
#stroke-buttons {
display: flex;
flex-wrap: wrap;
gap: 8px;
justify-content: center;
}
.stroke-button {
min-width: 40px;
min-height: 40px;
padding: 8px;
font-family: "Noto Serif Tangut", "Noto Serif SC", system-ui, -apple-system, sans-serif;
font-size: clamp(14px, 1.6vw, 16px);
font-weight: normal;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
/* 确保按钮内容居中 */
text-align: center;
/* 添加边框和背景 */
border: 1px solid #e1e4e8;
border-radius: var(--border-radius);
/* 改善触摸体验 */
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
}
.stroke-button:hover {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.stroke-button .tooltip {
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
padding: 5px 10px;
background: rgba(0, 0, 0, 0.8);
color: white;
border-radius: 4px;
font-size: 14px;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition: all 0.3s ease;
}
.stroke-button:hover .tooltip {
opacity: 1;
visibility: visible;
}
.checkbox-wrapper {
display: flex;
align-items: center;
gap: 5px;
flex: 0 0 auto;
min-width: 30px;
justify-content: center;
}
/* 调整复选框和标签的样式 */
.checkbox-wrapper input[type="checkbox"] {
margin: 0;
cursor: pointer;
}
.checkbox-wrapper label {
cursor: pointer;
user-select: none;
white-space: nowrap;
}
.clear-strokes {
padding: 8px;
background: #ff4444;
color: white;
border: none;
border-radius: var(--border-radius);
cursor: pointer;
}
.clear-strokes:hover {
background: #cc0000;
}
.results-wrapper li {
cursor: pointer;
padding: 5px 10px;
background: white;
border-radius: var(--border-radius);
transition: all 0.3s ease;
}
.results-wrapper li:hover {
background: var(--primary-color);
color: white;
}
.results-viewport,
.explanation {
font-size: 18px; /* Default font size */
}
.language-selector {
position: absolute;
top: 20px;
right: 20px;
display: flex;
gap: 10px;
align-items: center;
}
.language-selector select {
padding: 5px 10px;
border-radius: var(--border-radius);
border: 2px solid #e1e4e8;
font-family: inherit;
cursor: pointer;
}
.language-selector select:focus {
outline: none;
border-color: var(--primary-color);
}
@media (max-width: 767px) {
.language-selector {
position: static;
justify-content: flex-end;
margin-bottom: 15px;
}
}
@media (max-width: 767px) {
.container {
padding: 15px;
}
.controls {
flex-direction: column;
align-items: flex-start;
}
.radio-group {
width: 100%;
}
}
@media (max-width: 450px) {
:root {
--standard-padding: 10px;
}
}
</style>
</head>
<body>
<div class="container">
<div class="language-selector">
<select id="languageSelect" onchange="changeLanguage()">
<option value="zh">中文</option>
<option value="en">English</option>
<option value="ja">日本語</option>
<option value="ru">Русский</option>
</select>
</div>
<h1 data-i18n="title">西夏文<br>自动标注工具 α</h1>
<div class="input-section">
<label for="output" data-i18n="input-label">输入字符:</label>
<textarea id="output" placeholder="𘉰𘟀𘅇𘉪" rows="3" style="font-size: 24px; line-height: 1.4;"></textarea>
<div class="button-group">
<button onclick="handleGenerate()" data-i18n="generate">生成</button>
<button onclick="clearAll()" data-i18n="clear">清除</button>
</div>
</div>
<div class="explanation" id="rollover-info">
<!-- 通过JavaScript动态填充搜索结果 -->
</div>
<div id="search-results">
<div class="results-viewport">
<ul id="result-list" class="results-wrapper">
<!-- 通过JavaScript动态填充搜索结果 -->
</ul>
</div>
</div>
<div class="tab-pane" id="stroke-tab">
<div class="stroke-entry-container">
<div class="checkbox-wrapper" title="starts with">
<label onclick="toggleCheckbox('stroke-begins-with')">^</label>
<input type="checkbox" id="stroke-begins-with"/>
</div>
<input type="text" id="stroke-entry-field" />
<div class="checkbox-wrapper" title="ends with">
<input type="checkbox" id="stroke-ends-with"/>
<label onclick="toggleCheckbox('stroke-ends-with')">$</label>
</div>
</div>
<div id="stroke-buttons">
<!-- 使用 JavaScript 动态生成笔画按钮 -->
</div>
</div>
<button onclick="clearStrokeEntryField();" aria-label="清除笔画输入">
<span data-i18n="clear">清除</span>
</button>
</div>
<div class="controls">
<div class="radio-group">
<label data-i18n="language-choice">语言选择:</label>
<label>
<input type="radio" name="lang" value="CN" id="lang-cn" checked>
<span data-i18n="chinese">中文</span>
</label>
<label>
<input type="radio" name="lang" value="EN" id="lang-en">
<span data-i18n="english">English</span>
</label>
</div>
<div class="radio-group">
<label data-i18n="reading-system">读音系统:</label>
<label>
<input type="radio" name="reading" value="GX" id="reading-gx" checked>
<span data-i18n="gongxun">龚勋</span>
</label>
<label>
<input type="radio" name="reading" value="GHC" id="reading-ghc">
<span data-i18n="gonghuangcheng">龚煌城</span>
</label>
</div>
<div class="radio-group">
<label data-i18n="output-format">输出格式:</label>
<label>
<input type="radio" name="format" value="typst" id="format-typst" checked>
Typst
</label>
<label>
<input type="radio" name="format" value="obsidian" id="format-obsidian">
Obsidian
</label>
<label>
<input type="radio" name="format" value="plaintext" id="format-plaintext">
<span data-i18n="plain-text">纯文本</span>
</label>
</div>
</div>
<div class="output-section">
<label for="output-text" data-i18n="format-output">格式输出:</label>
<textarea id="output-text" style="font-family: Fira Sans, Noto Serif Tangut, Noto Serif SC, sans-serif;"></textarea>
<button onclick="copyOutput()" id="copy-btn" data-i18n="copy-clipboard">复制到剪贴板</button>
</div>
</div>
</div>
<div class="footer" style="text-align: center; margin: 20px auto;">
<a href="https://github.com/tinbreaker/Tangut-Script-Annotation-Tool">© 𗼇𘝞𗫸𗯿𘍞</a>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript" src="txglook-data.js"></script>
<script type="text/javascript" src="txglook.js"></script>
<script type="text/javascript" src="dictionary.js"></script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>