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(() =>