From 3050b0b9599492b832bc4f0af3e652e5b604a85f Mon Sep 17 00:00:00 2001 From: wait4xx Date: Mon, 2 Nov 2026 08:47:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(article):=20=E6=AD=A3=E6=96=87=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=8F=AF=E6=94=BE=E5=A4=A7=E2=80=94=E2=80=94PhotoZoom?= =?UTF-8?q?=20=E6=9E=81=E7=AE=80=20viewer=20=E5=8F=8C=E8=BD=A8=E6=8C=82?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 正文 .prose-reading/.prose-tech 图片单击唤起全屏 dialog:fit- contain+滚轮光标锚点缩放 1-5x+拖拽(钳制数学与图库 v2 逐行同 源)+双击 1x↔2.5x+Esc/关闭/背景点击关(contain 内容盒几何判 定);无 EXIF/caption/FLIP(纯图极简,按契约);document 委托点击软导航后仍生效。 车道:op-artalk(专项 9/9:SVG 架构图唤起/矢量 2.46x 不栅格化/ 拖拽钳制/双击回正/Esc/jpg/背景关/软导航);收编验收四断言+E2E 34/34 全过 验证: 文章 SVG 点击唤起+滚轮放大(naturalWidth 960 矢量源)+Esc 关闭实测;E2E 34/34 Spec: none (文章图放大,车道级交付) Co-authored-by: GLM-5.3 --- src/components/geek/PhotoZoom.astro | 165 ++++++++++++++++++++++++++ src/pages/archives/[...slug].astro | 2 + src/pages/en/archives/[...slug].astro | 2 + 3 files changed, 169 insertions(+) create mode 100644 src/components/geek/PhotoZoom.astro diff --git a/src/components/geek/PhotoZoom.astro b/src/components/geek/PhotoZoom.astro new file mode 100644 index 0000000..3505023 --- /dev/null +++ b/src/components/geek/PhotoZoom.astro @@ -0,0 +1,165 @@ +--- +// 正文图片缩放视图(文章页):单图极简——无画廊专属的 EXIF/caption/FLIP/chrome, +// 只有图 + 关闭钮。缩放引擎与 GalleryPage v2 同源:钳制数学(applyZoom clamp / 回 1 归零) +// 与 contain 几何判定(img 元素盒铺满 → 背景按内容盒算)逐行对齐,勿另起炉灶。 +--- + + + + + + + + + diff --git a/src/pages/archives/[...slug].astro b/src/pages/archives/[...slug].astro index 0ba64cd..66b1477 100644 --- a/src/pages/archives/[...slug].astro +++ b/src/pages/archives/[...slug].astro @@ -1,6 +1,7 @@ --- import type { CollectionEntry } from 'astro:content'; import { getCollection, render } from 'astro:content'; +import PhotoZoom from '../../components/geek/PhotoZoom.astro'; import BaseLayout from '../../layouts/BaseLayout.astro'; import ArtalkComments from '../../components/ArtalkComments.astro'; import { trackOf } from '../../content.config'; @@ -116,6 +117,7 @@ const toc = headings.filter((h) => h.depth === 2 || h.depth === 3); +