From 35aed42617e6849e4393854c81265d1ec14d025c Mon Sep 17 00:00:00 2001 From: Jiao77 Date: Thu, 5 Mar 2026 13:53:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=E8=AF=84=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E5=92=8C?= =?UTF-8?q?=20Emoji=20=E9=80=89=E6=8B=A9=E5=99=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: - 新增图片上传功能,支持上传到外部图床并插入 Markdown 格式图片 - 新增灯箱功能,支持图片点击放大、滚轮缩放、拖拽移动 - 新增 Emoji 选择器,提供 70 个常用表情快捷插入 - 移除未使用的 pages 集合定义以消除警告 技术细节: - 图床 API 支持自定义配置 (URL/Token) - 灯箱缩放范围 50%-300%,带平滑过渡动画 - Emoji 选择器支持点击外部自动关闭 Co-authored-by: Qwen-Coder --- src/components/CommentSection.vue | 580 +++++++++++++++++++++++++++++- src/content/config.ts | 13 - 2 files changed, 565 insertions(+), 28 deletions(-) diff --git a/src/components/CommentSection.vue b/src/components/CommentSection.vue index c03ec44..d145c64 100644 --- a/src/components/CommentSection.vue +++ b/src/components/CommentSection.vue @@ -1,7 +1,7 @@ @@ -410,7 +937,9 @@ onMounted(() => { } .comment-content :deep(img) { - @apply max-w-full rounded-lg my-2; + @apply max-w-full rounded-lg my-2 cursor-pointer hover:opacity-90 transition-opacity; + max-height: 400px; + object-fit: contain; } .comment-content :deep(table) { @@ -425,4 +954,25 @@ onMounted(() => { .comment-content :deep(th) { @apply bg-gray-100 dark:bg-gray-800 font-bold; } + +/* 灯箱过渡动画 */ +.lightbox-enter-active, +.lightbox-leave-active { + transition: opacity 0.3s ease; +} + +.lightbox-enter-active img, +.lightbox-leave-active img { + transition: transform 0.3s ease; +} + +.lightbox-enter-from, +.lightbox-leave-to { + opacity: 0; +} + +.lightbox-enter-from img, +.lightbox-leave-to img { + transform: scale(0.9); +} diff --git a/src/content/config.ts b/src/content/config.ts index 527a5c4..894dae3 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -22,19 +22,6 @@ const blogCollection = defineCollection({ }), }); -// 页面集合 (如关于页面等) -const pagesCollection = defineCollection({ - type: 'content', - schema: z.object({ - title: z.string(), - description: z.string().optional(), - layout: z.string().optional(), - showInNav: z.boolean().default(false), - order: z.number().default(0), - }), -}); - export const collections = { blog: blogCollection, - pages: pagesCollection, }; \ No newline at end of file