templates/base.html.twig line 91

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3.     <head>
  4.         <meta charset="UTF-8">
  5.         <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.         <title>{% block title %}MatchMeuble{% endblock %}</title>
  7.         {% block meta %}{% endblock %}
  8.         <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>🛠️</text></svg>">
  9.         <!-- Tailwind CSS avec configuration dark mode -->
  10.         <script src="https://cdn.tailwindcss.com"></script>
  11.         <script>
  12.             tailwind.config = {
  13.                 darkMode: 'class',
  14.                 theme: {
  15.                     extend: {
  16.                         colors: {
  17.                             primary: {"50":"#eff6ff","100":"#dbeafe","200":"#bfdbfe","300":"#93c5fd","400":"#60a5fa","500":"#3b82f6","600":"#2563eb","700":"#1d4ed8","800":"#1e40af","900":"#1e3a8a","950":"#172554"}
  18.                         }
  19.                     }
  20.                 }
  21.             }
  22.         </script>
  23.         <!-- Flowbite CSS & JS -->
  24.         <link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.5/flowbite.min.css" rel="stylesheet" />
  25.         <script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.5/flowbite.min.js"></script>
  26.         <script>document.documentElement.classList.add('js')</script>
  27.         {% block stylesheets %}
  28.             {{ encore_entry_link_tags('app') }}
  29.         {% endblock %}
  30.         <!-- Styles personnalisés pour préserver le gradient -->
  31.         <style>
  32.             .text-gradient {
  33.                 background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  34.                 -webkit-background-clip: text;
  35.                 -webkit-text-fill-color: transparent;
  36.                 background-clip: text;
  37.             }
  38.         </style>
  39.         <!-- Script pour le dark theme (doit être en premier pour éviter le flash) -->
  40.         <script>
  41.             // Vérifier le thème sauvegardé ou utiliser la préférence système
  42.             if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
  43.                 document.documentElement.classList.add('dark');
  44.             } else {
  45.                 document.documentElement.classList.remove('dark');
  46.             }
  47.         </script>
  48.     </head>
  49.     <body class="bg-gray-50 dark:bg-gray-900 min-h-screen">
  50.         <!-- Bouton Dark Theme (toujours visible) -->
  51.         <div class="fixed bottom-4 right-4 z-50">
  52.             <button id="theme-toggle" type="button" class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 bg-white dark:bg-gray-800 shadow-lg">
  53.                 <!-- Icône lune (mode dark) -->
  54.                 <svg id="theme-toggle-dark-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
  55.                     <path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
  56.                 </svg>
  57.                 <!-- Icône soleil (mode light) -->
  58.                 <svg id="theme-toggle-light-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
  59.                     <path d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z" fill-rule="evenodd" clip-rule="evenodd"></path>
  60.                 </svg>
  61.             </button>
  62.         </div>
  63.         <!-- Header -->
  64.         {% include 'header.html.twig' %}
  65.     {# Flashes (Flowbite unified) #}
  66.     {% include '_flashes.html.twig' %}
  67.         {% if app.user and app.user.isVerified == false %}
  68.         <div id="alert-4" class="flex items-center ring-1 ring-yellow-500 p-4 mb-4 text-yellow-800 rounded-lg bg-yellow-50 dark:bg-gray-800 dark:text-yellow-300 fixed top-20 right-2 z-50" role="alert">
  69.             <svg class="shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
  70.                 <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z"/>
  71.             </svg>
  72.             <span class="sr-only">Info</span>
  73.             <div class="ms-3 text-sm font-medium">
  74.                  <strong>Bonjour, {{app.user.prenom}}</strong>, <br> votre compte n'est pas encore activé. <br> Un lien d'activation vous a été envoyé par mail.<br>
  75.                 <a href="{{path('resend_verif')}}" target="_blank">Pas de lien ? <span class="font-semibold underline hover:no-underline">Renvoyez le lien d'activation.</span></a>
  76.             </div>
  77.             <button type="button" class="ms-auto -mx-1.5 -my-1.5 bg-yellow-50 text-yellow-500 rounded-lg focus:ring-2 focus:ring-yellow-400 p-1.5 hover:bg-yellow-200 inline-flex items-center justify-center h-8 w-8 dark:bg-gray-800 dark:text-yellow-300 dark:hover:bg-gray-700" data-dismiss-target="#alert-4" aria-label="Close">
  78.                 <span class="sr-only">Close</span>
  79.                 <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
  80.                 <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
  81.                 </svg>
  82.             </button>
  83.         </div>
  84.         {% endif %}
  85.         {% block body %}{% endblock %}
  86.         <!-- Footer -->
  87.         {% include 'footer.html.twig' %}
  88.         {% block javascripts %}
  89.             {{ encore_entry_script_tags('app') }}
  90.         {% endblock %}
  91.         <!-- Flowbite JS -->
  92.         <script src="https://cdn.jsdelivr.net/npm/flowbite@3.1.2/dist/flowbite.min.js"></script>
  93.     {# Removed taos: causes runtime errors on some DOM mutations (className not always a string) #}
  94.         <!-- Script pour le fonctionnement du dark theme -->
  95.         <script>
  96.             var themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
  97.             var themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
  98.             // Changer les icônes selon le thème actuel
  99.             if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
  100.                 themeToggleLightIcon.classList.remove('hidden');
  101.             } else {
  102.                 themeToggleDarkIcon.classList.remove('hidden');
  103.             }
  104.             var themeToggleBtn = document.getElementById('theme-toggle');
  105.             themeToggleBtn.addEventListener('click', function() {
  106.                 // Basculer les icônes
  107.                 themeToggleDarkIcon.classList.toggle('hidden');
  108.                 themeToggleLightIcon.classList.toggle('hidden');
  109.                 // Si défini dans localStorage
  110.                 if (localStorage.getItem('color-theme')) {
  111.                     if (localStorage.getItem('color-theme') === 'light') {
  112.                         document.documentElement.classList.add('dark');
  113.                         localStorage.setItem('color-theme', 'dark');
  114.                     } else {
  115.                         document.documentElement.classList.remove('dark');
  116.                         localStorage.setItem('color-theme', 'light');
  117.                     }
  118.                 } else {
  119.                     if (document.documentElement.classList.contains('dark')) {
  120.                         document.documentElement.classList.remove('dark');
  121.                         localStorage.setItem('color-theme', 'light');
  122.                     } else {
  123.                         document.documentElement.classList.add('dark');
  124.                         localStorage.setItem('color-theme', 'dark');
  125.                     }
  126.                 }
  127.             });
  128.         </script>
  129.     </body>
  130. </html>