@hanology/cham-browser 0.3.9 → 0.4.2

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.
Files changed (30) hide show
  1. package/dist/cli.js +303 -32
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +1 -1
  4. package/template/index.html +4 -8
  5. package/template/src/App.vue +101 -17
  6. package/template/src/components/AnnotationControlBar.vue +119 -49
  7. package/template/src/components/AnnotationTooltip.vue +319 -95
  8. package/template/src/components/BackToTop.vue +4 -0
  9. package/template/src/components/BookCard.vue +10 -11
  10. package/template/src/components/HorizontalDisplay.vue +56 -0
  11. package/template/src/components/PartBlock.vue +9 -0
  12. package/template/src/components/PoemCard.vue +1 -0
  13. package/template/src/components/PronunciationGroup.vue +27 -18
  14. package/template/src/components/ReadingToolbar.vue +20 -0
  15. package/template/src/components/SectionBlock.vue +91 -12
  16. package/template/src/components/SideNav.vue +5 -4
  17. package/template/src/components/VerticalScroll.vue +35 -0
  18. package/template/src/composables/useAnnotationRenderer.ts +57 -25
  19. package/template/src/composables/useData.ts +6 -1
  20. package/template/src/composables/useI18n.ts +36 -3
  21. package/template/src/composables/useReadingMode.ts +9 -4
  22. package/template/src/composables/useSiteConfig.ts +12 -1
  23. package/template/src/router.ts +0 -2
  24. package/template/src/styles/main.css +88 -0
  25. package/template/src/types.ts +12 -4
  26. package/template/src/views/AuthorView.vue +5 -5
  27. package/template/src/views/BookHome.vue +45 -21
  28. package/template/src/views/LibraryHome.vue +39 -41
  29. package/template/src/views/PieceView.vue +436 -71
  30. package/template/src/views/AboutView.vue +0 -191
@@ -1,191 +0,0 @@
1
- <script setup lang="ts">
2
- import { useI18n } from '../composables/useI18n'
3
- import { useTitle } from '../composables/useTitle'
4
- import { useReadingMode } from '../composables/useReadingMode'
5
- import { useHorizontalScroll } from '../composables/useHorizontalScroll'
6
- import SideNav from '../components/SideNav.vue'
7
- import ReadingToolbar from '../components/ReadingToolbar.vue'
8
- import BackToTop from '../components/BackToTop.vue'
9
- import { useSiteConfig } from '../composables/useSiteConfig'
10
- import { ref, computed } from 'vue'
11
- import { useRouter } from 'vue-router'
12
-
13
- const { t, locale } = useI18n()
14
- const { layout } = useReadingMode()
15
- const { logoUrl } = useSiteConfig()
16
- const isVertical = computed(() => layout.value === 'vertical')
17
- const vPageRef = ref<HTMLElement | null>(null)
18
- const vScroll = useHorizontalScroll(vPageRef)
19
- const router = useRouter()
20
-
21
- useTitle(locale.value === 'en' ? 'About — Hanology' : '關於 — 漢流')
22
-
23
- function goBack() { router.push('/') }
24
- function goHome() { router.push('/') }
25
- </script>
26
-
27
- <template>
28
- <div v-if="isVertical" class="v-root">
29
- <SideNav @back="goBack" @home="goHome" />
30
- <div ref="vPageRef" class="v-page">
31
- <section class="v-about">
32
- <h1 class="v-about-title">關 於 漢 流</h1>
33
- <div class="v-divider"></div>
34
- <div class="v-about-body">
35
- <p><strong>漢流</strong>,粵音 Han-Lou,普音 Han-Liu,意為「漢學之流」。</p>
36
- <p>經典如水,源遠流長,世代浸潤其中,前人開源,後人受益。每一代人都能在經典的長河中,找到屬於自己的領悟。</p>
37
- <p><strong>Hanology</strong>,English portmanteau of <em>Han</em> + <em>anthology</em> + <em>-logy</em> (the study of). The sound "lou/liu" echoes the first syllable of "-logy" — a perfect phonetic and semantic fit.</p>
38
- <p>Hanology is a digital library for classical Chinese texts, designed to make the wisdom of the ages accessible in the modern world.</p>
39
- </div>
40
- </section>
41
- </div>
42
- </div>
43
-
44
- <div v-else class="h-root">
45
- <header class="h-header">
46
- <button class="h-back" @click="goBack">← {{ t('nav.back') }}</button>
47
- <h1 class="h-page-title">關於漢流 / About Hanology</h1>
48
- </header>
49
- <div class="h-content">
50
- <img v-if="logoUrl" :src="logoUrl" alt="" class="h-logo" />
51
- <div v-else class="h-seal">漢流</div>
52
- <div class="h-about-block">
53
- <h2>漢流 · Hanology</h2>
54
- <p><strong>漢流</strong>,粵音 Han-Lou,普音 Han-Liu,意為「漢學之流」。</p>
55
- <p>經典如水,源遠流長,世代浸潤其中,前人開源,後人受益。每一代人都能在經典的長河中,找到屬於自己的領悟。</p>
56
- </div>
57
- <div class="h-about-block">
58
- <h2>Hanology</h2>
59
- <p>English portmanteau of <em>Han</em> + <em>anthology</em> + <em>-logy</em> (the study of).</p>
60
- <p>The sound "lou/liu" echoes the first syllable of "-logy" — a perfect phonetic and semantic fit. Just as the classics flow through generations, Hanology aims to carry that stream into the digital age.</p>
61
- </div>
62
- <div class="h-about-block">
63
- <h2>Our Mission</h2>
64
- <p>Hanology is a digital library for classical Chinese texts. We believe that the wisdom of antiquity should not be locked behind impenetrable editions or forgotten in dusty shelves. By combining rigorous scholarship with thoughtful design, we make the classics accessible, beautiful, and alive for every reader.</p>
65
- </div>
66
- </div>
67
- <BackToTop />
68
- <ReadingToolbar />
69
- </div>
70
- </template>
71
-
72
- <style scoped>
73
- /* ═══════ 直排模式 ═══════ */
74
- .v-page {
75
- height: 100vh;
76
- display: flex;
77
- flex-direction: row-reverse;
78
- overflow-x: auto;
79
- overflow-y: hidden;
80
- margin-right: var(--nav-width, 56px);
81
- padding: 0 32px;
82
- background: var(--paper);
83
- scrollbar-width: thin;
84
- scrollbar-color: var(--gold) transparent;
85
- scroll-snap-type: x proximity;
86
- }
87
- .v-page::-webkit-scrollbar { height: 4px; }
88
- .v-page::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }
89
-
90
- .v-about {
91
- writing-mode: vertical-rl;
92
- text-orientation: mixed;
93
- flex-shrink: 0;
94
- height: 100vh;
95
- display: flex;
96
- flex-direction: column;
97
- align-items: flex-start;
98
- justify-content: center;
99
- padding: 40px 24px;
100
- }
101
- .v-about-title {
102
- font-size: 48px; font-weight: 900;
103
- letter-spacing: 16px; color: var(--ink);
104
- margin-left: 20px; padding-left: 20px;
105
- border-left: 4px solid var(--vermillion);
106
- line-height: 1.6;
107
- }
108
- .v-divider {
109
- width: 2px; height: 80px;
110
- background: linear-gradient(180deg, transparent, var(--gold), transparent);
111
- margin-left: 20px;
112
- }
113
- .v-about-body {
114
- font-size: 16px; line-height: 2.4;
115
- color: var(--ink-mid);
116
- max-height: 80vh;
117
- overflow-x: auto;
118
- }
119
- .v-about-body p {
120
- margin-left: 16px;
121
- text-indent: 0;
122
- }
123
-
124
- /* ═══════ 橫排模式 ═══════ */
125
- .h-root { max-width: 960px; margin: 0 auto; padding: 40px 24px 120px; }
126
- .h-header {
127
- display: flex; align-items: center; gap: 16px;
128
- margin-bottom: 40px; padding-bottom: 16px;
129
- border-bottom: 1px solid var(--border);
130
- }
131
- .h-back {
132
- padding: 6px 16px; border: 1px solid var(--border);
133
- border-radius: 2px; background: none;
134
- font-family: var(--sans); font-size: 13px;
135
- color: var(--ink-mid); cursor: pointer;
136
- transition: all 0.2s;
137
- }
138
- .h-back:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
139
- .h-page-title { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
140
-
141
- .h-content { max-width: 680px; margin: 0 auto; }
142
- .h-logo {
143
- height: 80px;
144
- width: auto;
145
- object-fit: contain;
146
- margin: 0 auto 40px;
147
- display: block;
148
- }
149
- .h-seal {
150
- writing-mode: vertical-rl;
151
- text-orientation: upright;
152
- display: inline-flex;
153
- align-items: center; justify-content: center;
154
- width: 56px; height: 72px;
155
- border: 2px solid var(--vermillion);
156
- color: var(--vermillion);
157
- font-size: 24px; font-family: var(--serif);
158
- font-weight: 900; letter-spacing: 2px;
159
- margin: 0 auto 40px; border-radius: 4px;
160
- line-height: 1;
161
- }
162
- .h-about-block {
163
- margin-bottom: 40px; padding: 32px;
164
- background: var(--surface);
165
- border: 1px solid var(--border-light);
166
- border-radius: 8px;
167
- animation: cardEnter 0.5s var(--ease-out-expo, ease) both;
168
- }
169
- @keyframes cardEnter {
170
- from { opacity: 0; transform: translateY(12px); }
171
- to { opacity: 1; transform: translateY(0); }
172
- }
173
- .h-about-block:last-child { margin-bottom: 0; }
174
- .h-about-block h2 {
175
- font-size: 20px; font-weight: 700;
176
- letter-spacing: 3px; color: var(--ink);
177
- margin-bottom: 16px; padding-bottom: 12px;
178
- border-bottom: 1px solid var(--border);
179
- }
180
- .h-about-block p {
181
- font-size: 16px; line-height: 2.2;
182
- color: var(--ink-mid); text-align: justify;
183
- text-indent: 2em; margin-bottom: 12px;
184
- }
185
- .h-about-block p:last-child { margin-bottom: 0; }
186
-
187
- @media (max-width: 768px) {
188
- .h-root { padding: 24px 16px 80px; }
189
- .h-about-block { padding: 20px; }
190
- }
191
- </style>