dsh-bilingual-reader 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +27 -5
- package/README.md +28 -5
- package/docs/architecture.md +1 -0
- package/docs/demo.jpg +0 -0
- package/docs/release-v0.2.0.md +41 -0
- package/package.json +1 -1
- package/src/glossary.js +33 -0
- package/src/quality.js +30 -0
- package/src/routes.js +96 -14
- package/src/store.js +19 -0
- package/src/translator.js +24 -11
- package/web/app.js +339 -13
- package/web/index.html +23 -5
- package/web/style.css +112 -4
package/web/style.css
CHANGED
|
@@ -101,22 +101,69 @@ code, pre {
|
|
|
101
101
|
|
|
102
102
|
.top-actions { display: flex; align-items: center; gap: 8px; }
|
|
103
103
|
|
|
104
|
+
.font-control {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: 1px;
|
|
108
|
+
padding: 1px;
|
|
109
|
+
border: 1px solid var(--border);
|
|
110
|
+
border-radius: 9px;
|
|
111
|
+
background: var(--bg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.font-control .icon-button {
|
|
115
|
+
width: 30px;
|
|
116
|
+
height: 26px;
|
|
117
|
+
border-radius: 7px;
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.font-control .icon-button:disabled { opacity: 0.4; cursor: default; }
|
|
122
|
+
|
|
104
123
|
.composer {
|
|
105
124
|
padding: 14px 22px 10px;
|
|
106
125
|
background: var(--panel);
|
|
107
126
|
border-bottom: 1px solid var(--border);
|
|
108
127
|
}
|
|
109
128
|
|
|
129
|
+
.composer-modes {
|
|
130
|
+
display: flex;
|
|
131
|
+
gap: 2px;
|
|
132
|
+
max-width: 1200px;
|
|
133
|
+
margin: 0 auto 8px;
|
|
134
|
+
width: fit-content;
|
|
135
|
+
padding: 2px;
|
|
136
|
+
border: 1px solid var(--border);
|
|
137
|
+
border-radius: 9px;
|
|
138
|
+
background: var(--bg);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.composer-modes button {
|
|
142
|
+
border: 0;
|
|
143
|
+
background: transparent;
|
|
144
|
+
padding: 4px 10px;
|
|
145
|
+
border-radius: 7px;
|
|
146
|
+
font-size: 12px;
|
|
147
|
+
color: var(--muted);
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.composer-modes button.active {
|
|
152
|
+
background: var(--accent-soft);
|
|
153
|
+
color: var(--accent);
|
|
154
|
+
font-weight: 600;
|
|
155
|
+
}
|
|
156
|
+
|
|
110
157
|
.composer form {
|
|
111
158
|
display: flex;
|
|
159
|
+
flex-wrap: wrap;
|
|
112
160
|
gap: 10px;
|
|
113
161
|
max-width: 1200px;
|
|
114
162
|
margin: 0 auto;
|
|
115
163
|
}
|
|
116
164
|
|
|
117
|
-
#url-input
|
|
118
|
-
|
|
119
|
-
min-width: 0;
|
|
165
|
+
#url-input,
|
|
166
|
+
#text-input {
|
|
120
167
|
padding: 10px 14px;
|
|
121
168
|
border: 1px solid var(--border);
|
|
122
169
|
border-radius: 10px;
|
|
@@ -124,7 +171,19 @@ code, pre {
|
|
|
124
171
|
outline: none;
|
|
125
172
|
}
|
|
126
173
|
|
|
127
|
-
#url-input
|
|
174
|
+
#url-input {
|
|
175
|
+
flex: 1;
|
|
176
|
+
min-width: 0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
#text-input {
|
|
180
|
+
flex: 1 1 100%;
|
|
181
|
+
min-height: 96px;
|
|
182
|
+
resize: vertical;
|
|
183
|
+
font: inherit;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
#url-input:focus, #text-input:focus, select:focus, input:focus {
|
|
128
187
|
border-color: var(--accent);
|
|
129
188
|
box-shadow: 0 0 0 3px var(--accent-soft);
|
|
130
189
|
}
|
|
@@ -390,6 +449,23 @@ select {
|
|
|
390
449
|
}
|
|
391
450
|
.badge.warn { background: rgba(162, 105, 27, 0.14); color: var(--warn); }
|
|
392
451
|
|
|
452
|
+
.badge-action {
|
|
453
|
+
margin-left: 6px;
|
|
454
|
+
padding: 1px 7px;
|
|
455
|
+
border: 1px solid var(--border);
|
|
456
|
+
border-radius: 99px;
|
|
457
|
+
background: var(--panel);
|
|
458
|
+
color: var(--muted);
|
|
459
|
+
font-size: 11px;
|
|
460
|
+
line-height: 1.5;
|
|
461
|
+
cursor: pointer;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.badge-action:hover {
|
|
465
|
+
border-color: var(--accent);
|
|
466
|
+
color: var(--accent);
|
|
467
|
+
}
|
|
468
|
+
|
|
393
469
|
.blocks.view-original .block,
|
|
394
470
|
.blocks.view-translation .block {
|
|
395
471
|
grid-template-columns: minmax(0, 1fr);
|
|
@@ -426,6 +502,12 @@ select {
|
|
|
426
502
|
.dialog-head h2 { margin: 0; font-size: 18px; }
|
|
427
503
|
.dialog-hint { color: var(--muted); font-size: 12px; margin: 6px 0 12px; }
|
|
428
504
|
|
|
505
|
+
.glossary-tools {
|
|
506
|
+
display: flex;
|
|
507
|
+
gap: 8px;
|
|
508
|
+
margin-bottom: 10px;
|
|
509
|
+
}
|
|
510
|
+
|
|
429
511
|
.glossary-list {
|
|
430
512
|
max-height: 300px;
|
|
431
513
|
overflow-y: auto;
|
|
@@ -468,6 +550,32 @@ select {
|
|
|
468
550
|
.glossary-form input#term-note { grid-column: 1 / -1; }
|
|
469
551
|
.glossary-form .button { grid-column: 1 / -1; justify-self: start; }
|
|
470
552
|
|
|
553
|
+
@media print {
|
|
554
|
+
:root { color-scheme: light; }
|
|
555
|
+
body { background: #fff; color: #000; }
|
|
556
|
+
.topbar, .composer, .sidebar, .doc-actions, .progress, .doc-status, .badge-action {
|
|
557
|
+
display: none !important;
|
|
558
|
+
}
|
|
559
|
+
.layout { display: block; }
|
|
560
|
+
.reader { padding: 0; overflow: visible; }
|
|
561
|
+
.doc-view { max-width: none; }
|
|
562
|
+
.block {
|
|
563
|
+
display: block;
|
|
564
|
+
break-inside: avoid;
|
|
565
|
+
page-break-inside: avoid;
|
|
566
|
+
border-bottom: 1px solid #ddd;
|
|
567
|
+
padding: 10px 0;
|
|
568
|
+
}
|
|
569
|
+
.trans {
|
|
570
|
+
margin-top: 6px;
|
|
571
|
+
padding: 6px 10px;
|
|
572
|
+
border-left: 2px solid #999;
|
|
573
|
+
background: #f5f5f5;
|
|
574
|
+
}
|
|
575
|
+
.blocks.view-original .trans, .blocks.view-translation .orig { display: none; }
|
|
576
|
+
a { color: #000; text-decoration: none; }
|
|
577
|
+
}
|
|
578
|
+
|
|
471
579
|
@media (max-width: 860px) {
|
|
472
580
|
.topbar { padding: 12px 14px; }
|
|
473
581
|
.composer { padding: 12px 14px 8px; }
|