templates/partials/laptopHeader.html.twig line 1

  1. {% block laptopHeader %}
  2. <header
  3.   class=" bg-center bg-cover text-white dark:bg-transparent sticky-header-first-content"
  4.   style="
  5.     background-image: linear-gradient(
  6.         177.37deg,
  7.         #000000 2.19%,
  8.         rgba(75, 82, 93, 0) 77.2%
  9.       ),
  10.       url('../img/bg-header.jpg');
  11.   "
  12. >
  13. <div class="w-full navbar h-20 flex items-center hero-sticky-header -top-20">
  14.   <nav
  15.     class="container-menu mx-auto lg:px-0 px-5 flex items-center justify-between transition-all"
  16.   >
  17.     <button type="button" class="lg:hidden block menu-btn">
  18.       <svg
  19.         xmlns="http://www.w3.org/2000/svg"
  20.         class="h-6 w-6"
  21.         fill="none"
  22.         viewBox="0 0 24 24"
  23.         stroke="currentColor"
  24.         stroke-width="2"
  25.       >
  26.         <path
  27.           stroke-linecap="round"
  28.           stroke-linejoin="round"
  29.           d="M4 6h16M4 12h16M4 18h16"
  30.         />
  31.       </svg>
  32.     </button>
  33. <a href="/" class="flex items-center" id="logo">
  34.   <img class="w-auto h-12 mr-3" src="../img/bos_logo_white.png" alt="" />
  35. </a>
  36.     <button
  37.       type="button"
  38.       class="text-white hover:text-blue-500 flex items-center lg:hidden"
  39.     >
  40.       {% set path = is_granted('ROLE_COMMERCE') ? path('admin') : path('app_login') %}
  41.        <a href="{{ path }}">
  42.         <span class="lg:mr-3 mr-0 relative">
  43.         <img
  44.           class="w-8 h-8 rounded-full border border-white"
  45.           src="{{ '../images/user/' ~ app.user.imageNameUser ?? 'default.jpg'}}"
  46.           alt="{{ app.user.imageNameUser ?? 'image par défaut' }}"
  47.         />
  48.               {% if app.user %}
  49.                   <span class="w-2 h-2 bg-green-500 rounded-full border absolute bottom-0 left-0"></span>
  50.               {% else %}
  51.                   <span class="w-2 h-2 red-button rounded-full border absolute bottom-0 left-0"></span>
  52.               {% endif %}
  53.       </span>
  54.       </a>
  55.     </button>
  56.     <div class="hidden lg:flex items-center">
  57.       <ul class="flex items-center">
  58.               <li class="">
  59.           <div
  60.   class="relative [&>div] [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  61. >
  62.   <button class="link hover:text-blue-500 flex items-center">
  63.     <a href="{{ path('app_home_list') }}">Accéder à la carte</a>
  64.   </button>
  65.         <li class="">
  66.           <div
  67.   class="relative [&>div] [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  68. >
  69.   <button class="link hover:text-blue-500 flex items-center">
  70.     Categories
  71.     <svg
  72.       data-dropdown-button
  73.       class="w-3 h-auto ml-2"
  74.       width="10"
  75.       height="6"
  76.       viewBox="0 0 10 6"
  77.       fill="none"
  78.       xmlns="http://www.w3.org/2000/svg"
  79.     >
  80.       <path
  81.         d="M4.99982 6.00001C4.79513 6.00001 4.59034 5.92467 4.43435 5.774L0.434558 1.91686C0.122074 1.61552 0.122074 1.12735 0.434558 0.826011C0.747042 0.524671 1.25327 0.524671 1.56575 0.826011L4.99982 4.13893L8.43464 0.826613C8.74712 0.525274 9.25335 0.525274 9.56583 0.826613C9.87831 1.12795 9.87831 1.61612 9.56583 1.91746L5.56604 5.7746C5.4098 5.92527 5.20481 6.00001 4.99982 6.00001Z"
  82.         fill="currentColor"
  83.       />
  84.     </svg>
  85.   </button>
  86.   <div class="absolute top-9 invisible opacity-0 whitespace-nowrap pt-0">
  87.     <div
  88.       class="rounded-lg whitespace-nowrap shadow-front-3 bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
  89.     >
  90.       <ul
  91.         class="h-full rounded-lg relative bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
  92.       >
  93.       <!-- ALL CATEGORIES IN MENU START -->
  94.       {% for category in categorieNavbar() %}
  95.         <li
  96.           class="flex rounded-t-lg [&>a_h6]:hover:text-blue-500 [&>a:first-child]:hover:border-blue-200 [&>a:first-child]:hover:rounded-t-lg [&>a:first-child]:hover:bg-blue-50 [&>a:last-child]:hover:block bg-white dark:bg-foreground"
  97.         >
  98.           <a
  99.             href="{{ path('app_home_list_category', {id:category.id}) }}"
  100.             class="link px-3 py-2 border-b text-sm border-grey-200 dark:border-gray-800 w-full"
  101.           >
  102.             <h6 class="font-medium text-gray-600 dark:text-gray-200">
  103.               {{category.name}}
  104.             </h6>
  105.             <p class="font-normal text-gray-500 dark:text-gray-400 text-xs">
  106.               {{category.subtitle}}
  107.             </p>
  108.           </a>
  109.         </li>
  110.         {% endfor %}
  111.         <!-- ALL CATEGORIES IN MENU END -->
  112.         </li>
  113.       </ul>
  114. </div>
  115.   </div>
  116. </div>
  117.         </li>
  118.         <li class="">
  119. <div
  120.   class="dropdown relative [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:block [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  121. >
  122.   <button class="link hover:text-blue-500 flex items-center">
  123.     Blog
  124.     </svg>
  125.   </button>
  126.           </li>
  127.           <li class="">
  128. <div
  129.   class="dropdown relative [&>div]:hover:visible [&>div]:hover:transition-all [&>div]:hover:pt-3 [&>div]:hover:h-full [&>div]:hover:block [&>div]:hover:opacity-100 [&>div]:hover:top-auto [&>div]:hover:z-10 pr-9"
  130. >
  131.   <button class="link hover:text-blue-500 flex items-center">
  132.     Nos valeurs
  133.     </svg>
  134.   </button>
  135. </li>
  136.         <li class="mr-9">
  137.           <svg
  138.             xmlns="http://www.w3.org/2000/svg"
  139.             class="h-5 w-5 text-gray-300 cursor-pointer darkMode"
  140.             viewBox="0 0 20 20"
  141.             fill="currentColor"
  142.           >
  143.             <path
  144.               d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
  145.             />
  146.           </svg>
  147.           <svg
  148.             xmlns="http://www.w3.org/2000/svg"
  149.             class="h-5 w-5 text-yellow-500 cursor-pointer lightMode hidden"
  150.             viewBox="0 0 20 20"
  151.             fill="currentColor"
  152.           >
  153.             <path
  154.               fill-rule="evenodd"
  155.               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"
  156.               clip-rule="evenodd"
  157.             />
  158.           </svg>
  159.         </li>
  160.         <li class="mr-9">
  161.           <div class="dropdown" data-dropdown>
  162.             <button
  163.               class="link hover:text-blue-500 flex items-center"
  164.               data-dropdown-button
  165.             >
  166.                 <img
  167.                   class="w-8 h-8 rounded-full border border-white mr-3"
  168.                   src="{{ '../images/user/' ~ app.user.imageNameUser ?? 'default.jpg'}}"
  169.                   data-dropdown-button
  170.                   alt="{{ app.user.imageNameUser ?? 'image par défaut' }}"
  171.                 />
  172.               {% if app.user %}
  173.                   <span class="w-2 h-2 bg-green-500 rounded-full border absolute bottom-0 left-0"></span>
  174.               {% else %}
  175.                   <span class="w-2 h-2 red-button rounded-full border absolute bottom-0 left-0"></span>
  176.               {% endif %}
  177.               Espace professionnel
  178.               <svg
  179.                 class="w-3 h-auto ml-2"
  180.                 width="10"
  181.                 height="6"
  182.                 data-dropdown-button
  183.                 viewBox="0 0 10 6"
  184.                 fill="none"
  185.                 xmlns="http://www.w3.org/2000/svg"
  186.               >
  187.                 <path
  188.                   d="M4.99982 6.00001C4.79513 6.00001 4.59034 5.92467 4.43435 5.774L0.434558 1.91686C0.122074 1.61552 0.122074 1.12735 0.434558 0.826011C0.747042 0.524671 1.25327 0.524671 1.56575 0.826011L4.99982 4.13893L8.43464 0.826613C8.74712 0.525274 9.25335 0.525274 9.56583 0.826613C9.87831 1.12795 9.87831 1.61612 9.56583 1.91746L5.56604 5.7746C5.4098 5.92527 5.20481 6.00001 4.99982 6.00001Z"
  189.                   fill="currentColor"
  190.                 />
  191.               </svg>
  192.             </button>
  193.             <div
  194.               class="dropdown-menu bg-white dark:bg-foreground dark:text-gray-300 text-gray-700"
  195.             >
  196.               <div>
  197.                 <div class="dropdown-links max-w-xs w-48 rounded-md py-3">
  198.                   {% set path = is_granted('ROLE_COMMERCE') or is_granted('ROLE_ADMIN') ? path('admin') : path('app_login') %}
  199.                   <a
  200.                     href="{{ path }}"
  201.                     class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
  202.                     ><svg
  203.                       xmlns="http://www.w3.org/2000/svg"
  204.                       class="w-4 h-4 mr-2"
  205.                       fill="none"
  206.                       viewBox="0 0 24 24"
  207.                       stroke="currentColor"
  208.                       stroke-width="2"
  209.                     >
  210.                       <path
  211.                         stroke-linecap="round"
  212.                         stroke-linejoin="round"
  213.                         d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
  214.                       /></svg
  215.                     >Mon compte
  216.                   </a>
  217.                   <a
  218.                     href="#"
  219.                     class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
  220.                   >
  221.                     <svg
  222.                       xmlns="http://www.w3.org/2000/svg"
  223.                       class="h-4 w-4 mr-2"
  224.                       fill="none"
  225.                       viewBox="0 0 24 24"
  226.                       stroke="currentColor"
  227.                       stroke-width="2"
  228.                     >
  229.                       <path
  230.                         stroke-linecap="round"
  231.                         stroke-linejoin="round"
  232.                         d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"
  233.                       />
  234.                     </svg>
  235.                     Nos offres
  236.                   </a>
  237.                   {% if app.user %}
  238.                   <a
  239.                     href="{{ path('app_logout') }}"
  240.                     class="link hover:text-blue-500 px-4 py-1 flex items-center text-sm text-gray-700 dark:text-gray-300"
  241.                   >
  242.                     <svg
  243.                       xmlns="http://www.w3.org/2000/svg"
  244.                       class="w-4 h-4 mr-2"
  245.                       fill="none"
  246.                       viewBox="0 0 24 24"
  247.                       stroke="currentColor"
  248.                       stroke-width="2"
  249.                     >
  250.                       <path
  251.                         stroke-linecap="round"
  252.                         stroke-linejoin="round"
  253.                         d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
  254.                       />
  255.                     </svg>
  256.                     Déconnexion
  257.                   </a>
  258.                   {% endif %}
  259.                 </div>
  260.               </div>
  261.             </div>
  262.           </div>
  263.         </li>
  264.       </ul>
  265.       <a href="{{ path('app_shop_new') }}">
  266.       <button
  267.         type="button"
  268.         class="inline-flex hover:bg-blue-500 hover:text-white items-center px-3 py-[9px] rounded-lg border hover:border-blue-100"
  269.       >
  270.         <svg
  271.           xmlns="http://www.w3.org/2000/svg"
  272.           class="h-4 w-4 xl:mr-2 mr-0"
  273.           viewBox="0 0 20 20"
  274.           fill="currentColor"
  275.         >
  276.           <path
  277.             fill-rule="evenodd"
  278.             d="M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
  279.             clip-rule="evenodd"
  280.           />
  281.         </svg>
  282.         <span class="xl:block hidden">Ajouter un commerce</span>
  283.       </button>
  284.       </a>
  285.     </div>
  286.   </nav>
  287. </div>
  288.   <div class="pt-32 lg:px-0 px-5 lg:pt-35 text-center">
  289.     <h1 class="text-4xl lg:text-6xl font-bold mb-4 uppercase">
  290.       Best of Sarlat
  291.     </h1>
  292.     <p class="text-sm lg:text-lg font-medium block pb-16">
  293.       Nous avons trouvé pour vous les bonnes adresses du Sarladais pour la vie de tous les jours ou pour visiter la Dordogne en toute simplicité.
  294.     </p>
  295.     <!-- header-search  -->
  296. {{ form_start(form, {'action': path('app_home_list')}) }}
  297. <div
  298.       class="md:inline-flex py-3 bg-white dark:bg-background overflow-hidden rounded-2xl mb-6 text-gray-900"
  299.     > 
  300.   <!-- Search bar Start-->
  301.     {{ form_row(form.q, { 'attr': {'class': 'px-7 pt-3 text-center md:text-left dark:bg-background dark:placeholder:text-gray-100 dark:text-gray-100 border-gray-200 focus:outline-none'} })}}
  302.   <!-- Search bar END-->
  303.   <!-- Category filter Start-->
  304.   <div class="hidden">
  305.       {% block _category_widget %}
  306.           {% for child in form.Category %}
  307.               {{ form_widget(child) }}
  308.               {{ form_label(child) }}
  309.               <br>
  310.           {% endfor %}
  311.       {% endblock %}
  312.     </div>
  313.   <!-- Category filter END-->
  314.     
  315.     <!-- Vefified filter Start-->
  316.       <div class="hidden">
  317.       <label class="pl-7 py-2 border-r pr-4 dark:bg-background dark:placeholder:text-gray-100 dark:text-gray-100 border-gray-200 focus:outline-none">
  318.           {{ form_widget(form.verified) }}
  319.           <span class="ml-2 text-gray-700 text-[12px] dark:text-gray-300">
  320.               Vérifié par Best of Sarlat
  321.           </span>
  322.       </label>
  323.     </div>
  324.     <!-- Vefified filter END-->
  325.     <!-- Submit Start-->
  326.       <button
  327.       type="submit"
  328.       class="bg-blue-500 hover:bg-blue-600 rounded-2xl text-white px-8 py-3 mx-3"
  329.     >
  330.       Lancer la recherche
  331.     </button>
  332.     <!-- Submit END-->
  333. </div>
  334. {{ form_end(form) }}
  335.     <div class="text-base font-normal mb-3 lg:block">
  336.       ou consultez directement une catégorie :
  337.     </div>
  338.     <div class="md:flex justify-center flex-wrap pb-20">
  339.       {% for category in allCategory %}
  340.         <a
  341.           href="{{ path('app_home_list_category', {id:category.id}) }}" 
  342.           class="inline-block bg-gray-100 hover:bg-gray-200 hover:text-gray-600 text-gray-500 text-xs font-medium items-center py-1 px-2 rounded mr-2"
  343.         >
  344.           {{ category.name }}
  345.         </a>
  346.       {% endfor %}    
  347.     </div>
  348.   </div>
  349. </header>
  350. {% endblock %}
  351. <script>
  352.   window.addEventListener('scroll', function() {
  353.     var logo = document.getElementById('logo');
  354.     if (window.pageYOffset > 0) {
  355.       logo.querySelector('img').src = '../img/bos_logo.png';
  356.       logo.style.backgroundColor = 'transparent';
  357.     } else {
  358.       logo.querySelector('img').src = '../img/bos_logo_white.png';
  359.       logo.style.backgroundColor = 'transparent';
  360.     }
  361.   });
  362. </script>