From 0aea929b48a28c48a13584e1d6139438e97fe54f Mon Sep 17 00:00:00 2001 From: syoul Date: Mon, 23 Mar 2026 21:40:48 +0100 Subject: [PATCH] feat: animation 30 jours en demi-semaines (3.5j, ~9 frames) Remplace les frames hebdomadaires (5 frames) par des demi-semaines (3.5 jours, ~9-10 frames) pour une animation plus fluide sur 30 jours. Co-Authored-By: Claude Sonnet 4.6 --- src/hooks/useAnimation.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hooks/useAnimation.ts b/src/hooks/useAnimation.ts index 02ca2a6..d444363 100644 --- a/src/hooks/useAnimation.ts +++ b/src/hooks/useAnimation.ts @@ -39,20 +39,19 @@ function buildFrames(periodDays: number): TimeFrame[] { }); } - // 30 days → weekly frames + // 30 days → half-week frames (3.5 days ≈ 9–10 frames) + const HALF_WEEK = 3.5 * 86_400_000; const frames: TimeFrame[] = []; let cursor = start; - let week = 1; while (cursor < now) { const from = cursor; - const to = Math.min(cursor + 7 * 86_400_000, now); + const to = Math.min(cursor + HALF_WEEK, now); frames.push({ - label: `Semaine ${week} · ${fmt(from, { day: 'numeric', month: 'short' })} – ${fmt(to - 1, { day: 'numeric', month: 'short' })}`, + label: `${fmt(from, { day: 'numeric', month: 'short' })} – ${fmt(to - 1, { day: 'numeric', month: 'short' })}`, from, to, }); cursor = to; - week++; } return frames; }