Compare commits

...

3 commits

Author SHA1 Message Date
091f4ddc4a
Merge branch preprod into main
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-06-10 11:45:21 +02:00
9ff1b20248 Merge pull request 'Ralentir les animations ASCII si on détecte que l'utilisateur'trice a demandé au système de minimiser la quantité d'animation ou de mouvement.' (#44) from feat/a11y into preprod
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #44
2024-06-10 09:43:37 +00:00
351931fdeb
Ralentir les animations ASCII si la media feature prefers-reduced-motion is activée
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
2024-06-10 11:30:14 +02:00

View file

@ -38,7 +38,10 @@ function updateAnimation(id, frames, totalFrames) {
} }
animate("illustration-accueil", 500); // If the user have a setting on their device to minimize the amount of non-essential motion
animate("rennes", 1000); const preferReduceMotion = window.matchMedia("(prefers-reduced-motion)").matches;
animate("orsay", 2000);
animate("illustration-accueil", preferReduceMotion ? 1500 : 500); // Reduce framerate if use preference is to reduce motion
animate("rennes", preferReduceMotion ? 3000 : 1000); // Reduce framerate if use preference is to reduce motion
animate("orsay", preferReduceMotion ? 4000 : 2000); // Reduce framerate if use preference is to reduce motion
animate("parterre", 1500); animate("parterre", 1500);