|
@@ -0,0 +1,21 @@
|
|
|
+let dropdowns1 = document.getElementById('circle_vert_clair_erable_3');
|
|
|
+
|
|
|
+ function slideDown() {
|
|
|
+ let translateY = 0; // Position de départ (en bas)
|
|
|
+ let duration = 17000; // Durée de l'animation en millisecondes
|
|
|
+ let startTime = null; // Temps de départ de l'animation
|
|
|
+ function animate(timestamp) {
|
|
|
+ if (!startTime) startTime = timestamp; // Initialise le temps de départ si ce n'est pas déjà fait
|
|
|
+ let progress = (timestamp - startTime) / duration; // Calcul de la progression de l'animation
|
|
|
+ progress = Math.min(progress, 0.3); // Limite la progression à 0.3 (pour éviter un dépassement)
|
|
|
+ translateY = 410 * progress * (0.48 - progress); // Réduction de la vitesse vers la fin de l'animation
|
|
|
+ dropdown1.style.transform = `translateY(${translateY}%)`; // Appliquer la transformation
|
|
|
+ if (progress < 0.999999) {
|
|
|
+ requestAnimationFrame(animate);
|
|
|
+ }
|
|
|
+}
|
|
|
+requestAnimationFrame(animate);
|
|
|
+}
|
|
|
+slideDown(); // Lancer l'animation lorsque la page est chargée
|
|
|
+
|
|
|
+
|