From 97a56f3c8968b4933e4935b68d6f24ca66605d73 Mon Sep 17 00:00:00 2001 From: wait4xx Date: Thu, 5 Nov 2026 11:01:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(heatmap):=20v5=20=E4=BA=94=E6=A1=88?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E9=A1=B5=E4=B8=8A=E7=BA=BF=E2=80=94=E2=80=94?= =?UTF-8?q?=E5=A2=A8=E6=9F=93/=E6=BD=AE=E6=B1=90/=E6=98=9F=E8=BD=A8/?= =?UTF-8?q?=E7=BB=87=E9=94=A6/=E8=90=A4=E7=81=AB=E5=B9=B6=E9=99=88?= =?UTF-8?q?=E4=BE=9B=E9=80=89=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 五个候选方案在现役 P1 贪吃蛇之上重做动效语言(更安静文气的方向), 共用 loadHeatmap 真实数据与同份组件契约(offset 定位 / reduced-motion 静态兜底 / IO 离屏即停 / ink 档位独占数据密度 / accent 只给运动元素)。 多队友并行产出:@worker-one 墨染+潮汐,三个子代理星轨/织锦/萤火; 经 glm-5.3-flash 视觉复核一轮(织锦纱线可见度提档、梭子加描边、萤火 色向转暖)后上线 /heatmap-preview/ 供用户点选。 - 五组件自包含(模板+引擎+样式),选定后落进正式开源页并删本预览路由 - content-lint 一次性白名单 /heatmap-preview/(无 en 版配对豁免) 验证: pnpm astro build exit 0;本地 18926 快照零控制台错误、六 section 帧差确认全案在动 Spec: none (预览页需先上线供用户选择,选定后落地时正式立项收尾) Co-authored-by: GLM-5.3 --- scripts/build-perf/content-lint.mjs | 6 +- src/components/geek/hm/Comet.astro | 238 ++++++++++++++++++ src/components/geek/hm/Fireflies.astro | 213 ++++++++++++++++ src/components/geek/hm/InkBloom.astro | 242 ++++++++++++++++++ src/components/geek/hm/Loom.astro | 325 +++++++++++++++++++++++++ src/components/geek/hm/Tide.astro | 220 +++++++++++++++++ src/pages/heatmap-preview.astro | 47 ++++ 7 files changed, 1290 insertions(+), 1 deletion(-) create mode 100644 src/components/geek/hm/Comet.astro create mode 100644 src/components/geek/hm/Fireflies.astro create mode 100644 src/components/geek/hm/InkBloom.astro create mode 100644 src/components/geek/hm/Loom.astro create mode 100644 src/components/geek/hm/Tide.astro create mode 100644 src/pages/heatmap-preview.astro diff --git a/scripts/build-perf/content-lint.mjs b/scripts/build-perf/content-lint.mjs index 18ca567..f13a2e8 100644 --- a/scripts/build-perf/content-lint.mjs +++ b/scripts/build-perf/content-lint.mjs @@ -14,7 +14,11 @@ if (MODE === 'skip') { } const SKIP_PREFIX = ['/admin/', '/photos-originals/']; // admin=CMS 路由;photos-originals=部署期 rsync 叠加层(不在 dist,另有部署链保障) -const SKIP_FILE = new Set(['/404.html']); // Astro 404 页不参与配对 +const SKIP_FILE = new Set([ + '/404.html', // Astro 404 页不参与配对 + // 一次性预览路由(预览-选型-落地模式):只有 zh 版,配对检查豁免;选定后随路由一起删 + '/heatmap-preview/index.html', +]); diff --git a/src/components/geek/hm/Comet.astro b/src/components/geek/hm/Comet.astro new file mode 100644 index 0000000..ca7b8dc --- /dev/null +++ b/src/components/geek/hm/Comet.astro @@ -0,0 +1,238 @@ +--- +// 热力图动效预览方案「星轨」:格子即星——档位只决定微光强弱(越密越亮), +// 一颗彗星(accent 亮核 + 渐变长尾)沿水平正弦轨迹横掠全年网格, +// 途经的活跃星短暂闪烁后回落档位原色,掠完全图歇息片刻再折返——尾随行进方向甩。 +// 本文件是独立预览件:只新增、不改既有、零依赖零请求。 +import { loadHeatmap, levelOf } from '../../../lib/heatmap'; + +interface Props { + title: string; + concept: string; +} +const { title, concept } = Astro.props; + +// 数据获取失败(无 token / 无缓存)时 weeks 为空 → 网格空壳,引擎自然不启动 +let weeks: import('../../../lib/heatmap').HeatDay[][] = []; +try { ({ weeks } = await loadHeatmap()); } catch {} +--- + +
+

{title}

+

{concept}

+
+ + +
+ {weeks.map((w) => + w.map((d) => ( +
+
+
+ + + + diff --git a/src/components/geek/hm/Fireflies.astro b/src/components/geek/hm/Fireflies.astro new file mode 100644 index 0000000..fd60a23 --- /dev/null +++ b/src/components/geek/hm/Fireflies.astro @@ -0,0 +1,213 @@ +--- +// 热力图动效预览 · 方案「萤火」:5 只萤火虫在网格包围盒内拟周期游走, +// 路过活跃格时短暂点亮(brightness + 微光晕)后指数衰减回落。 +// 密度语义始终由 ink 档位承载,accent 只出现在运动元素与瞬时高亮上 +import { loadHeatmap, levelOf } from '../../../lib/heatmap'; + +interface Props { + title: string; + concept: string; +} +const { title, concept } = Astro.props; + +let weeks: import('../../../lib/heatmap').HeatDay[][] = []; +try { + ({ weeks } = await loadHeatmap()); +} catch { + // 三级回落已在 lib 内处理;此处再守一层:空网格不破构建 +} +--- + +
+

{title}

+

{concept}

+
+
+ {weeks.map((w) => + w.map((d) => ( +
+ {[0, 1, 2, 3, 4].map(() =>