From 4d3f57870a60386f9543d766f4f6b083ee714d05 Mon Sep 17 00:00:00 2001 From: null Date: Wed, 27 May 2026 19:04:51 -0500 Subject: [PATCH] animate --- .../src/components/git/ForgejoHeatmap.tsx | 344 ++++++++++++++++-- 1 file changed, 322 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/git/ForgejoHeatmap.tsx b/frontend/src/components/git/ForgejoHeatmap.tsx index f389a62..f855416 100644 --- a/frontend/src/components/git/ForgejoHeatmap.tsx +++ b/frontend/src/components/git/ForgejoHeatmap.tsx @@ -827,6 +827,318 @@ function HeatmapGrid({ ); } +// ── Skeleton wave path (representative 14-day pattern) ───────────────────── +const SKEL_LINE = + "M34,155 C60,145 90,50 130,42 C170,34 200,100 240,108 C280,116 315,38 355,30 C395,22 430,82 468,96 C495,105 520,128 572,158"; +const SKEL_AREA = `${SKEL_LINE} L572,${LP_T + LCH} L34,${LP_T + LCH} Z`; +const SKEL_HEAT = [ + 0.2, 0.55, 0.85, 0.95, 0.7, 0.3, 0.45, 0.9, 1.0, 0.9, 0.65, 0.4, 0.75, + 0.1, +]; + +function LineChartSkeleton() { + return ( +
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + {[1, 2, 3, 4].map((i) => { + const y = LP_T + LCH - (i / 4) * LCH; + return ( + + + + + ); + })} + + + + + + + {[0, 2, 4, 6, 8, 10, 12, 13].map((i) => ( + + ))} + +
+
+
+
+
+ ); +} + +function HeatmapSkeleton() { + const cell = 15, + gap = 4; + const availableWidth = LVW - HLEFT - HRIGHT; + const totalWidth = + SKEL_HEAT.length * cell + (SKEL_HEAT.length - 1) * gap; + const hx = HLEFT + (availableWidth - totalWidth) / 2; + const hy = 54; + + return ( +
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + {SKEL_HEAT.map((opacity, i) => ( + + ))} + + + + {[0, 4, 9, 13].map((i) => ( + + ))} + {HMAP_FILL.map((fill, i) => ( + + ))} + +
+
+
+
+
+ ); +} + +function LineStatsSkeleton() { + return ( +
+
+
+
+
+
+
+
+
+
+
+ ); +} + // ── Main export ──────────────────────────────────────────────────────────── export function ForgejoHeatmap({ days, @@ -842,28 +1154,16 @@ export function ForgejoHeatmap({ if (isLoading) { return ( -
- {[0, 1].map((i) => ( -
-
-
-
-
-
-
- ))} +
+
+
+ +
+
+ +
+
+
); }