From 35aed42617e6849e4393854c81265d1ec14d025c Mon Sep 17 00:00:00 2001 From: Jiao77 Date: Thu, 5 Mar 2026 13:53:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=B8=BA=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E6=B7=BB=E5=8A=A0=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=92=8C=20Emoji=20=E9=80=89=E6=8B=A9=E5=99=A8=E5=8A=9F?= =?UTF-8?q?=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 From b17178b58564af3f4f2e8120164ebbafe4561638 Mon Sep 17 00:00:00 2001 From: Jiao77 Date: Thu, 5 Mar 2026 13:54:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E5=9B=BE?= =?UTF-8?q?=E5=BA=8A=E4=B8=8A=E4=BC=A0=20token=20=E4=B8=BA=20blog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Qwen-Coder --- src/components/CommentSection.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CommentSection.vue b/src/components/CommentSection.vue index d145c64..bdcf088 100644 --- a/src/components/CommentSection.vue +++ b/src/components/CommentSection.vue @@ -345,7 +345,7 @@ const props = defineProps<{ const apiBaseUrl = props.apiBaseUrl || 'http://localhost:8080/api'; const imageUploadUrl = props.imageUploadUrl || 'https://picturebed.jiao77.cn/api/index.php'; -const imageUploadToken = props.imageUploadToken || 'jiao77'; +const imageUploadToken = props.imageUploadToken || 'blog'; // 状态 const comments = ref([]);