From a525f7280098e6ba172843ca8e6b3620d5d05ec0 Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 21 Mar 2026 23:18:29 +0100 Subject: [PATCH] Fix apercu animation + reseaux sociaux a prevoir - Corrige le bug ou l'apercu montrait toujours la meme animation (force reflow correct entre retrait et ajout de classe CSS) Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/js/admin.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/js/admin.js b/frontend/js/admin.js index 192d0bc..7b8a52a 100644 --- a/frontend/js/admin.js +++ b/frontend/js/admin.js @@ -306,14 +306,15 @@ function testerAnimation() { } else { chiffre.textContent = count; } - chiffre.className = 'anim-chiffre anim-' + animationChoisie; - // Force reflow pour relancer l'animation - chiffre.style.animation = 'none'; - chiffre.offsetHeight; - chiffre.className = 'anim-chiffre anim-' + animationChoisie; + // Reset : retirer toute classe d'animation + chiffre.className = 'anim-chiffre'; + // Force reflow pour que le navigateur enregistre le retrait + void chiffre.offsetWidth; + // Appliquer la nouvelle animation + chiffre.classList.add('anim-' + animationChoisie); count--; - if (count > 0) setTimeout(afficher, 800); + if (count > 0) setTimeout(afficher, 1000); } afficher();