diff --git a/src/components/geek/Heatmap.astro b/src/components/geek/Heatmap.astro index f24f1a9..777804a 100644 --- a/src/components/geek/Heatmap.astro +++ b/src/components/geek/Heatmap.astro @@ -29,6 +29,17 @@ try { const streak = streakStats(weeks.flat()); const updatedOn = new Date().toISOString().slice(0, 10); const summary = labels.summary.replace('{n}', String(total)); + +// 月度聚合(P1 蛇 + 月柱联动):柱子给"哪个月最忙"的粗粒度答案 +const byMonth = new Map(); +for (const week of weeks) { + for (const day of week) { + const key = day.date.slice(0, 7); + byMonth.set(key, (byMonth.get(key) ?? 0) + day.count); + } +} +const months = [...byMonth.entries()].sort(([a], [b]) => a.localeCompare(b)).filter(([m]) => m); +const maxMonth = Math.max(...months.map(([, v]) => v), 1); ---
@@ -40,19 +51,34 @@ const summary = labels.summary.replace('{n}', String(total)); {streak.total}{locale === 'en' ? 'total' : '总贡献'} 数据更新于 {updatedOn}

-
+
+ + +
+
+ +

{[0, 1, 2, 3, 4].map((l) => ( @@ -67,6 +93,126 @@ const summary = labels.summary.replace('{n}', String(total)); document.querySelectorAll('[data-anchor-latest]').forEach((el) => { el.scrollLeft = el.scrollWidth; }); + +