feat: animation 30 jours en demi-semaines (3.5j, ~9 frames)
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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[] = [];
|
const frames: TimeFrame[] = [];
|
||||||
let cursor = start;
|
let cursor = start;
|
||||||
let week = 1;
|
|
||||||
while (cursor < now) {
|
while (cursor < now) {
|
||||||
const from = cursor;
|
const from = cursor;
|
||||||
const to = Math.min(cursor + 7 * 86_400_000, now);
|
const to = Math.min(cursor + HALF_WEEK, now);
|
||||||
frames.push({
|
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,
|
from,
|
||||||
to,
|
to,
|
||||||
});
|
});
|
||||||
cursor = to;
|
cursor = to;
|
||||||
week++;
|
|
||||||
}
|
}
|
||||||
return frames;
|
return frames;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user