templates/vitrine/base.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         {% if app.environment == "prod" %}
  5.         <script id="Cookiebot"
  6.                 src="https://consent.cookiebot.com/uc.js"
  7.                 data-cbid="af3fd7ec-069c-4e52-b5a2-27c184e8b4a9"
  8.                 data-blockingmode="manual" 
  9.                 type="text/javascript"></script>
  10.         <script data-cookieconsent="ignore">
  11.             window.dataLayer = window.dataLayer || [];
  12.             function gtag() {
  13.                 dataLayer.push(arguments);
  14.             }
  15.             gtag("consent", "default", {
  16.                 ad_personalization: "denied",
  17.                 ad_storage: "denied",
  18.                 ad_user_data: "denied",
  19.                 analytics_storage: "denied",
  20.                 functionality_storage: "denied",
  21.                 personalization_storage: "denied",
  22.                 security_storage: "granted",
  23.                 wait_for_update: 500,
  24.             });
  25.             gtag("set", "ads_data_redaction", true);
  26.             gtag("set", "url_passthrough", false);
  27.         </script>
  28.         <!-- Google tag (gtag.js) -->
  29.         <script data-cookieconsent="statistics" async src="https://www.googletagmanager.com/gtag/js?id=UA-188652373-1"></script>
  30.         <script data-cookieconsent="statistics">
  31.             window.dataLayer = window.dataLayer || [];
  32.             function gtag() { dataLayer.push(arguments); }
  33.             gtag('js', new Date());
  34.             gtag('config', 'UA-188652373-1');
  35.         </script>
  36.         <!-- Hotjar Tracking Code for https://taakabeerspa.com -->
  37.         <script data-cookieconsent="statistics">
  38.             (function (h, o, t, j, a, r) {
  39.                 h.hj = h.hj || function () { (h.hj.q = h.hj.q || []).push(arguments) };
  40.                 h._hjSettings = { hjid: 3893655, hjsv: 6 };
  41.                 a = o.getElementsByTagName('head')[0];
  42.                 r = o.createElement('script'); r.async = 1;
  43.                 r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
  44.                 a.appendChild(r);
  45.             })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
  46.         </script>
  47.         {% endif %}
  48.         {# Sentry Integration for Error Monitoring #}
  49.         {% include 'sentry/sentry_js.html.twig' %}
  50.         <meta charset="UTF-8">
  51.         <meta name="viewport" content="width=device-width, initial-scale=1.0">
  52.         <meta name="description" content="{% block description '' %}">
  53.         <link rel="icon" type="image/png" sizes="32x32" href="{{asset('images/favicon/favicon-32x32.png')}}">
  54.         <link rel="icon" type="image/png" sizes="16x16" href="{{asset('images/favicon/favicon-16x16.png')}}">
  55.         <title>{% block title '' %} | Taaka Beer Spa</title>
  56.         {% block stylesheets %}
  57.             {{ encore_entry_link_tags('vitrine') }}
  58.             <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" />
  59.         {% endblock %}
  60.         {% block javascripts %}
  61.             {{ encore_entry_script_tags('vitrine') }}
  62.             <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  63.         {% endblock %}
  64.     </head>
  65.     <body class="flex flex-col items-center text-white">
  66.         <div id="loading-transition" class="relative opacity-0 pointer-events-none transition-opacity duration-200">
  67.         </div>
  68.         <div id="loading-gif" class="fixed top-0 left-0 w-full h-lvh">
  69.             <img  class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 h-52 w-auto"
  70.                 src="{{asset('vitrine/logo/loader.gif')}}" alt="Taaka Beer Spa">
  71.         </div>
  72.         <div id="content" class="opacity-0 w-full">
  73.             {% include "vitrine/layout/header.html.twig" %}
  74.             <div id="smooth-wrapper" class="w-full background-parallax">
  75.                 <div id="smooth-content" class="w-full">
  76.                     <main class="w-full relative z-10 flex-col flex items-center overflow-hidden">
  77.                         {% block main %}{% endblock main %}
  78.                     </main>
  79.                 </div>
  80.             </div>
  81.         </div>
  82.         {% for message in app.flashes('success') %}
  83.         <div class="z-50 fixed bottom-4 left-1/2 -translate-x-1/2 rounded-md bg-green-50 p-4">
  84.             <div class="flex">
  85.                 <div class="flex-shrink-0">
  86.                     <svg class="h-5 w-5 text-green-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  87.                         <path fill-rule="evenodd"
  88.                             d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
  89.                             clip-rule="evenodd" />
  90.                     </svg>
  91.                 </div>
  92.                 <div class="ml-3 text-sm font-medium text-green-800 opacity-70">
  93.                     {{ message }}
  94.                 </div>
  95.             </div>
  96.         </div>
  97.         {% endfor %}
  98.         {% for message in app.flashes('error') %}
  99.         <div class="z-50 fixed bottom-4 left-1/2 -translate-x-1/2 rounded-md bg-red-50 p-4">
  100.             <div class="flex">
  101.                 <div class="flex-shrink-0">
  102.                     <svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
  103.                         <path fill-rule="evenodd"
  104.                             d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z"
  105.                             clip-rule="evenodd" />
  106.                     </svg>
  107.                 </div>
  108.                 <div class="ml-3 text-sm font-medium text-red-800">
  109.                     {{ message }}
  110.                 </div>
  111.             </div>
  112.         </div>
  113.         {% endfor %}
  114.         <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
  115.         <script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
  116.         <script>
  117.             document.addEventListener('DOMContentLoaded', () => {
  118.                 const bubbleAnimationParents = document.querySelectorAll('.animateBubble');
  119.                 const bubbleAnimationBtns = document.querySelectorAll('.btnBubbleAnimation');
  120.                 let animations = [];
  121.                 bubbleAnimationParents.forEach((parent) => {
  122.                     const animation = startAnimationLoop(parent);
  123.                     animations.push(animation);
  124.                 });
  125.                 document.addEventListener('visibilitychange', () => {
  126.                     if (document.visibilityState === 'hidden') {
  127.                         // Arrêter toutes les animations
  128.                         animations.forEach(animation => clearInterval(animation));
  129.                         animations = [];
  130.                     } else if (document.visibilityState === 'visible') {
  131.                         // Redémarrer les animations
  132.                         bubbleAnimationParents.forEach((parent) => {
  133.                             const animation = startAnimationLoop(parent);
  134.                             animations.push(animation);
  135.                         });
  136.                     }
  137.                 });
  138.                 bubbleAnimationBtns.forEach((btn) => {
  139.                     btn.addEventListener('mouseenter', () => {
  140.                         const parent = btn.closest('.btnBubbleAnimation');
  141.                         if (parent) {
  142.                             hoverBtnBubbleAnimation(parent);
  143.                         } else {
  144.                             console.error('Aucun parent trouvé avec la classe .animateBubble pour le bouton', btn);
  145.                         }
  146.                     });
  147.                 });
  148.                 const loadingTransition = document.getElementById('loading-transition');
  149.                 const content = document.getElementById('content');
  150.                 const loadingGif = document.getElementById('loading-gif');
  151.                 // Fonction pour gérer le fade-in
  152.                 const handlePageShow = () => {
  153.                     // Fade-in de la page après le chargement
  154.                     setTimeout(() => {
  155.                         document.body.classList.add('loaded');  // Ajoute la classe 'loaded' pour déclencher le fade-in
  156.                         content.classList.remove('opacity-0');  // Ré-affiche le contenu après le fade-in
  157.                         // Cache le GIF après 200ms suivant le fade-in
  158.                         setTimeout(() => {
  159.                             loadingGif.style.display = 'none';  // Cache le GIF après l'animation de fade-in
  160.                         }, 400);  // Ce délai correspond à la durée du fade-in
  161.                     }, 400);  // Ajuste ce délai en fonction du temps de chargement de ton animation
  162.                 };
  163.                 // Gestion du chargement initial et du retour arrière
  164.                 handlePageShow();
  165.                 window.addEventListener('pageshow', (event) => {
  166.                     if (event.persisted) {
  167.                         // Si la page vient du cache (retour arrière)
  168.                         content.style.display = 'block';
  169.                         loadingGif.style.display = 'block';
  170.                         handlePageShow();
  171.                     }
  172.                 });
  173.                 // Interception du clic sur les liens pour gérer le fade-out et réafficher l'écran de transition
  174.                 document.querySelectorAll('a').forEach(link => {
  175.                     link.addEventListener('click', function (e) {
  176.                         // Ignore les liens internes (#), les liens de la galerie, et les liens qui s'ouvrent dans un nouvel onglet
  177.                         if (this.getAttribute('href').startsWith('#') || 
  178.                             this.closest('#gallery_taaka') ||
  179.                             this.getAttribute('target') === '_blank') {
  180.                             return; // Ne fait rien pour ces liens
  181.                         }
  182.                         if (this.hostname === window.location.hostname) {
  183.                             e.preventDefault();
  184.                             document.body.classList.remove('loaded');
  185.                             content.classList.add('opacity-0');
  186.                             loadingTransition.classList.remove('opacity-0');
  187.                             loadingTransition.classList.add('opacity-100');
  188.                             loadingGif.style.display = 'block';
  189.                             setTimeout(() => {
  190.                                 window.location.href = this.href;
  191.                             }, 350);
  192.                         }
  193.                     });
  194.                 });
  195.             });
  196.         </script>
  197.     </body>
  198. </html>