@hanology/cham-browser 0.4.75 → 0.4.77
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/package.json +1 -1
- package/template/src/App.vue +2 -2
- package/template/src/components/AnnotationPane.vue +2 -2
- package/template/src/components/AnnotationTooltip.vue +1 -1
- package/template/src/components/PartBlock.vue +8 -6
- package/template/src/components/SectionBlock.vue +1 -1
- package/template/src/components/SideNav.vue +1 -1
- package/template/src/components/VerticalScroll.vue +9 -7
- package/template/src/composables/useAnnotationRenderer.ts +4 -1
- package/template/src/styles/annotation-targets.css +53 -7
- package/template/src/styles/main.css +3 -3
- package/template/src/views/AuthorView.vue +4 -4
- package/template/src/views/BookHome.vue +5 -5
- package/template/src/views/LibraryHome.vue +3 -3
- package/template/src/views/PieceView.vue +7 -7
package/package.json
CHANGED
package/template/src/App.vue
CHANGED
|
@@ -144,7 +144,7 @@ function onKey(event: KeyboardEvent) {
|
|
|
144
144
|
.about-pane-v {
|
|
145
145
|
writing-mode: vertical-rl; text-orientation: mixed;
|
|
146
146
|
position: relative;
|
|
147
|
-
height:
|
|
147
|
+
height: 100dvh;
|
|
148
148
|
background: var(--paper);
|
|
149
149
|
padding: 32px 28px;
|
|
150
150
|
overflow-x: auto;
|
|
@@ -174,7 +174,7 @@ function onKey(event: KeyboardEvent) {
|
|
|
174
174
|
display: flex;
|
|
175
175
|
align-items: center;
|
|
176
176
|
justify-content: center;
|
|
177
|
-
min-height:
|
|
177
|
+
min-height: 100dvh;
|
|
178
178
|
}
|
|
179
179
|
.route-loading-logo {
|
|
180
180
|
width: 56px; height: auto;
|
|
@@ -210,7 +210,7 @@ onBeforeUnmount(() => {
|
|
|
210
210
|
position: fixed;
|
|
211
211
|
left: 0;
|
|
212
212
|
top: 0;
|
|
213
|
-
height:
|
|
213
|
+
height: 100dvh;
|
|
214
214
|
background: var(--surface-warm);
|
|
215
215
|
border-right: 1px solid var(--border);
|
|
216
216
|
z-index: 300;
|
|
@@ -568,7 +568,7 @@ onBeforeUnmount(() => {
|
|
|
568
568
|
width: auto !important;
|
|
569
569
|
max-width: 65vw !important;
|
|
570
570
|
min-width: 180px;
|
|
571
|
-
height:
|
|
571
|
+
height: 100dvh !important;
|
|
572
572
|
max-height: none !important;
|
|
573
573
|
top: 0 !important;
|
|
574
574
|
bottom: auto !important;
|
|
@@ -236,14 +236,16 @@ const annotationEntries = computed(() =>
|
|
|
236
236
|
|
|
237
237
|
.part-block--vertical :deep(.ann-target) {
|
|
238
238
|
border-bottom: none;
|
|
239
|
-
border-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
border-right: none;
|
|
240
|
+
padding-right: 3px;
|
|
241
|
+
background-image: linear-gradient(to bottom, var(--vermillion), var(--vermillion));
|
|
242
|
+
background-size: 2px 100%;
|
|
243
|
+
background-position: right center;
|
|
244
|
+
background-repeat: no-repeat;
|
|
242
245
|
}
|
|
243
246
|
.part-block--vertical :deep(.ann-target.ann-overlap) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
padding-left: 3px;
|
|
247
|
+
padding-right: 4px;
|
|
248
|
+
background-size: 3px 100%;
|
|
247
249
|
}
|
|
248
250
|
.part-block--vertical :deep(.ann-num) {
|
|
249
251
|
font-size: 0.45em;
|
|
@@ -130,7 +130,7 @@ function toggleSettings() { settingsOpen.value = !settingsOpen.value }
|
|
|
130
130
|
.sidenav {
|
|
131
131
|
position: fixed;
|
|
132
132
|
top: 0; right: 0;
|
|
133
|
-
width: 56px; height:
|
|
133
|
+
width: 56px; height: 100dvh;
|
|
134
134
|
background: var(--paper);
|
|
135
135
|
border-left: 1px solid var(--border);
|
|
136
136
|
display: flex; flex-direction: column;
|
|
@@ -73,7 +73,7 @@ function onTap(event: MouseEvent) {
|
|
|
73
73
|
--ann-shadow-y: -2px;
|
|
74
74
|
writing-mode: vertical-rl;
|
|
75
75
|
text-orientation: mixed;
|
|
76
|
-
height: calc(
|
|
76
|
+
height: calc(100dvh - var(--nav-width, 56px));
|
|
77
77
|
padding: 32px 24px;
|
|
78
78
|
background: var(--surface);
|
|
79
79
|
border: 1px solid var(--border);
|
|
@@ -114,14 +114,16 @@ function onTap(event: MouseEvent) {
|
|
|
114
114
|
|
|
115
115
|
:deep(.ann-target) {
|
|
116
116
|
border-bottom: none;
|
|
117
|
-
border-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
border-right: none;
|
|
118
|
+
padding-right: 3px;
|
|
119
|
+
background-image: linear-gradient(to bottom, var(--vermillion), var(--vermillion));
|
|
120
|
+
background-size: 2px 100%;
|
|
121
|
+
background-position: right center;
|
|
122
|
+
background-repeat: no-repeat;
|
|
120
123
|
}
|
|
121
124
|
:deep(.ann-target.ann-overlap) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
padding-left: 3px;
|
|
125
|
+
padding-right: 4px;
|
|
126
|
+
background-size: 3px 100%;
|
|
125
127
|
}
|
|
126
128
|
:deep(.ann-num) {
|
|
127
129
|
font-size: 0.45em;
|
|
@@ -69,7 +69,10 @@ export function renderAnnotatedText(text: string, spans: AnnSpan[], useRuby = fa
|
|
|
69
69
|
const body = esc(text.slice(span.start, span.end))
|
|
70
70
|
if (useRuby) {
|
|
71
71
|
const rtCls = numText.length > 1 ? 'ann-num ann-num-long' : 'ann-num'
|
|
72
|
-
|
|
72
|
+
const chars = [...body]
|
|
73
|
+
html += chars.map((ch, i) =>
|
|
74
|
+
`<ruby class="ann-target${overlapCls} ${kinds}" data-ann-ids="${ids}">${ch}<rp></rp>${i === 0 ? `<rt class="${rtCls}">${numText}</rt>` : ''}<rp></rp></ruby>`
|
|
75
|
+
).join('')
|
|
73
76
|
} else {
|
|
74
77
|
html += `<span class="ann-target${overlapCls} ${kinds}" data-ann-ids="${ids}">${body}<sup class="ann-num">${numText}</sup></span>`
|
|
75
78
|
}
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
transition: background 0.2s ease, box-shadow 0.2s ease;
|
|
6
6
|
-webkit-box-decoration-break: clone;
|
|
7
7
|
box-decoration-break: clone;
|
|
8
|
+
text-decoration: none;
|
|
9
|
+
}
|
|
10
|
+
ruby.ann-target {
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
}
|
|
13
|
+
rt.ann-num, sup.ann-num {
|
|
14
|
+
text-decoration: none;
|
|
8
15
|
}
|
|
9
16
|
|
|
10
17
|
/* ─── Annotation kind border colors ─── */
|
|
@@ -26,21 +33,60 @@
|
|
|
26
33
|
border-bottom-style: double;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
/* ─── Vertical mode:
|
|
36
|
+
/* ─── Vertical mode: background line on right ─── */
|
|
30
37
|
[data-layout="vertical"] .ann-target,
|
|
31
38
|
.v-scroll .ann-target,
|
|
32
39
|
.part-block--vertical .ann-target {
|
|
33
40
|
border-bottom: none;
|
|
34
|
-
border-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
border-right: none;
|
|
42
|
+
padding-right: 3px;
|
|
43
|
+
background-image: linear-gradient(to bottom, var(--vermillion), var(--vermillion));
|
|
44
|
+
background-size: 2px 100%;
|
|
45
|
+
background-position: right center;
|
|
46
|
+
background-repeat: no-repeat;
|
|
37
47
|
}
|
|
38
48
|
[data-layout="vertical"] .ann-target.ann-overlap,
|
|
39
49
|
.v-scroll .ann-target.ann-overlap,
|
|
40
50
|
.part-block--vertical .ann-target.ann-overlap {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
padding-right: 4px;
|
|
52
|
+
background-size: 3px 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ─── Vertical mode: per-kind colors ─── */
|
|
56
|
+
.v-scroll .ann-target.pronunciation,
|
|
57
|
+
[data-layout="vertical"] .ann-target.pronunciation,
|
|
58
|
+
.part-block--vertical .ann-target.pronunciation {
|
|
59
|
+
background-image: linear-gradient(to bottom, var(--jade), var(--jade));
|
|
60
|
+
}
|
|
61
|
+
.v-scroll .ann-target.pronunciation.semantic,
|
|
62
|
+
[data-layout="vertical"] .ann-target.pronunciation.semantic,
|
|
63
|
+
.part-block--vertical .ann-target.pronunciation.semantic {
|
|
64
|
+
background-image: linear-gradient(to bottom, var(--gold), var(--gold));
|
|
65
|
+
}
|
|
66
|
+
.v-scroll .ann-target.person,
|
|
67
|
+
[data-layout="vertical"] .ann-target.person,
|
|
68
|
+
.part-block--vertical .ann-target.person {
|
|
69
|
+
background-image: linear-gradient(to bottom, var(--ann-person), var(--ann-person));
|
|
70
|
+
}
|
|
71
|
+
.v-scroll .ann-target.place,
|
|
72
|
+
[data-layout="vertical"] .ann-target.place,
|
|
73
|
+
.part-block--vertical .ann-target.place {
|
|
74
|
+
background-image: linear-gradient(to bottom, var(--ann-place), var(--ann-place));
|
|
75
|
+
}
|
|
76
|
+
.v-scroll .ann-target.event,
|
|
77
|
+
[data-layout="vertical"] .ann-target.event,
|
|
78
|
+
.part-block--vertical .ann-target.event {
|
|
79
|
+
background-image: linear-gradient(to bottom, var(--ann-event), var(--ann-event));
|
|
80
|
+
}
|
|
81
|
+
.v-scroll .ann-target.date,
|
|
82
|
+
[data-layout="vertical"] .ann-target.date,
|
|
83
|
+
.part-block--vertical .ann-target.date {
|
|
84
|
+
background-image: linear-gradient(to bottom, var(--ann-date), var(--ann-date));
|
|
85
|
+
}
|
|
86
|
+
.v-scroll .ann-target.allusion,
|
|
87
|
+
[data-layout="vertical"] .ann-target.allusion,
|
|
88
|
+
.part-block--vertical .ann-target.allusion {
|
|
89
|
+
background-image: linear-gradient(to bottom, var(--ann-allusion), var(--ann-allusion));
|
|
44
90
|
}
|
|
45
91
|
|
|
46
92
|
/* ─── Annotation kind hover states ─── */
|
|
@@ -143,7 +143,7 @@ body {
|
|
|
143
143
|
background: var(--paper);
|
|
144
144
|
color: var(--ink);
|
|
145
145
|
line-height: 1.8;
|
|
146
|
-
min-height:
|
|
146
|
+
min-height: 100dvh;
|
|
147
147
|
overflow-x: hidden;
|
|
148
148
|
overscroll-behavior-y: contain;
|
|
149
149
|
}
|
|
@@ -248,7 +248,7 @@ button:focus-visible {
|
|
|
248
248
|
|
|
249
249
|
/* ===== VERTICAL PAGE LAYOUT ===== */
|
|
250
250
|
.v-page {
|
|
251
|
-
height:
|
|
251
|
+
height: 100dvh;
|
|
252
252
|
display: flex;
|
|
253
253
|
flex-direction: row-reverse;
|
|
254
254
|
overflow-x: auto;
|
|
@@ -298,7 +298,7 @@ button:focus-visible {
|
|
|
298
298
|
.page-loading {
|
|
299
299
|
display: flex; flex-direction: column;
|
|
300
300
|
align-items: center; justify-content: center;
|
|
301
|
-
height:
|
|
301
|
+
height: 100dvh;
|
|
302
302
|
}
|
|
303
303
|
.page-loading-seal {
|
|
304
304
|
width: 56px; height: 56px;
|
|
@@ -146,7 +146,7 @@ function goHome() { router.push('/') }
|
|
|
146
146
|
/* ═══════ 直排模式 ═══════ */
|
|
147
147
|
|
|
148
148
|
.v-page {
|
|
149
|
-
height:
|
|
149
|
+
height: 100dvh;
|
|
150
150
|
display: flex;
|
|
151
151
|
flex-direction: row-reverse;
|
|
152
152
|
overflow-x: auto;
|
|
@@ -164,7 +164,7 @@ function goHome() { router.push('/') }
|
|
|
164
164
|
writing-mode: vertical-rl;
|
|
165
165
|
text-orientation: mixed;
|
|
166
166
|
flex-shrink: 0;
|
|
167
|
-
height:
|
|
167
|
+
height: 100dvh;
|
|
168
168
|
display: flex;
|
|
169
169
|
flex-direction: column;
|
|
170
170
|
align-items: flex-start;
|
|
@@ -198,7 +198,7 @@ function goHome() { router.push('/') }
|
|
|
198
198
|
writing-mode: vertical-rl;
|
|
199
199
|
text-orientation: mixed;
|
|
200
200
|
flex-shrink: 0;
|
|
201
|
-
height:
|
|
201
|
+
height: 100dvh;
|
|
202
202
|
padding: 40px 16px;
|
|
203
203
|
border-right: 1px solid var(--border);
|
|
204
204
|
}
|
|
@@ -247,7 +247,7 @@ function goHome() { router.push('/') }
|
|
|
247
247
|
|
|
248
248
|
/* ═══════ 橫排模式 ═══════ */
|
|
249
249
|
|
|
250
|
-
.h-page { min-height:
|
|
250
|
+
.h-page { min-height: 100dvh; }
|
|
251
251
|
.h-nav {
|
|
252
252
|
position: sticky; top: 0; z-index: 100;
|
|
253
253
|
background: var(--paper);
|
|
@@ -165,7 +165,7 @@ function scrollToCatalog() {
|
|
|
165
165
|
writing-mode: vertical-rl;
|
|
166
166
|
text-orientation: mixed;
|
|
167
167
|
flex-shrink: 0;
|
|
168
|
-
height:
|
|
168
|
+
height: 100dvh;
|
|
169
169
|
display: flex;
|
|
170
170
|
flex-direction: column;
|
|
171
171
|
align-items: flex-start;
|
|
@@ -211,7 +211,7 @@ function scrollToCatalog() {
|
|
|
211
211
|
writing-mode: vertical-rl;
|
|
212
212
|
text-orientation: mixed;
|
|
213
213
|
flex-shrink: 0;
|
|
214
|
-
height:
|
|
214
|
+
height: 100dvh;
|
|
215
215
|
padding: 40px 16px;
|
|
216
216
|
border-right: 1px solid var(--border);
|
|
217
217
|
display: flex;
|
|
@@ -265,7 +265,7 @@ function scrollToCatalog() {
|
|
|
265
265
|
grid-template-rows: repeat(auto-fill, 180px);
|
|
266
266
|
gap: 10px;
|
|
267
267
|
padding: 24px 16px;
|
|
268
|
-
height:
|
|
268
|
+
height: 100dvh;
|
|
269
269
|
box-sizing: border-box;
|
|
270
270
|
direction: rtl;
|
|
271
271
|
align-items: start;
|
|
@@ -279,7 +279,7 @@ function scrollToCatalog() {
|
|
|
279
279
|
|
|
280
280
|
.h-hero {
|
|
281
281
|
position: relative;
|
|
282
|
-
height:
|
|
282
|
+
height: 100dvh;
|
|
283
283
|
display: flex; flex-direction: column;
|
|
284
284
|
align-items: center; justify-content: center;
|
|
285
285
|
background: linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
|
|
@@ -386,7 +386,7 @@ function scrollToCatalog() {
|
|
|
386
386
|
writing-mode: vertical-rl;
|
|
387
387
|
text-orientation: mixed;
|
|
388
388
|
flex-shrink: 0;
|
|
389
|
-
height:
|
|
389
|
+
height: 100dvh;
|
|
390
390
|
display: flex;
|
|
391
391
|
align-items: center;
|
|
392
392
|
justify-content: center;
|
|
@@ -182,7 +182,7 @@ function openBook(bookId: string) {
|
|
|
182
182
|
writing-mode: vertical-rl;
|
|
183
183
|
text-orientation: mixed;
|
|
184
184
|
flex-shrink: 0;
|
|
185
|
-
height:
|
|
185
|
+
height: 100dvh;
|
|
186
186
|
display: flex;
|
|
187
187
|
flex-direction: column;
|
|
188
188
|
align-items: flex-start;
|
|
@@ -213,7 +213,7 @@ function openBook(bookId: string) {
|
|
|
213
213
|
flex-shrink: 0;
|
|
214
214
|
display: flex;
|
|
215
215
|
flex-direction: column;
|
|
216
|
-
height:
|
|
216
|
+
height: 100dvh;
|
|
217
217
|
box-sizing: border-box;
|
|
218
218
|
overflow-x: auto;
|
|
219
219
|
overflow-y: hidden;
|
|
@@ -257,7 +257,7 @@ function openBook(bookId: string) {
|
|
|
257
257
|
flex-direction: column;
|
|
258
258
|
align-items: center;
|
|
259
259
|
justify-content: flex-start;
|
|
260
|
-
height:
|
|
260
|
+
height: 100dvh;
|
|
261
261
|
width: 44px;
|
|
262
262
|
padding: 16px 0;
|
|
263
263
|
border-left: 1px solid var(--border-light);
|
|
@@ -727,7 +727,7 @@ function tcy(n: number): string {
|
|
|
727
727
|
writing-mode: vertical-rl;
|
|
728
728
|
text-orientation: mixed;
|
|
729
729
|
flex-shrink: 0;
|
|
730
|
-
height:
|
|
730
|
+
height: 100dvh;
|
|
731
731
|
display: flex;
|
|
732
732
|
align-items: flex-start;
|
|
733
733
|
justify-content: center;
|
|
@@ -781,7 +781,7 @@ function tcy(n: number): string {
|
|
|
781
781
|
flex-direction: row-reverse;
|
|
782
782
|
align-items: stretch;
|
|
783
783
|
gap: 0;
|
|
784
|
-
height:
|
|
784
|
+
height: 100dvh;
|
|
785
785
|
box-sizing: border-box;
|
|
786
786
|
padding: 20px 16px;
|
|
787
787
|
}
|
|
@@ -810,7 +810,7 @@ function tcy(n: number): string {
|
|
|
810
810
|
writing-mode: vertical-rl;
|
|
811
811
|
text-orientation: mixed;
|
|
812
812
|
flex-shrink: 0;
|
|
813
|
-
height:
|
|
813
|
+
height: 100dvh;
|
|
814
814
|
display: flex;
|
|
815
815
|
flex-direction: row;
|
|
816
816
|
align-items: center;
|
|
@@ -854,7 +854,7 @@ function tcy(n: number): string {
|
|
|
854
854
|
|
|
855
855
|
/* ═══════ 橫排模式 ═══════ */
|
|
856
856
|
|
|
857
|
-
.h-page { min-height:
|
|
857
|
+
.h-page { min-height: 100dvh; }
|
|
858
858
|
.h-nav {
|
|
859
859
|
position: sticky; top: 0; z-index: 100;
|
|
860
860
|
background: var(--paper);
|
|
@@ -1037,7 +1037,7 @@ function tcy(n: number): string {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
.h-pane {
|
|
1039
1039
|
width: min(420px, 90vw);
|
|
1040
|
-
height:
|
|
1040
|
+
height: 100dvh;
|
|
1041
1041
|
background: var(--paper);
|
|
1042
1042
|
padding: 32px;
|
|
1043
1043
|
overflow-y: auto;
|
|
@@ -1173,7 +1173,7 @@ function tcy(n: number): string {
|
|
|
1173
1173
|
.v-author-pane {
|
|
1174
1174
|
writing-mode: vertical-rl;
|
|
1175
1175
|
text-orientation: mixed;
|
|
1176
|
-
height:
|
|
1176
|
+
height: 100dvh;
|
|
1177
1177
|
background: var(--paper);
|
|
1178
1178
|
padding: 32px 24px;
|
|
1179
1179
|
overflow-x: auto;
|
|
@@ -1290,7 +1290,7 @@ function tcy(n: number): string {
|
|
|
1290
1290
|
flex-direction: column;
|
|
1291
1291
|
gap: 8px;
|
|
1292
1292
|
flex-shrink: 0;
|
|
1293
|
-
height:
|
|
1293
|
+
height: 100dvh;
|
|
1294
1294
|
align-items: center;
|
|
1295
1295
|
justify-content: center;
|
|
1296
1296
|
padding: 0 6px;
|