perf(P6A.T2): respect prefers-reduced-motion globally + gate confetti

- Update globals.css reduced-motion block: 0.01ms → 0.001ms durations
  and add scroll-behavior: auto to suppress all transitions/animations
  when OS reduced-motion preference is active.
- Gate canvas-confetti burst in GameModal behind matchMedia check so
  the particle effect is skipped entirely for users who opt out of motion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
byGalax
2026-05-16 23:25:01 +02:00
parent a4573b315d
commit 53b3b5e1fc
2 changed files with 11 additions and 2 deletions
@@ -48,6 +48,14 @@ export function GameModal({ gameId, onClose }: Props) {
useEffect(() => {
if (finished && winnerIdx !== null && winnerIdx === myPlayerIdx) {
// Respect the OS-level reduced-motion preference.
if (
typeof window !== 'undefined' &&
window.matchMedia &&
window.matchMedia('(prefers-reduced-motion: reduce)').matches
) {
return;
}
// Two bursts from the lower corners for a celebratory feel.
void confetti({
particleCount: 80,
+3 -2
View File
@@ -85,9 +85,10 @@
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
transition-duration: 0.001ms !important;
scroll-behavior: auto !important;
}
}
}