templates/galilea/import/components/header.twig line 1

  1. <header class="fixed top-0 z-20 w-full text-sm pointer-events-none" :class="{'text-black': overlay && !$store.header.open, 'text-white': !overlay || $store.header.open}" x-data="header" @scroll.window.passive="handleScroll" @resize.window="handleResize" x-cloak>
  2.     <div class="relative transition-transform" :class="{'-translate-y-[150%]': hide && !$store.header.open}">
  3.         <div class="absolute inset-0 w-full transition-colors" :class="{'bg-white/70 backdrop-blur-[3rem]': overlay && !$store.header.open}"></div>
  4.         <div class="container relative pointer-events-auto">
  5.             <div class="flex relative items-center h-16 lg:h-24">
  6.                 <a href="{{ homepage_url ?: '/' }}" class="block z-20 w-28 transition-colors lg:mr-16 xl:mr-32 shrink-0">
  7.                     {{ include((baseIncludePath ? baseIncludePath : '') ~ 'components/logo.twig') }}
  8.                 </a>
  9.                 <nav class="flex gap-6 items-center mr-6 max-lg:hidden">
  10.                     {% for item in header_nav %}
  11.                         {% if item.children %}
  12.                             <div class="relative group">
  13.                                 <a href="{{item.url}}" class="flex gap-1 items-center transition-colors" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} :class="{'hover:text-brand-50': overlay, 'hover:text-secondary-50': !overlay}">
  14.                                     {{ item.title }}
  15.                                     {% if item.target %}
  16.                                         <span class="inline-block relative w-[0.6em] -top-[0.1em]">
  17.                                             {% include (baseIncludePath ? baseIncludePath : '') ~ 'svgs/external.twig' %}
  18.                                         </span>
  19.                                     {% endif %}
  20.                                 </a>
  21.                                 <div class="absolute left-0 top-full pt-3 text-black opacity-0 transition-all translate-y-4 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto" :class="{'!pointer-events-none': hide}">
  22.                                     <nav class="relative -left-4 p-4 space-y-3 bg-white rounded-2xl">
  23.                                         {% for item in item.children %}
  24.                                             <a href="{{ item.url }}" class="block transition-colors hover:text-brand-50">
  25.                                                 {{item.title}}
  26.                                             </a>
  27.                                         {% endfor %}
  28.                                     </nav>
  29.                                 </div>
  30.                             </div>
  31.                         {% else %}
  32.                             <a href="{{item.url}}" class="flex gap-1 items-center transition-colors" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} :class="{'hover:text-brand-50': overlay, 'hover:text-secondary-50': !overlay}">
  33.                                 {{ item.title }}
  34.                                 {% if item.target %}
  35.                                     <span class="inline-block relative w-[0.6em] -top-[0.1em]">
  36.                                         {% include (baseIncludePath ? baseIncludePath : '') ~ 'svgs/external.twig' %}
  37.                                     </span>
  38.                                 {% endif %}
  39.                             </a>
  40.                         {% endif %}
  41.                     {% endfor %}
  42.                 </nav>
  43.                 <!-- If we only have two languages, we can toggle here without a select, just show en / de  -->
  44.                 <!--  TODO: the language link for the page has to be inserted here -->
  45.                 <a href="{{ language_link }}" class="flex gap-2 items-center mr-6 ml-auto uppercase transition-colors lg:mr-10" :class="{'hover:text-brand-50': overlay, 'hover:text-secondary-50': !overlay}">
  46.                     <span class="size-4">
  47.                         <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 15 15">
  48.                             <path d="M7.5 14.5c1.657 0 3-3.134 3-7s-1.343-7-3-7-3 3.134-3 7 1.343 7 3 7ZM.5 7.5h14" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path>
  49.                             <path d="M7.5 14.5a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path>
  50.                         </svg>
  51.                     </span>
  52.                     <span>{{ language_label }}</span>
  53.                 </a>
  54.                 <nav class="flex gap-10 items-center max-lg:hidden">
  55.                     {% for item in header_subnav %}
  56.                         <a href="{{item.url}}" class="flex gap-1 items-center transition-colors" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} :class="{'hover:text-brand-50': overlay, 'hover:text-secondary-50': !overlay}">
  57.                             {{ item.title }}
  58.                             {% if item.target %}
  59.                                 <span class="inline-block relative w-[0.6em] -top-[0.1em]">
  60.                                     {% include (baseIncludePath ? baseIncludePath : '') ~ 'svgs/external.twig' %}
  61.                                 </span>
  62.                             {% endif %}
  63.                         </a>
  64.                     {% endfor %}
  65.                     {% for cta in header_ctas %}
  66.                         <a href="{{ cta.url }}" class="btn btn-lg" :class="{'btn-tertiary': !overlay || $store.header.open, 'btn-tertiary-inverted': overlay && !$store.header.open}" {{ cta.target ? ('target="' ~ cta.target ~ '" rel="noopener noreferrer"')|raw }}>
  67.                             {{ cta.title }}
  68.                         </a>
  69.                     {% endfor %}
  70.                 </nav>
  71.                 <button class="flex z-20 justify-center items-center rounded-full lg:hidden size-12 bg-white/15" @click="$store.header.open = !$store.header.open">
  72.                     <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 18 7" class="absolute w-[1.125rem]" x-show="!$store.header.open"><path fill="currentColor" fill-rule="evenodd" d="M18 0H0v1h18V0Zm0 6H0v1h18V6Z" clip-rule="evenodd"/></svg>
  73.                     <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 14 14" class="absolute w-4" x-show="$store.header.open"><path fill="currentColor" fill-rule="evenodd" d="m7.707 7 6.01-6.01-.707-.707L7 6.293.99.283.282.99 6.292 7l-6.01 6.01.708.708L7 7.708l6.01 6.01.707-.707L7.707 7Z" clip-rule="evenodd"/></svg>
  74.                 </button>
  75.             </div>
  76.         </div>
  77.     </div>
  78.     <div class="fixed top-0 z-10 w-full h-screen bg-black transition-opacity duration-500" :class="{'opacity-0 pointer-events-none': !$store.header.open, 'pointer-events-auto': $store.header.open}">
  79.         <canvas class="absolute inset-0 pointer-events-none size-full" x-rive="{{ footer_animation }}"></canvas>
  80.         <div class="flex overflow-auto absolute inset-0 flex-col px-6 pt-32 pb-10 h-full transition-transform size-full header-mask" :class="{'-translate-x-full': subnav}" data-lenis-prevent>
  81.             <nav class="space-y-5 text-2xl mainnav">
  82.                 {% for item in header_nav %}
  83.                     {% if item.children %}
  84.                         <a href="#" class="flex gap-1 items-center transition-colors hover:text-secondary-50" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} @click.prevent="subnav = {{ loop.index }}">
  85.                             {{ item.title }}
  86.                             <span class="pt-0.5 ml-2 w-2.5">
  87.                                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 12 19"><path fill="currentColor" fill-rule="evenodd" d="M8.364 9.808.586 17.586 2 19l9.192-9.192L2 .615.586 2.03l7.778 7.779Z" clip-rule="evenodd"/></svg>
  88.                             </span>
  89.                         </a>
  90.                     {% else %}
  91.                         <a href="{{item.url}}" class="flex gap-1 items-center transition-colors hover:text-secondary-50" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} @click="$store.header.open = false">
  92.                             {{ item.title }}
  93.                             {% if item.target %}
  94.                                 <span class="inline-block relative w-[0.6em] -top-[0.1em]">
  95.                                     {% include (baseIncludePath ? baseIncludePath : '') ~ 'svgs/external.twig' %}
  96.                                 </span>
  97.                             {% endif %}
  98.                         </a>
  99.                     {% endif %}
  100.                 {% endfor %}
  101.                 {% for item in header_subnav %}
  102.                     <a href="{{item.url}}" class="flex gap-1 items-center transition-all hover:text-secondary-50" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} @click="$store.header.open = false">
  103.                         {{ item.title }}
  104.                         {% if item.target %}
  105.                             <span class="inline-block relative w-[0.6em] -top-[0.1em]">
  106.                                 {% include (baseIncludePath ? baseIncludePath : '') ~ 'svgs/external.twig' %}
  107.                             </span>
  108.                         {% endif %}
  109.                     </a>
  110.                 {% endfor %}
  111.             </nav>
  112.             <nav class="flex pt-10 mt-auto">
  113.                 {% for cta in header_ctas %}
  114.                     <a href="{{ cta.url }}" class="shrink basis-full btn btn-lg btn-primary" {{ cta.target ? ('target="' ~ cta.target ~ '" rel="noopener noreferrer"')|raw }} @click="$store.header.open = false">
  115.                         <span class="btndot"></span>
  116.                         {{ cta.title }}
  117.                     </a>
  118.                 {% endfor %}
  119.             </nav>
  120.         </div>
  121.         {% for item in header_nav %}
  122.             {% if item.children %}
  123.                 <div class="flex overflow-auto absolute inset-0 flex-col px-6 pt-32 pb-10 h-full transition-transform size-full header-mask" :class="{'translate-x-full': subnav !== {{ loop.index }}}" data-lenis-prevent>
  124.                     <nav class="space-y-5 text-2xl">
  125.                         <a href="#" @click.prevent="subnav = false" class="flex gap-3 items-center h-8 text-base text-white/70">
  126.                             <span class="w-3">
  127.                                 <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 13 14"><path stroke="#fff" stroke-opacity=".7" d="M6.364 12.657.707 7m0 0 5.657-5.656M.707 7H12.02"/></svg>
  128.                             </span>
  129.                             {{ item.title}}
  130.                         </a>
  131.                         {% for item in item.children %}
  132.                             <a href="{{item.url}}" class="flex gap-1 items-center transition-colors hover:text-secondary-50" {{ item.target ? ('target="' ~ item.target ~ '" rel="noopener noreferrer"')|raw }} @click="$store.header.open = false">
  133.                                 {{ item.title }}
  134.                                 {% if item.target %}
  135.                                     <span class="inline-block relative w-[0.6em] -top-[0.1em]">
  136.                                         {% include (baseIncludePath ? baseIncludePath : '') ~ 'svgs/external.twig' %}
  137.                                     </span>
  138.                                 {% endif %}
  139.                             </a>
  140.                         {% endfor %}
  141.                     </nav>
  142.                 </div>
  143.             {% endif %}
  144.         {% endfor %}
  145.     </div>
  146. </header>