templates/AppTemplates/layout/separator2.html.twig line 1

Open in your IDE?
  1. <style>
  2.     .nouveau_groupe {
  3.         position: relative;
  4.         overflow: hidden;
  5.         padding: 12px 0;
  6.     }
  7.     .nouveau_element {
  8.         font-size: 49px;
  9.         font-weight: 500;
  10.         transform: translateX(-100%);
  11.         transition: transform 0s ease-in-out;
  12.         color: #172f6252;
  13.         font-style: italic;
  14.     }
  15.     .nouveau_element span {
  16.         font-size: inherit;
  17.         font-weight: inherit;
  18.         color: inherit;
  19.     }
  20. </style>
  21. <div class="nouveau_groupe">
  22.     <div class="nouveau_element">
  23.         {{"VOTRE SÉCURITÉ"|trans}}<span>...</span> {{"EST NOTRE PRIORITÉ"|trans}}
  24.     </div>
  25. </div>
  26. <script>
  27. function animateScroll2() {
  28.     var viewportHeight = window.innerHeight;
  29.     var nouveau_element = document.querySelector('.nouveau_element');
  30.     var nouveau_groupe = document.querySelector('.nouveau_groupe');
  31.     var rectangle_nouveau_groupe = nouveau_groupe.getBoundingClientRect();
  32.     var scrollProgress = (viewportHeight - (rectangle_nouveau_groupe.top + 100)) / viewportHeight;
  33.     var translateValue = scrollProgress * 100;
  34.     nouveau_element.style.transform = `translateX(${translateValue}%)`;
  35.     requestAnimationFrame(animateScroll2);
  36. }
  37. // Lancer l'animation
  38. animateScroll2();
  39. </script>