templates/header.html.twig line 5

Open in your IDE?
  1. <header id="header"
  2.         class="fixed top-0 w-full z-[1000001] bg-white">
  3.     {% if is_active_sidebar( 'header-top' ) %}
  4.         <section id="header-top">
  5.             {{ dynamic_sidebar('header-top') }}
  6.         </section>
  7.     {% endif %}
  8.     <div class="flex flex-row justify-between items-center max-w-screen-2xl mx-auto lg:px-20 px-5 py-4">
  9.         <a href="{{ home_url }}" class="max-w-7xl" aria-label="{{ bloginfo.name }}">
  10.             <img src="{{ asset('build/img/logo.png') }}" alt="Logo {{ bloginfo.name }}" loading="lazy"
  11.                  class="w-64 h-auto">
  12.         </a>
  13.         <div class="flex flex-row items-center gap-4 lg:gap-10 xl:gap-20">
  14.             {% if menu.header|default() and menu.header.items|length %}
  15.                 <div class="lg:flex flex-row gap-7 hidden">
  16.                     {% for item in menu.header.items|default() %}
  17.                         <div class="group relative {{ item.class }}">
  18.                             <a href="{{ item.link }}" target="{{ item.target }}"
  19.                                {% if item.xfn|default %}rel="{{ item.xfn }}"{% endif %}
  20.                                class="{% if item.children|length %} flex flex-row items-center gap-2 {% endif %} text-black block text-sm group transition-all duration-300 ease-in-out uppercase">
  21.                                 <span class="{% if not item.children|length %} pb-[2px] {% endif %} bg-left-bottom bg-gradient-to-r from-primary to-primary bg-[length:0%_1px] bg-no-repeat group-hover:bg-[length:100%_1px] transition-all duration-500 ease-out">{{ item.title }}</span>
  22.                                 {% if item.children|length %}
  23.                                     <div class="group-hover:rotate-180 transition-all duration-500 ease-in-out">
  24.                                         {% include 'assets/arrow-down.svg' %}
  25.                                     </div>
  26.                                 {% endif %}
  27.                             </a>
  28.                             {% if item.children|length %}
  29.                                 <div class="pt-5 absolute w-max">
  30.                                     <div class="group-hover:flex flex-col gap-4 hidden bg-white py-4 px-2 rounded-2xl -translate-x-6">
  31.                                         {% for children in item.children|default() %}
  32.                                             <div class="group/item relative {{ children.class }}">
  33.                                                 <a href="{{ children.link }}" target="{{ children.target }}"
  34.                                                    {% if item.xfn|default %}rel="{{ item.xfn }}"{% endif %}
  35.                                                    class="flex flex-col justify-between px-4 space-y-3.5 h-full rounded-2xl text-black text-sm group transition-all duration-300 ease-in-out group-[.current_page_item]/item:font-bold uppercase">
  36.                                                     <span>{{ children.title }}</span>
  37.                                                 </a>
  38.                                             </div>
  39.                                         {% endfor %}
  40.                                     </div>
  41.                                 </div>
  42.                             {% endif %}
  43.                         </div>
  44.                     {% endfor %}
  45.                 </div>
  46.             {% endif %}
  47.             <div class="flex justify-end">
  48.                 <div class="group">
  49.                     <a rel="nofollow" href="{{ fn('wc_get_cart_url') }}"
  50.                        class="relative flex flex-row items-center justify-center w-[50px] h-[40px]">
  51.                         {% include 'assets/menu-cart.svg' %}
  52.                         <span id="cartContentsCount"
  53.                               class="bg-primary text-[10px] text-white absolute h-4 block top-0 right-[4px] min-w-[15px] text-center rounded-full z-[-1]"></span>
  54.                     </a>
  55.                 </div>
  56.                 <button data-modal-target="searchModal" class="px-3">
  57.                     {% include 'assets/search.svg' %}
  58.                     <span class="sr-only">Abrir buscador</span>
  59.                 </button>
  60.             </div>
  61.             <button id="moreInfo" class="block lg:hidden">
  62.                 {% include 'assets/menu.svg' %}
  63.                 <span class="sr-only">Abrir menĂº</span>
  64.             </button>
  65.         </div>
  66.     </div>
  67.     <div id="menuOpen"
  68.          class="hidden fixed xl:absolute xl:hidden top-0 w-screen h-screen bg-[#00000060] z-10">
  69.         <div class="bg-white w-full xl:w-fit">
  70.             <div class="max-w-screen-2xl mx-auto h-screen px-5 lg:px-20 py-4 flex flex-col gap-16 lg:gap-32">
  71.                 <div class="flex flex-row justify-between items-center">
  72.                     <a href="{{ home_url }}">
  73.                         <img src="{{ asset('build/img/logo.png') }}" alt="Logo mobile {{ bloginfo.name }}"
  74.                              loading="lazy" class="w-64 h-auto">
  75.                     </a>
  76.                     <button id="menuClose">
  77.                         {% include 'assets/close.svg' %}
  78.                         <span class="sr-only">Cerrar menĂº</span>
  79.                     </button>
  80.                 </div>
  81.                 {% if menu.header|default() and menu.header.items|length %}
  82.                     <div class="flex flex-col gap-10 overflow-auto max-h-[60vh]">
  83.                         <div class="flex flex-col pb-52">
  84.                             {% for item in menu.header.items|default() %}
  85.                                 <div class="flex flex-col gap-3 justify-between border-b border-background py-4">
  86.                                     <div class="flex flex-row items-center gap-3 justify-between">
  87.                                         <a href="{{ item.link }}"
  88.                                            target="{{ item.target }}"
  89.                                            {% if item.xfn|default %}rel="{{ item.xfn }}"{% endif %}
  90.                                                 {% if item.children|length %}
  91.                                                     id="submenuChildrenOpen"
  92.                                                 {% endif %}
  93.                                            class="text-black block text-base group uppercase w-full">{{ item.title }}</a>
  94.                                         {% if item.children|length %}
  95.                                             <a href="#" class="submenuOpen px-4 flex">
  96.                                                 <i class="arrow-icon">{% include 'assets/arrow-down-mobile.svg' %}</i>
  97.                                             </a>
  98.                                         {% endif %}
  99.                                     </div>
  100.                                     {% if item.children|length %}
  101.                                         <div class="submenu hidden flex flex-col gap-2 ps-4">
  102.                                             {% for item_children in item.children|default() %}
  103.                                                 <a href="{{ item_children.link }}" target="{{ item_children.target }}"
  104.                                                    {% if item.xfn|default %}rel="{{ item.xfn }}"{% endif %}
  105.                                                    class="text-black block text-sm group uppercase w-full">{{ item_children.title|raw }}</a>
  106.                                             {% endfor %}
  107.                                         </div>
  108.                                     {% endif %}
  109.                                 </div>
  110.                             {% endfor %}
  111.                         </div>
  112.                     </div>
  113.                 {% endif %}
  114.                 {% if is_active_sidebar( 'sidebar-mobile' ) %}
  115.                     <div class="absolute bottom-0 left-0 right-0 px-5 bg-white py-4 flex flex-col justify-between gap-2 pb-4 text-black z-100">
  116.                         {{ dynamic_sidebar('sidebar-mobile') }}
  117.                     </div>
  118.                 {% endif %}
  119.             </div>
  120.         </div>
  121.     </div>
  122.     <div id="searchModal" tabindex="-1" style="margin:0;" aria-hidden="true"
  123.          class="hidden fixed inset-0 z-50 w-full overflow-x-hidden overflow-y-auto h-[100dvh] justify-start items-start">
  124.         <div class="relative w-full h-auto z-50">
  125.             <button type="button" data-modal-hide="searchModal"
  126.                     class="fixed top-5 z-50 right-5 text-black bg-transparent text-sm p-1.5 ml-auto inline-flex items-center">
  127.                 {% include 'assets/close.svg' %}
  128.                 <span class="sr-only">Cerrar modal</span>
  129.             </button>
  130.             <div class="relative bg-white shadow overflow-hidden max-h-full max-w-full m-auto p-6 2xl:px-20 space-y-6">
  131.                 <span class="uppercase text-xl block text-center text-black">Encuentra tu producto</span>
  132.                 <div class="bg-gray-100 max-w-2xl m-auto rounded-lg border border-gray-100">
  133.                     {{ shortcode('[aws_search_form id="1"]')|raw }}
  134.                 </div>
  135.             </div>
  136.         </div>
  137.         <div class="hidden bg-gray-900 bg-opacity-90 fixed inset-0 z-40 overflow-hidden cursor-pointer"
  138.              style="margin: 0;" data-modal-backdrop="searchModal"></div>
  139.     </div>
  140. </header>