templates/produitssensible/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}SVS - {{"PRODUITS SENSIBLES"|trans}}{% endblock %}
  3. {% block body %}   
  4. <style>
  5.     {% include "produitssensible/produitssensible.css" %}
  6. </style>
  7. <!-- Element -->
  8. <div class="element1">
  9.     {% include "produitssensible/5/refait.html.twig" %}
  10. </div>
  11. <!-- Element -->
  12. <div class="appElement element2 element_produitssensible_about">
  13.     {% include "produitssensible/aproposproduitssensible/index.html.twig" %}
  14. </div>
  15. <!-- Element -->
  16. <div class="appElement element3 element_produitssensible_icons">
  17.     {% include "produitssensible/serviceIcons/index.html.twig" %}
  18. </div>
  19. <!-- Element -->
  20. <div class="appElement element4 element_produitssensible_section">
  21.     <div class="position1"></div>
  22.     {% include "produitssensible/cadreSVS/element.html.twig" %}
  23. </div>
  24. <!-- EXECUTE SCRIPT FOR PRODUITSSENSIBLE PAGE -->
  25. <script>
  26.     // HERE @VAR IMPORTANT FOR THIS SCRIPT
  27.     var viewportHeight = window.innerHeight;
  28.     var hasTitleAboutRun = false; // Variable pour suivre si initTitle_produitssensible_about a déjà été exécutée.
  29.     var hasTitleIconsRun = false; // Variable pour suivre si initTitle_produitssensible_icons a déjà été exécutée.
  30.     var hasTitleSectionRun = false; // Variable pour suivre si initTitle_produitssensible_section a déjà été exécutée.
  31.     // HERE FUNCTION TITLE_produitssensible_ABOUT
  32.     function initTitle_produitssensible_about() {
  33.         var typed_produitssensible_about = new Typed('.typed_produitssensible_about', {
  34.             strings: ['{{"Sentinelles du convoyage"|trans}}<br><span>{{"garants de la sûreté intégrale"|trans}}</span>'],
  35.             typeSpeed: 20,
  36.             startDelay: 250,
  37.             backDelay: 2500,
  38.             loop: false,
  39.             cursorChar: '<i class="fas fa-circle"></i>',
  40.         });
  41.     }
  42.     // HERE FUNCTION TITLE_produitssensible_ICONS
  43.     function initTitle_produitssensible_icons() {
  44.         var typed_produitssensible_icons = new Typed('.typed_produitssensible_icons', {
  45.             strings: ['{{"Convoi Protégé"|trans}}<br><span>{{"préparation pour un trajet sans risque"|trans}}</span>'],
  46.             typeSpeed: 25,
  47.             startDelay: 250,
  48.             backDelay: 2500,
  49.             loop: false,
  50.             cursorChar: '<i class="fas fa-circle"></i>',
  51.         });
  52.     }
  53.     // HERE FUNCTION TITLE_produitssensible_SECTION
  54.     function initTitle_produitssensible_section() {
  55.         var typed_produitssensible_section = new Typed('.typed_produitssensible_section', {
  56.             strings: ['{{"Une connaissance approfondie de la réglementation"|trans}}<br><span>{{"pour garantir la sécurité du transport des produits sensibles"|trans}}.</span>'],
  57.             typeSpeed: 25,
  58.             startDelay: 250,
  59.             backDelay: 2500,
  60.             loop: false,
  61.             cursorChar: '<i class="fas fa-circle"></i>',
  62.         });
  63.     }
  64.     // HERE EXECUTION OF SCRIPT @HOME
  65.     window.addEventListener('scroll', function() {
  66.         // HERE @VAR FOR element_produitssensible_about ELEMENT RECTANGLE
  67.         var element_produitssensible_about = document.querySelector('.element_produitssensible_about');
  68.         var rectangle_about = element_produitssensible_about.getBoundingClientRect();
  69.         if (!hasTitleAboutRun && rectangle_about.top < viewportHeight && rectangle_about.bottom > 0) {
  70.             initTitle_produitssensible_about();
  71.             hasTitleAboutRun = true; // Marquer que la fonction a été exécutée.
  72.         }
  73.         // HERE @VAR FOR element_produitssensible_icons ELEMENT RECTANGLE
  74.         var element_produitssensible_icons = document.querySelector('.element_produitssensible_icons');
  75.         var rectangle_icons = element_produitssensible_icons.getBoundingClientRect();
  76.         if (!hasTitleIconsRun && rectangle_icons.top < viewportHeight && rectangle_icons.bottom > 0) {
  77.             initTitle_produitssensible_icons();
  78.             hasTitleIconsRun = true; // Marquer que la fonction a été exécutée.
  79.         }
  80.         // HERE @VAR FOR element_produitssensible_section ELEMENT RECTANGLE
  81.         var element_produitssensible_section = document.querySelector('.element_produitssensible_section');
  82.         var rectangle_section = element_produitssensible_section.getBoundingClientRect();
  83.         if (!hasTitleSectionRun && rectangle_section.top < viewportHeight && rectangle_section.bottom > 0) {
  84.             initTitle_produitssensible_section();
  85.             hasTitleSectionRun = true; // Marquer que la fonction a été exécutée.
  86.         }
  87.     });
  88. </script>
  89. {% endblock %}