templates/elements2024/menu.html.twig line 1

Open in your IDE?
  1. {% set settings = sulu_snippet_load_by_area('settings_area') %}
  2. {% set menu = [
  3.   {
  4.     title: settings.content.menutitleOne,
  5.         menu: 'burgerOne',
  6.         images: [
  7.             'img/menu/1.webp',
  8.             'img/home/services/1.webp',
  9.             'img/home/services/2.webp',
  10.         ]
  11.   }, {
  12.     title: settings.content.menutitleTow,
  13.         menu: 'burgerTow',
  14.         images: [
  15.         'img/menu/1.webp',
  16.             'img/home/services/1.webp',
  17.             'img/home/services/2.webp',
  18.             'img/home/services/3.webp',
  19.             'img/home/services/1.webp',
  20.             'img/home/services/2.webp',
  21.         ]
  22.   }, {
  23.     title: settings.content.menutitleThree,
  24.         menu: 'burgerThree',
  25.         images: [
  26.             'img/home/services/1.webp',
  27.             'img/home/services/2.webp',
  28.     ]
  29.   }
  30. ] %}
  31. <div class="menu bg-green text-white fixed inset-0 opacity-0 pointer-events-none duration-500 z-30">
  32.     <div class="container pt-28 md:pt-36 lg:pt-28 overflow-auto max-h-screen h-full">
  33.         <div class="flex flex-col md:w-1/2 lg:w-4/12 h-full">
  34.             <ul class="menu-list js-slides-animation-triggers mb-28">
  35.                 {% for item in menu %}
  36.                     <li>
  37.                         <button class="text-2xl md:text-4xl lg:text-[2rem]">
  38.                             {{ item.title }}
  39.                             <svg viewbox="0 0 4 8" fill="none" xmlns="http://www.w3.org/2000/svg">
  40.                                 <path d="M4 4L-3.49691e-07 1.74846e-07L0 8L4 4Z" fill="#F7F7F7"/>
  41.                             </svg>
  42.                         </button>
  43.                         {% if item.menu %}
  44.                             <ul class="menu-list__sub">
  45.                                 {% for subItem in sulu_navigation_root_flat(item.menu, 4)  %}
  46.                                     <li class="js-slides-animation-trigger">
  47.                                         <a class="text-base md:text-2xl lg:text-base" href="{{ sulu_content_path(subItem.url) }}" target="_parent">{{ subItem.title }}</a>
  48.                                     </li>
  49.                                 {% endfor %}
  50.                             </ul>
  51.                         {% endif %}
  52.                     </li>
  53.                 {% endfor %}
  54.             </ul>
  55.             <div class="flex flex-col gap-8 mt-auto max-md:pb-32 pb-16">
  56.                 <div class="flex flex-col gap-2">
  57.                     <div>Address</div>
  58.                     <address class="not-italic">
  59.                         {{settings.content.address|raw}}
  60.                     </address>
  61.                 </div>
  62.                 {% include 'elements2024/contacts.html.twig' %}
  63.             </div>
  64.         </div>
  65.         <div class="js-menu-slide-wrapper hidden lg:block absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1/5 max-w-[404px] aspect-[1/1.37] pointer-events-none">
  66.             {% for item in menu %}
  67.                 {# {% for img in item.menu %} #}
  68.                     {% for subItem in sulu_navigation_root_flat(item.menu, 4)  %}
  69.                         <div class="js-menu-slide absolute inset-0">
  70.                             <div class="js-menu-slide__image w-full h-full">
  71.                                 {% set page = sulu_content_load(subItem.uuid) %}
  72.                                 {% set menuImage = null %}
  73.                                 {% if page.content.url == "/louer" or page.content.url == "/acheter" %}
  74.                                     {% if page.extension.excerpt.images[0].url is defined %}
  75.                                         {% set menuImage = page.extension.excerpt.images[0].url %}
  76.                                     {% endif %}
  77.                                 {% else %}
  78.                                     {% set menuImage = page.content.menuImage.url %}
  79.                                 {% endif %}
  80.                                 <img class="img-cover" src="{{menuImage}}" alt="">
  81.                             </div>
  82.                         </div>
  83.                     {% endfor %}
  84.                 {# {% endfor %} #}
  85.             {% endfor %}
  86.         </div>
  87.     </div>
  88. </div>