@tnotesjs/core 0.1.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.

Potentially problematic release.


This version of @tnotesjs/core might be problematic. Click here for more details.

Files changed (117) hide show
  1. package/README.md +105 -0
  2. package/dist/chunk-K3X5OP3N.js +1532 -0
  3. package/dist/cli/index.d.ts +2 -0
  4. package/dist/cli/index.js +4199 -0
  5. package/dist/index.d.ts +138 -0
  6. package/dist/index.js +9 -0
  7. package/package.json +74 -0
  8. package/types/config.ts +61 -0
  9. package/types/index.ts +11 -0
  10. package/types/note.ts +33 -0
  11. package/vitepress/assets/icons/icon__check.svg +3 -0
  12. package/vitepress/assets/icons/icon__clipboard.svg +8 -0
  13. package/vitepress/assets/icons/icon__close.svg +1 -0
  14. package/vitepress/assets/icons/icon__collapse.svg +1 -0
  15. package/vitepress/assets/icons/icon__confirm.svg +1 -0
  16. package/vitepress/assets/icons/icon__copy.svg +4 -0
  17. package/vitepress/assets/icons/icon__focus.svg +1 -0
  18. package/vitepress/assets/icons/icon__fold.svg +3 -0
  19. package/vitepress/assets/icons/icon__folder.svg +1 -0
  20. package/vitepress/assets/icons/icon__fullscreen.svg +1 -0
  21. package/vitepress/assets/icons/icon__fullscreen_exit.svg +1 -0
  22. package/vitepress/assets/icons/icon__github.svg +4 -0
  23. package/vitepress/assets/icons/icon__mindmap.svg +1 -0
  24. package/vitepress/assets/icons/icon__next.svg +1 -0
  25. package/vitepress/assets/icons/icon__number_gray.svg +1 -0
  26. package/vitepress/assets/icons/icon__number_purple.svg +1 -0
  27. package/vitepress/assets/icons/icon__prev.svg +1 -0
  28. package/vitepress/assets/icons/icon__restore.svg +1 -0
  29. package/vitepress/assets/icons/icon__rotate.svg +4 -0
  30. package/vitepress/assets/icons/icon__search.svg +1 -0
  31. package/vitepress/assets/icons/icon__sidebar_collapsed.svg +1 -0
  32. package/vitepress/assets/icons/icon__sidebar_opened.svg +1 -0
  33. package/vitepress/assets/icons/icon__totop.svg +6 -0
  34. package/vitepress/assets/icons/icon__vscode.svg +6 -0
  35. package/vitepress/assets/icons/icon__zoom_fit.svg +1 -0
  36. package/vitepress/assets/icons/icon__zoom_in.svg +1 -0
  37. package/vitepress/assets/icons/icon__zoom_out.svg +1 -0
  38. package/vitepress/assets/icons/icon__zoom_reset.svg +1 -0
  39. package/vitepress/assets/icons/index.ts +38 -0
  40. package/vitepress/components/BilibiliOutsidePlayer/BilibiliOutsidePlayer.vue +20 -0
  41. package/vitepress/components/CodeBlockFullscreen/CodeBlockFullscreen.vue +373 -0
  42. package/vitepress/components/CodeBlockFullscreen/index.ts +115 -0
  43. package/vitepress/components/CodeBlockFullscreen/styles.css +64 -0
  44. package/vitepress/components/Discussions/Discussions.module.scss +32 -0
  45. package/vitepress/components/Discussions/Discussions.vue +211 -0
  46. package/vitepress/components/EnWordList/EnWordList.module.scss +124 -0
  47. package/vitepress/components/EnWordList/EnWordList.vue +543 -0
  48. package/vitepress/components/EnWordList/RightClickMenu.module.scss +22 -0
  49. package/vitepress/components/EnWordList/RightClickMenu.vue +66 -0
  50. package/vitepress/components/Footprints/Footprints.module.scss +93 -0
  51. package/vitepress/components/Footprints/Footprints.vue +377 -0
  52. package/vitepress/components/Layout/AboutModal.module.scss +233 -0
  53. package/vitepress/components/Layout/AboutModal.vue +105 -0
  54. package/vitepress/components/Layout/AboutPanel.vue +266 -0
  55. package/vitepress/components/Layout/ContentCollapse.vue +603 -0
  56. package/vitepress/components/Layout/CustomSidebar.vue +605 -0
  57. package/vitepress/components/Layout/DocBeforeControls.vue +139 -0
  58. package/vitepress/components/Layout/DocFooter.vue +225 -0
  59. package/vitepress/components/Layout/ImagePreview.module.scss +201 -0
  60. package/vitepress/components/Layout/ImagePreview.vue +281 -0
  61. package/vitepress/components/Layout/Layout.module.scss +661 -0
  62. package/vitepress/components/Layout/Layout.vue +542 -0
  63. package/vitepress/components/Layout/NoteStatus.vue +140 -0
  64. package/vitepress/components/Layout/SidebarItems.vue +263 -0
  65. package/vitepress/components/Layout/SidebarNavBefore.vue +92 -0
  66. package/vitepress/components/Layout/Swiper.vue +167 -0
  67. package/vitepress/components/Layout/ToggleFullContent.module.scss +11 -0
  68. package/vitepress/components/Layout/ToggleFullContent.vue +34 -0
  69. package/vitepress/components/Layout/ToggleSidebar.module.scss +11 -0
  70. package/vitepress/components/Layout/ToggleSidebar.vue +35 -0
  71. package/vitepress/components/Layout/composables/useCollapseControl.ts +88 -0
  72. package/vitepress/components/Layout/composables/useNoteConfig.ts +121 -0
  73. package/vitepress/components/Layout/composables/useNoteSave.ts +173 -0
  74. package/vitepress/components/Layout/composables/useNoteValidation.ts +85 -0
  75. package/vitepress/components/Layout/composables/useRedirect.ts +110 -0
  76. package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +85 -0
  77. package/vitepress/components/Layout/homeReadme.data.ts +124 -0
  78. package/vitepress/components/LoadingPage/LoadingPage.vue +192 -0
  79. package/vitepress/components/MarkMap/MarkMap.module.scss +159 -0
  80. package/vitepress/components/MarkMap/MarkMap.vue +404 -0
  81. package/vitepress/components/Mermaid/Mermaid.module.scss +275 -0
  82. package/vitepress/components/Mermaid/Mermaid.vue +364 -0
  83. package/vitepress/components/NotesTable/NotesTable.module.scss +77 -0
  84. package/vitepress/components/NotesTable/NotesTable.vue +98 -0
  85. package/vitepress/components/NotesTable/README.md +67 -0
  86. package/vitepress/components/Settings/Settings.module.scss +433 -0
  87. package/vitepress/components/Settings/Settings.vue +306 -0
  88. package/vitepress/components/SidebarCard/MindMapView.vue +483 -0
  89. package/vitepress/components/SidebarCard/NotesTrendChart.vue +108 -0
  90. package/vitepress/components/SidebarCard/SidebarCard.vue +948 -0
  91. package/vitepress/components/Tooltip/Tooltip.vue +70 -0
  92. package/vitepress/components/constants.ts +91 -0
  93. package/vitepress/components/notesConfig.data.ts +73 -0
  94. package/vitepress/components/sidebar.data.ts +59 -0
  95. package/vitepress/components/tnotes-config.data.ts +21 -0
  96. package/vitepress/components/utils.ts +26 -0
  97. package/vitepress/config/index.ts +126 -0
  98. package/vitepress/configs/constants.ts +26 -0
  99. package/vitepress/configs/head.config.ts +25 -0
  100. package/vitepress/configs/index.ts +9 -0
  101. package/vitepress/configs/markdown-it.d.ts +23 -0
  102. package/vitepress/configs/markdown.config.ts +366 -0
  103. package/vitepress/configs/theme.config.ts +108 -0
  104. package/vitepress/plugins/buildProgressPlugin.ts +390 -0
  105. package/vitepress/plugins/getNoteByConfigIdPlugin.ts +107 -0
  106. package/vitepress/plugins/renameNotePlugin.ts +60 -0
  107. package/vitepress/plugins/updateConfigPlugin.ts +63 -0
  108. package/vitepress/theme/index.ts +95 -0
  109. package/vitepress/theme/styles/base.scss +50 -0
  110. package/vitepress/theme/styles/components/404.scss +31 -0
  111. package/vitepress/theme/styles/components/collapse.scss +175 -0
  112. package/vitepress/theme/styles/components/markmap.scss +101 -0
  113. package/vitepress/theme/styles/components/swiper.scss +255 -0
  114. package/vitepress/theme/styles/index.scss +25 -0
  115. package/vitepress/theme/styles/layout.scss +62 -0
  116. package/vitepress/theme/styles/utilities.scss +39 -0
  117. package/vitepress/theme/styles/vitepress-override.scss +25 -0
@@ -0,0 +1,139 @@
1
+ <template>
2
+ <div :class="$style.docBeforeContainer">
3
+ <div :class="$style.leftArea">
4
+ <div
5
+ :class="[$style.toggleSidebarBox, $style.pcOnly]"
6
+ v-show="!isFullContentMode"
7
+ >
8
+ <ToggleSidebar />
9
+ </div>
10
+ <div :class="[$style.vscodeBox, $style.pcOnly]" v-show="vscodeNotesDir">
11
+ <a
12
+ :href="vscodeNotesDir"
13
+ aria-label="open in vscode"
14
+ title="open in vscode"
15
+ target="_blank"
16
+ >
17
+ <img :src="icon__vscode" alt="open in vscode" />
18
+ </a>
19
+ </div>
20
+ <div :class="[$style.contentToggleBox, $style.pcOnly]">
21
+ <ToggleFullContent />
22
+ </div>
23
+ <!-- 知识库的 GitHub 链接(仅首页显示,PC 端) -->
24
+ <div :class="[$style.githubRepoBox, $style.pcOnly]" v-show="isHomeReadme">
25
+ <a
26
+ :href="`https://github.com/tnotesjs/${vpData.page.value.title.toLowerCase()}/blob/main/README.md`"
27
+ :aria-label="`tnotesjs github - ${vpData.page.value.title.toLowerCase()} 笔记仓库链接`"
28
+ :title="`tnotesjs github - ${vpData.page.value.title.toLowerCase()} 笔记仓库链接`"
29
+ target="_blank"
30
+ rel="noopener"
31
+ >
32
+ <img :src="icon__github" alt="github icon" />
33
+ </a>
34
+ </div>
35
+ </div>
36
+ <div :class="$style.rightArea">
37
+ <!-- 一键复制笔记内容按钮 -->
38
+ <div :class="$style.collapseAllBtn" v-show="currentNoteId">
39
+ <button
40
+ :class="$style.collapseAllButton"
41
+ @click="copyNoteContent"
42
+ title="复制笔记原始内容"
43
+ type="button"
44
+ >
45
+ <img :src="icon__clipboard" alt="copy note content" />
46
+ </button>
47
+ </div>
48
+ <Transition name="toast">
49
+ <div v-if="showCopyToast" :class="$style.toast">✓ 复制成功</div>
50
+ </Transition>
51
+ <!-- 全局折叠/展开按钮 -->
52
+ <div
53
+ :class="$style.collapseAllBtn"
54
+ v-show="currentNoteId || isHomeReadme"
55
+ >
56
+ <button
57
+ :class="$style.collapseAllButton"
58
+ @click="toggleAllCollapse"
59
+ :title="allCollapsed ? '展开所有区域' : '折叠所有区域'"
60
+ type="button"
61
+ >
62
+ <img :src="icon__fold" alt="collapse all" />
63
+ </button>
64
+ </div>
65
+ <!-- 单个图标,点击打开 modal,只在有笔记数据的页面显示 -->
66
+ <div
67
+ :class="$style.aboutBtn"
68
+ v-show="
69
+ (currentNoteId && created_at && updated_at) ||
70
+ (isHomeReadme && homeReadmeCreatedAt && homeReadmeUpdatedAt)
71
+ "
72
+ >
73
+ <button
74
+ :class="$style.aboutIconButton"
75
+ @click="$emit('open-time-modal')"
76
+ aria-haspopup="dialog"
77
+ :aria-expanded="timeModalOpen.toString()"
78
+ :title="isHomeReadme ? '关于这个知识库' : '关于这篇笔记'"
79
+ type="button"
80
+ >
81
+ !
82
+ </button>
83
+ </div>
84
+ </div>
85
+ </div>
86
+ </template>
87
+
88
+ <script setup lang="ts">
89
+ import { ref } from 'vue'
90
+ import { useData } from 'vitepress'
91
+ import ToggleSidebar from './ToggleSidebar.vue'
92
+ import ToggleFullContent from './ToggleFullContent.vue'
93
+
94
+ import { icon__github, icon__vscode, icon__fold, icon__clipboard } from '../../assets/icons'
95
+
96
+ const props = defineProps<{
97
+ isFullContentMode: boolean
98
+ vscodeNotesDir: string
99
+ isHomeReadme: boolean
100
+ currentNoteId: string | null
101
+ created_at: string | undefined
102
+ updated_at: string | undefined
103
+ homeReadmeCreatedAt: string | undefined
104
+ homeReadmeUpdatedAt: string | undefined
105
+ timeModalOpen: boolean
106
+ allCollapsed: boolean
107
+ }>()
108
+
109
+ const showCopyToast = ref(false)
110
+ let copyToastTimer: ReturnType<typeof setTimeout> | null = null
111
+
112
+ async function copyNoteContent() {
113
+ const raw = vpData.frontmatter.value.rawContent
114
+ if (!raw) return
115
+ try {
116
+ await navigator.clipboard.writeText(raw)
117
+ if (copyToastTimer) clearTimeout(copyToastTimer)
118
+ showCopyToast.value = true
119
+ copyToastTimer = setTimeout(() => {
120
+ showCopyToast.value = false
121
+ }, 2000)
122
+ } catch (e) {
123
+ console.error('复制失败', e)
124
+ }
125
+ }
126
+
127
+ const emit = defineEmits<{
128
+ (e: 'open-time-modal'): void
129
+ (e: 'toggle-all-collapse'): void
130
+ }>()
131
+
132
+ const vpData = useData()
133
+
134
+ function toggleAllCollapse() {
135
+ emit('toggle-all-collapse')
136
+ }
137
+ </script>
138
+
139
+ <style module src="./Layout.module.scss"></style>
@@ -0,0 +1,225 @@
1
+ <template>
2
+ <nav class="custom-doc-footer" v-if="prev || next">
3
+ <div class="container">
4
+ <div class="prev">
5
+ <a v-if="prev" :href="prev.link" class="pager-link prev-link">
6
+ <span class="desc">上一篇</span>
7
+ <span class="title">
8
+ <span v-if="prev.emoji" class="emoji">{{ prev.emoji }}</span>
9
+ {{ prev.title }}
10
+ </span>
11
+ </a>
12
+ </div>
13
+
14
+ <div class="next">
15
+ <a v-if="next" :href="next.link" class="pager-link next-link">
16
+ <span class="desc">下一篇</span>
17
+ <span class="title">
18
+ <span v-if="next.emoji" class="emoji">{{ next.emoji }}</span>
19
+ {{ next.title }}
20
+ </span>
21
+ </a>
22
+ </div>
23
+ </div>
24
+ </nav>
25
+ </template>
26
+
27
+ <script setup lang="ts">
28
+ import { computed } from 'vue'
29
+ import { useRoute, useData } from 'vitepress'
30
+ // @ts-expect-error - VitePress Data Loader
31
+ import { data as sidebarConfig } from '../sidebar.data'
32
+
33
+ interface NavItem {
34
+ link: string
35
+ title: string
36
+ emoji: string
37
+ }
38
+
39
+ const route = useRoute()
40
+ const { site } = useData()
41
+
42
+ // 获取 base 路径
43
+ const base = computed(() => site.value.base || '/')
44
+
45
+ // 提取所有笔记为扁平列表(按 sidebar.json 顺序)
46
+ const allNotes = computed(() => {
47
+ const notes: NavItem[] = []
48
+
49
+ if (!sidebarConfig || !sidebarConfig['/notes/']) {
50
+ return notes
51
+ }
52
+
53
+ const groups = sidebarConfig['/notes/']
54
+
55
+ // 遍历所有分组
56
+ groups.forEach((group: any) => {
57
+ if (group.items && Array.isArray(group.items)) {
58
+ group.items.forEach((item: any) => {
59
+ if (item.link && item.text) {
60
+ // 提取 emoji 和标题
61
+ const { emoji, title } = extractEmojiAndTitle(item.text)
62
+
63
+ // 构建完整链接
64
+ const cleanLink = item.link.startsWith('/')
65
+ ? item.link.slice(1)
66
+ : item.link
67
+ const fullLink = base.value + cleanLink
68
+
69
+ notes.push({
70
+ link: fullLink,
71
+ title,
72
+ emoji,
73
+ })
74
+ }
75
+ })
76
+ }
77
+ })
78
+
79
+ return notes
80
+ })
81
+
82
+ // 提取 emoji 和标题
83
+ function extractEmojiAndTitle(text: string): { emoji: string; title: string } {
84
+ // 匹配开头的 emoji(包括常见的完成状态图标)
85
+ const emojiMatch = text.match(
86
+ /^([\u{1F300}-\u{1F9FF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}✅❌⏰]+)\s*/u
87
+ )
88
+
89
+ if (emojiMatch) {
90
+ const emoji = emojiMatch[1]
91
+ const rest = text.slice(emojiMatch[0].length)
92
+ // 移除笔记编号(如 "0001. ")
93
+ const title = rest.replace(/^\d{4}\.\s*/, '')
94
+ return { emoji, title }
95
+ }
96
+
97
+ // 没有 emoji,只移除编号
98
+ const title = text.replace(/^\d{4}\.\s*/, '')
99
+ return { emoji: '', title }
100
+ }
101
+
102
+ // 获取当前笔记的索引
103
+ const currentIndex = computed(() => {
104
+ // 对路径进行解码,因为 route.path 可能包含 URL 编码
105
+ const decodedRoutePath = decodeURIComponent(route.path)
106
+
107
+ return allNotes.value.findIndex((note) => {
108
+ const decodedNoteLink = decodeURIComponent(note.link)
109
+ return (
110
+ decodedRoutePath === decodedNoteLink ||
111
+ decodedRoutePath === decodedNoteLink + '.html'
112
+ )
113
+ })
114
+ })
115
+
116
+ // 上一篇
117
+ const prev = computed(() => {
118
+ if (currentIndex.value <= 0) return null
119
+ return allNotes.value[currentIndex.value - 1]
120
+ })
121
+
122
+ // 下一篇
123
+ const next = computed(() => {
124
+ if (currentIndex.value < 0 || currentIndex.value >= allNotes.value.length - 1)
125
+ return null
126
+ return allNotes.value[currentIndex.value + 1]
127
+ })
128
+ </script>
129
+
130
+ <style scoped>
131
+ .custom-doc-footer {
132
+ margin-top: 64px;
133
+ border-top: 1px solid var(--vp-c-divider);
134
+ padding-top: 32px;
135
+ }
136
+
137
+ .container {
138
+ display: flex;
139
+ gap: 16px;
140
+ }
141
+
142
+ .prev,
143
+ .next {
144
+ flex: 1;
145
+ }
146
+
147
+ .prev {
148
+ display: flex;
149
+ justify-content: flex-start;
150
+ }
151
+
152
+ .next {
153
+ display: flex;
154
+ justify-content: flex-end;
155
+ }
156
+
157
+ .pager-link {
158
+ display: block;
159
+ border: 1px solid var(--vp-c-divider);
160
+ border-radius: 8px;
161
+ padding: 11px 16px 13px;
162
+ width: 100%;
163
+ max-width: 320px;
164
+ transition: border-color 0.25s, background-color 0.25s;
165
+ text-decoration: none;
166
+ }
167
+
168
+ .pager-link:hover {
169
+ border-color: var(--vp-c-brand-1);
170
+ background-color: var(--vp-c-bg-soft);
171
+ }
172
+
173
+ .prev-link {
174
+ text-align: left;
175
+ }
176
+
177
+ .next-link {
178
+ text-align: right;
179
+ }
180
+
181
+ .desc {
182
+ display: block;
183
+ line-height: 20px;
184
+ font-size: 12px;
185
+ font-weight: 500;
186
+ color: var(--vp-c-text-2);
187
+ }
188
+
189
+ .title {
190
+ display: block;
191
+ line-height: 20px;
192
+ font-size: 14px;
193
+ font-weight: 500;
194
+ color: var(--vp-c-brand-1);
195
+ transition: color 0.25s;
196
+ padding-top: 4px;
197
+ }
198
+
199
+ .pager-link:hover .title {
200
+ color: var(--vp-c-brand-2);
201
+ }
202
+
203
+ .emoji {
204
+ margin-right: 4px;
205
+ }
206
+
207
+ /* 响应式调整 */
208
+ @media (max-width: 768px) {
209
+ .container {
210
+ flex-direction: column;
211
+ gap: 12px;
212
+ }
213
+
214
+ .pager-link {
215
+ max-width: 100%;
216
+ }
217
+ }
218
+ </style>
219
+
220
+ <!-- 全局样式:隐藏 VitePress 默认的 doc-footer -->
221
+ <style>
222
+ .VPDocFooter {
223
+ display: none !important;
224
+ }
225
+ </style>
@@ -0,0 +1,201 @@
1
+ /* 预览遮罩层 */
2
+ .tnPreview {
3
+ position: fixed;
4
+ inset: 0;
5
+ z-index: 3000;
6
+ background: rgba(0, 0, 0, 0.85);
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ backdrop-filter: blur(4px);
11
+ animation: fadeIn 0.2s ease-out;
12
+ }
13
+
14
+ @keyframes fadeIn {
15
+ from {
16
+ opacity: 0;
17
+ }
18
+ to {
19
+ opacity: 1;
20
+ }
21
+ }
22
+
23
+ /* 工具栏 */
24
+ .toolbar {
25
+ position: absolute;
26
+ top: 16px;
27
+ right: 16px;
28
+ display: flex;
29
+ gap: 10px;
30
+ z-index: 2;
31
+
32
+ button {
33
+ width: 36px;
34
+ height: 36px;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ background: rgba(42, 42, 42, 0.85);
39
+ border: 1px solid rgba(255, 255, 255, 0.15);
40
+ border-radius: 8px;
41
+ cursor: pointer;
42
+ transition: all 0.2s ease;
43
+
44
+ img {
45
+ width: 18px;
46
+ height: 18px;
47
+ transition: transform 0.2s ease;
48
+ }
49
+
50
+ &:hover {
51
+ background: rgba(255, 255, 255, 0.15);
52
+ transform: translateY(-2px);
53
+
54
+ img {
55
+ transform: scale(1.1);
56
+ }
57
+ }
58
+
59
+ &:active {
60
+ transform: translateY(0);
61
+ }
62
+ }
63
+ }
64
+
65
+ .close {
66
+ &:hover img {
67
+ transform: rotate(90deg) scale(1.1) !important;
68
+ }
69
+ }
70
+
71
+ /* 左右切换按钮 */
72
+ .nav {
73
+ position: absolute;
74
+ top: 50%;
75
+ transform: translateY(-50%);
76
+ width: 56px;
77
+ height: 56px;
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+ background: rgba(0, 0, 0, 0.3);
82
+ border: none;
83
+ border-radius: 50%;
84
+ cursor: pointer;
85
+ z-index: 2;
86
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
87
+
88
+ img {
89
+ width: 2rem;
90
+ height: 2rem;
91
+ transition: transform 0.3s ease;
92
+ }
93
+
94
+ &:hover {
95
+ background: rgba(0, 0, 0, 0.7);
96
+ transform: translateY(-50%) scale(1.15);
97
+
98
+ img {
99
+ filter: brightness(1.2);
100
+ }
101
+ }
102
+
103
+ &:active {
104
+ transform: translateY(-50%) scale(1.05);
105
+ }
106
+ }
107
+
108
+ .navLeft {
109
+ left: 24px;
110
+
111
+ &:hover img {
112
+ transform: translateX(-2px);
113
+ }
114
+ }
115
+
116
+ .navRight {
117
+ right: 24px;
118
+
119
+ &:hover img {
120
+ transform: translateX(2px);
121
+ }
122
+ }
123
+
124
+ /* 预览图片 */
125
+ .img {
126
+ max-width: 90vw;
127
+ max-height: 90vh;
128
+ user-select: none;
129
+ transition: transform 0.1s ease-out;
130
+
131
+ &.dragging {
132
+ cursor: grabbing !important;
133
+ }
134
+ }
135
+
136
+ /* 底部页码指示器 */
137
+ .counter {
138
+ position: absolute;
139
+ bottom: 20px;
140
+ left: 50%;
141
+ transform: translateX(-50%);
142
+ background: rgba(0, 0, 0, 0.65);
143
+ color: #fff;
144
+ padding: 8px 16px;
145
+ border-radius: 16px;
146
+ font-size: 0.9rem;
147
+ font-weight: 500;
148
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
149
+ z-index: 2;
150
+ user-select: none;
151
+ backdrop-filter: blur(8px);
152
+ border: 1px solid rgba(255, 255, 255, 0.1);
153
+ }
154
+
155
+ /* 响应式设计 */
156
+ @media (max-width: 768px) {
157
+ .nav {
158
+ width: 48px;
159
+ height: 48px;
160
+
161
+ img {
162
+ width: 1.5rem;
163
+ height: 1.5rem;
164
+ }
165
+ }
166
+
167
+ .navLeft {
168
+ left: 12px;
169
+ }
170
+
171
+ .navRight {
172
+ right: 12px;
173
+ }
174
+
175
+ .toolbar {
176
+ top: 12px;
177
+ right: 12px;
178
+ gap: 8px;
179
+
180
+ button {
181
+ width: 32px;
182
+ height: 32px;
183
+
184
+ img {
185
+ width: 16px;
186
+ height: 16px;
187
+ }
188
+ }
189
+ }
190
+
191
+ .counter {
192
+ bottom: 16px;
193
+ font-size: 0.85rem;
194
+ padding: 6px 14px;
195
+ }
196
+
197
+ .img {
198
+ max-width: 95vw;
199
+ max-height: 85vh;
200
+ }
201
+ }