@hanology/cham-browser 0.4.69 → 0.4.70
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 -12
- package/template/src/components/HorizontalDisplay.vue +3 -0
- package/template/src/components/PartBlock.vue +4 -0
- package/template/src/components/PartGroup.vue +2 -0
- package/template/src/components/VerticalScroll.vue +2 -0
- package/template/src/composables/useReadingMode.ts +3 -1
- package/template/src/styles/annotation-targets.css +43 -3
- package/template/src/views/PieceView.vue +1 -1
package/package.json
CHANGED
package/template/src/App.vue
CHANGED
|
@@ -51,18 +51,8 @@ function onKey(event: KeyboardEvent) {
|
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
53
|
<div @keydown="onKey">
|
|
54
|
-
<router-view v-slot="{ Component
|
|
55
|
-
<
|
|
56
|
-
<Suspense :key="route.fullPath">
|
|
57
|
-
<component :is="Component" />
|
|
58
|
-
<template #fallback>
|
|
59
|
-
<div class="route-loading">
|
|
60
|
-
<img v-if="logoUrl" :src="logoUrl" alt="" class="route-loading-logo" />
|
|
61
|
-
<div v-else class="route-loading-seal">文</div>
|
|
62
|
-
</div>
|
|
63
|
-
</template>
|
|
64
|
-
</Suspense>
|
|
65
|
-
</Transition>
|
|
54
|
+
<router-view v-slot="{ Component }">
|
|
55
|
+
<component :is="Component" />
|
|
66
56
|
</router-view>
|
|
67
57
|
<!-- 橫排模式才顯示浮動設定鈕 -->
|
|
68
58
|
<ReadingToolbar v-if="!isVertical" />
|
|
@@ -169,6 +169,10 @@ const sourceLabel = (() => {
|
|
|
169
169
|
font-size: 0.45em;
|
|
170
170
|
text-align: end;
|
|
171
171
|
vertical-align: baseline;
|
|
172
|
+
ruby-position: under;
|
|
173
|
+
}
|
|
174
|
+
.part-block--vertical :deep(.ann-num-long) {
|
|
175
|
+
font-size: 0.38em;
|
|
172
176
|
}
|
|
173
177
|
|
|
174
178
|
.part-block--vertical .part-source {
|
|
@@ -113,6 +113,7 @@ function onTap(event: MouseEvent) {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
:deep(.ann-target) {
|
|
116
|
+
border-bottom: none;
|
|
116
117
|
border-left-width: 2px;
|
|
117
118
|
border-left-style: solid;
|
|
118
119
|
padding-left: 2px;
|
|
@@ -125,6 +126,7 @@ function onTap(event: MouseEvent) {
|
|
|
125
126
|
:deep(.ann-num) {
|
|
126
127
|
font-size: 0.45em;
|
|
127
128
|
text-align: end;
|
|
129
|
+
ruby-position: under;
|
|
128
130
|
}
|
|
129
131
|
:deep(.ann-num-long) {
|
|
130
132
|
font-size: 0.38em;
|
|
@@ -44,10 +44,12 @@ if (!import.meta.env.SSR) {
|
|
|
44
44
|
localStorage.setItem('theme', t)
|
|
45
45
|
}, { immediate: true })
|
|
46
46
|
|
|
47
|
+
// Layout watch must NOT be immediate — it would overwrite localStorage
|
|
48
|
+
// with the default 'vertical' before nextTick restores the saved value
|
|
47
49
|
watch(layout, l => {
|
|
48
50
|
document.documentElement.setAttribute('data-layout', l)
|
|
49
51
|
localStorage.setItem('layout', l)
|
|
50
|
-
}
|
|
52
|
+
})
|
|
51
53
|
|
|
52
54
|
watch(mainFontSize, s => {
|
|
53
55
|
document.documentElement.style.setProperty('--main-font-size', s + 'px')
|
|
@@ -16,6 +16,33 @@
|
|
|
16
16
|
.ann-target.date { border-color: var(--ann-date); }
|
|
17
17
|
.ann-target.allusion { border-color: var(--ann-allusion); }
|
|
18
18
|
|
|
19
|
+
/* ─── Horizontal mode: border-bottom underline ─── */
|
|
20
|
+
.ann-target {
|
|
21
|
+
border-bottom-width: 2px;
|
|
22
|
+
border-bottom-style: solid;
|
|
23
|
+
}
|
|
24
|
+
.ann-target.ann-overlap {
|
|
25
|
+
border-bottom-width: 3px;
|
|
26
|
+
border-bottom-style: double;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ─── Vertical mode: border-left ─── */
|
|
30
|
+
[data-layout="vertical"] .ann-target,
|
|
31
|
+
.v-scroll .ann-target,
|
|
32
|
+
.part-block--vertical .ann-target {
|
|
33
|
+
border-bottom: none;
|
|
34
|
+
border-left-width: 2px;
|
|
35
|
+
border-left-style: solid;
|
|
36
|
+
padding-left: 2px;
|
|
37
|
+
}
|
|
38
|
+
[data-layout="vertical"] .ann-target.ann-overlap,
|
|
39
|
+
.v-scroll .ann-target.ann-overlap,
|
|
40
|
+
.part-block--vertical .ann-target.ann-overlap {
|
|
41
|
+
border-left-width: 3px;
|
|
42
|
+
border-left-style: double;
|
|
43
|
+
padding-left: 3px;
|
|
44
|
+
}
|
|
45
|
+
|
|
19
46
|
/* ─── Annotation kind hover states ─── */
|
|
20
47
|
.ann-target:hover {
|
|
21
48
|
background: color-mix(in srgb, var(--vermillion) 10%, transparent);
|
|
@@ -58,13 +85,26 @@
|
|
|
58
85
|
box-shadow: 0 var(--ann-shadow-y, 2px) 8px color-mix(in srgb, var(--ann-translation) 8%, transparent);
|
|
59
86
|
}
|
|
60
87
|
|
|
61
|
-
/* ─── Annotation number ─── */
|
|
88
|
+
/* ─── Annotation number — horizontal mode (superscript) ─── */
|
|
62
89
|
.ann-num {
|
|
63
90
|
color: var(--vermillion);
|
|
64
91
|
font-family: var(--sans);
|
|
65
92
|
font-weight: 600;
|
|
66
93
|
letter-spacing: 0;
|
|
94
|
+
font-size: 10px;
|
|
95
|
+
vertical-align: super;
|
|
96
|
+
margin-right: 1px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ─── Annotation number — vertical mode (ruby) ─── */
|
|
100
|
+
.v-scroll .ann-num,
|
|
101
|
+
.part-block--vertical .ann-num {
|
|
102
|
+
font-size: 0.45em;
|
|
103
|
+
text-align: end;
|
|
104
|
+
vertical-align: baseline;
|
|
105
|
+
ruby-position: under;
|
|
67
106
|
}
|
|
68
|
-
.ann-num-long
|
|
69
|
-
|
|
107
|
+
.v-scroll .ann-num-long,
|
|
108
|
+
.part-block--vertical .ann-num-long {
|
|
109
|
+
font-size: 0.38em;
|
|
70
110
|
}
|