@hanology/cham-browser 0.4.66 → 0.4.67
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
CHANGED
package/template/src/App.vue
CHANGED
|
@@ -56,7 +56,9 @@ function onKey(event: KeyboardEvent) {
|
|
|
56
56
|
<Suspense :key="route.fullPath">
|
|
57
57
|
<component :is="Component" />
|
|
58
58
|
<template #fallback>
|
|
59
|
-
<div class="route-loading"
|
|
59
|
+
<div class="route-loading">
|
|
60
|
+
<div class="route-loading-seal">文</div>
|
|
61
|
+
</div>
|
|
60
62
|
</template>
|
|
61
63
|
</Suspense>
|
|
62
64
|
</Transition>
|
|
@@ -175,4 +177,17 @@ function onKey(event: KeyboardEvent) {
|
|
|
175
177
|
justify-content: center;
|
|
176
178
|
min-height: 100vh;
|
|
177
179
|
}
|
|
180
|
+
.route-loading-seal {
|
|
181
|
+
width: 56px; height: 56px;
|
|
182
|
+
border: 2px solid var(--vermillion);
|
|
183
|
+
border-radius: 4px;
|
|
184
|
+
display: flex; align-items: center; justify-content: center;
|
|
185
|
+
font-size: 28px; font-weight: 900;
|
|
186
|
+
color: var(--vermillion);
|
|
187
|
+
animation: pulse 1.2s ease-in-out infinite;
|
|
188
|
+
}
|
|
189
|
+
@keyframes pulse {
|
|
190
|
+
0%, 100% { opacity: 0.6; transform: scale(0.96); }
|
|
191
|
+
50% { opacity: 1; transform: scale(1); }
|
|
192
|
+
}
|
|
178
193
|
</style>
|
|
@@ -51,10 +51,6 @@ export function buildVerseAnnotations(annotations: Annotation[], verseIndex: num
|
|
|
51
51
|
return segments
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function countVerseSpans(annotations: Annotation[], verseIndex: number): number {
|
|
55
|
-
return buildVerseAnnotations(annotations, verseIndex).length
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
export function renderAnnotatedText(text: string, spans: AnnSpan[], useRuby = false, startNum = 0): string {
|
|
59
55
|
if (!spans.length) return esc(text)
|
|
60
56
|
|
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
|
|
133
133
|
html {
|
|
134
134
|
scroll-behavior: smooth;
|
|
135
|
+
scroll-padding-top: 56px;
|
|
135
136
|
-webkit-font-smoothing: antialiased;
|
|
136
137
|
-moz-osx-font-smoothing: grayscale;
|
|
137
138
|
text-rendering: optimizeLegibility;
|
|
@@ -144,6 +145,7 @@ body {
|
|
|
144
145
|
line-height: 1.8;
|
|
145
146
|
min-height: 100vh;
|
|
146
147
|
overflow-x: hidden;
|
|
148
|
+
overscroll-behavior-y: contain;
|
|
147
149
|
}
|
|
148
150
|
::selection { background: var(--vermillion); color: var(--selection-text); }
|
|
149
151
|
::-webkit-scrollbar { width: 6px; height: 6px; }
|
|
@@ -364,13 +364,13 @@ function tcy(n: number): string {
|
|
|
364
364
|
<template v-if="piece.contributors && piece.contributors.length > 1">
|
|
365
365
|
<div v-for="group in contributorGroups" :key="group.title" class="v-author-group">
|
|
366
366
|
<span class="v-author-role">{{ group.title }}</span>
|
|
367
|
-
<span v-for="name in group.names" :key="name" class="v-poem-author" @click="openAuthorPane(piece.contributors!.find(c => c.name === name)?.id)">{{ name }}</span>
|
|
367
|
+
<span v-for="name in group.names" :key="name" class="v-poem-author" role="button" tabindex="0" @click="openAuthorPane(piece.contributors!.find(c => c.name === name)?.id)" @keydown.enter="openAuthorPane(piece.contributors!.find(c => c.name === name)?.id)">{{ name }}</span>
|
|
368
368
|
</div>
|
|
369
369
|
</template>
|
|
370
|
-
<span v-else class="v-poem-author" @click="openAuthorPane">{{ piece.author }}</span>
|
|
371
|
-
<
|
|
370
|
+
<span v-else class="v-poem-author" role="button" tabindex="0" @click="openAuthorPane" @keydown.enter="openAuthorPane">{{ piece.author }}</span>
|
|
371
|
+
<router-link v-if="piece.source?.textRef" :to="`/${piece.source.textRef}`" class="v-source-link">
|
|
372
372
|
← {{ meta?.title }}
|
|
373
|
-
</
|
|
373
|
+
</router-link>
|
|
374
374
|
<div class="v-poem-meta">
|
|
375
375
|
<template v-if="isMultiPart">
|
|
376
376
|
<span class="v-meta-item" v-html="tcy(piece.parts!.length) + ' ' + t('piece.stanzas')" />
|
|
@@ -543,9 +543,9 @@ function tcy(n: number): string {
|
|
|
543
543
|
<div class="h-nav-title-row">
|
|
544
544
|
<span v-if="piece.era" class="h-era">{{ piece.era }}</span>
|
|
545
545
|
<span class="h-breadcrumb">
|
|
546
|
-
<
|
|
546
|
+
<router-link v-if="piece.source?.textRef" :to="`/${piece.source.textRef}`" class="h-source-link">
|
|
547
547
|
{{ meta?.title }} →
|
|
548
|
-
</
|
|
548
|
+
</router-link>
|
|
549
549
|
<span class="h-sep">{{ piece.num }}.</span>
|
|
550
550
|
{{ piece.title }}
|
|
551
551
|
</span>
|
|
@@ -553,10 +553,10 @@ function tcy(n: number): string {
|
|
|
553
553
|
<template v-for="(group, gi) in contributorGroups" :key="group.title">
|
|
554
554
|
<span v-if="gi > 0" class="h-sep">|</span>
|
|
555
555
|
<span class="h-author-role">{{ group.title }}</span>
|
|
556
|
-
<span v-for="name in group.names" :key="name" class="h-author-link" @click="openAuthorPane(piece.contributors!.find(c => c.name === name)?.id)">{{ name }}</span>
|
|
556
|
+
<span v-for="name in group.names" :key="name" class="h-author-link" role="button" tabindex="0" @click="openAuthorPane(piece.contributors!.find(c => c.name === name)?.id)" @keydown.enter="openAuthorPane(piece.contributors!.find(c => c.name === name)?.id)">{{ name }}</span>
|
|
557
557
|
</template>
|
|
558
558
|
</template>
|
|
559
|
-
<span v-else class="h-author-link" @click="openAuthorPane">{{ piece.author }}</span>
|
|
559
|
+
<span v-else class="h-author-link" role="button" tabindex="0" @click="openAuthorPane" @keydown.enter="openAuthorPane">{{ piece.author }}</span>
|
|
560
560
|
</div>
|
|
561
561
|
<div class="h-controls">
|
|
562
562
|
<span class="h-tag h-tag-pager">{{ piece.num }} / {{ pieces.length }}</span>
|