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) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 23:18:29 +01:00
parent bffdf52c56
commit a525f72800

View File

@@ -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();