templates/layout/includes/navegation/mobile.html.twig line 1

Open in your IDE?
  1. {% if currentPath == '/es/empresa' or currentPath == '/en/about-us'%}
  2.     {% set isAboutUs = true%}
  3. {% else %}
  4.     {% set isAboutUs = false %}
  5. {%  endif %}
  6. <div class="mobile-nav-wrapper" role="navigation">
  7.     <div id='closeMenu' class="closemobileMenu"><i class="icon an an-times-l pull-right"></i>{{ 'movile.navigation_close_menu' | trans }}</div>
  8.     <ul id="MobileNav" class="mobile-nav">
  9.         <li class="lvl1 bottom-link"><a href="{{ isRoot ? '#sticky-header' : navStartNode~'/' }}">{{ 'home' | trans }}</a></li>
  10.         <!-- Dropdown menu for "Professional Area" -->
  11.         <li class="lvl1 parent dropdown">
  12.             <a href="{{ isRoot ? '#featured-services' : navStartNode~'#featured-services' }}" class="lvl-1">
  13.                 {{ 'layout.footer.information.professional-area_translations' | trans }}
  14.                 <i class="an an-plus-l"></i>
  15.             </a>
  16.             <ul class="dropdown">
  17.                 <li><a href="{{ isAboutUs ? '#company' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us' : 'empresa') }}" class="site-nav">{{ 'home.about-us_title_translations' | trans }}</a></li>
  18.                 <li><a href="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#technicalAdvice" class="site-nav">{{ 'home.about-us-cards.technical_advice_translations' | trans }}</a></li>
  19.                 <li><a href="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#customService" class="site-nav">{{ 'home.about-us-cards.custom_service_translations' | trans }}</a></li>
  20.                 <li><a href="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#stockLogisticMobile" class="site-nav">{{ 'stockLogisticMobile' | trans }}</a></li>
  21.                 <li><a href="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#trainingMobile" class="site-nav">{{ 'about-us-cards.training'| trans }}</a></li>
  22.             </ul>
  23.         </li>
  24.         <!-- Other menu items -->
  25.         <li class="lvl1 bottom-link"><a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/products/default_m1' : 'es/productos/default_m1') }}">{{ 'layout.navbar-desktop.products_translations' | trans }}</a></li>
  26.         <li class="lvl1 parent dropdown">
  27.             <a href="{{ isRoot ? '/#technicalArea' : navStartNode~'/#technicalArea' }}" class="lvl-1">
  28.                 {{ 'Layout.Navegation.Technical-Area_translations' | trans }}
  29.                 <i class="an an-plus-l"></i>
  30.             </a>
  31.             <ul class="dropdown">
  32.                 <li><a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/technical-area/painting-schemes' : 'es/area-tecnica/esquemas-de-pintado') }}" class="site-nav">{{ "Esquemas de pintado" | trans }}</a></li>
  33.                 <li><a href="#" onclick="event.preventDefault()" id="search-link-mobile" class="site-nav">{{ "Fichas técnicas y de seguridad" | trans }}</a></li>
  34.                 <li><a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/technical-area/calculate-square-meters' : 'es/area-tecnica/calcular-metros-cuadrados') }}" class="site-nav">{{ "Calcular metros cuadrados" | trans }}</a></li>
  35.                 <li><a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/technical-area/how-much-paint-do-I-need' : 'es/area-tecnica/cuanta-pintura-necesito') }}" class="site-nav">{{ "Cuánta pintura necesito?" | trans }}</a></li>
  36.             </ul>
  37.         </li>
  38.         <li class="lvl1 bottom-link"><a href="/#catalog">{{ 'home.catalog.title_translations' | trans }}</a></li>
  39.         <li class="lvl1 bottom-link"><a href="{{path('rates-view')}}">{{ 'lbl_Tarifa' | trans }}</a></li>
  40.         <li class="lvl1 parent dropdown">
  41.             <a href="{{ isRoot ? '/#collaborators' : navStartNode~'/#collaborators' }}" class="lvl-1">
  42.                 {{ 'layout.navegation.collaborators_translations' | trans }}
  43.                 <i class="an an-plus-l"></i>
  44.             </a>
  45.             <ul class="dropdown">
  46.                 <li><a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/point-of-sale' : 'es/puntos-de-venta') }}" class="site-nav">{{ 'home.collaborators.points-of-sale_translations' | trans}}</a></li>
  47.                 <li><a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/industry-professionals' : 'es/profesionales-del-sector') }}" class="site-nav">{{ 'home.collaborators.industry-professionals_translations' | trans}}</a></li>
  48.             </ul>
  49.         </li>
  50.         <li class="lvl1 bottom-link"><a href="/#news">{{ 'layout.navbar-desktop.new-arrivals_translations' | trans }}</a></li>
  51.         <li class="lvl1 bottom-link"><a href="/{{ app.request.locale }}#contact">{{ 'BotonContacto' | trans }}</a></li>
  52.         {# Gets the events document dinamically with his path to get the data from the editables in it#}
  53.         {% set documentName = app.request.locale == 'en' ? '/recent-events' : '/eventos-recientes' %}
  54.         {% set eventDocument = pimcore_document_by_path('/' ~ app.request.locale ~ documentName) %}
  55.         {% set eventBlock = eventDocument.getEditable('eventBlock') %}
  56.         {% if eventBlock is not null and not eventBlock.isEmpty() %}
  57.                 {% set eventsPath = app.request.locale == 'en' ? '/en/recent-events' : '/es/eventos-recientes' %}
  58.                 <li class="lvl1 bottom-link"><a href="{{ eventsPath }}">{{ 'Events' | trans }}</a></li>
  59.             <li><a href="/myAccount">{{ 'layout.footer.information.my-account_translations' | trans }}</a></li>
  60.             <li><a href="{{ path('account_logout')}}">{{ "Logout" | trans }}</a></li>
  61.         {% else %}
  62.             <li><a href="/account/login">{{ 'home.footer_login_translations' | trans }}</a></li>
  63.             <li><a id="register-btn" href="/{{ app.request.locale }}/#contact-title">{{ "Regístrate" | trans }}</a></li>
  64.         {% endif %}
  65.     </ul>
  66. </div>
  67. <script>
  68.     // JavaScript code to handle the dropdown toggle
  69.     document.addEventListener("DOMContentLoaded", function () {
  70.         const dropdownToggles = document.querySelectorAll(".dropdown-toggle")
  71.         const searchLinkMobile = document.getElementById("search-link-mobile");
  72.         const closeMenu = document.getElementById("closeMenu");
  73.         var searchBox = document.getElementById("search-box");
  74.         var searchBoxMobile = document.getElementById("search-box-mobile");
  75.         var searchBoxMobile = document.getElementById("search-box-mobile");
  76.         var lang = document.documentElement.lang;
  77.         var placeholderText = lang === "en" ? "What product do you want technical information for?" : "¿De qué producto quiere su ficha técnica?";
  78.         var placeholderInterval;
  79.         var placeholderTextIndex = 0;
  80.         var isTyping = false;
  81.         dropdownToggles.forEach(function (toggle) {
  82.             toggle.addEventListener("click", function () {
  83.                 const dropdownMenu = this.nextElementSibling;
  84.                 const icon = this.querySelector(".an");
  85.                 if (dropdownMenu.classList.contains("active")) {
  86.                     dropdownMenu.classList.remove("active");
  87.                     icon.classList.remove("an-minus-l");
  88.                     icon.classList.add("an-plus-l");
  89.                 } else {
  90.                     dropdownMenu.classList.add("active");
  91.                     icon.classList.remove("an-plus-l");
  92.                     icon.classList.add("an-minus-l");
  93.                 }
  94.             });
  95.         });
  96.         function typePlaceholderText(element, text, interval) {
  97.             placeholderTextIndex = 0;
  98.             clearInterval(placeholderInterval);
  99.             isTyping = true;
  100.             placeholderInterval = setInterval(function() {
  101.                 element.setAttribute("placeholder", text.slice(0, placeholderTextIndex));
  102.                 element.style.color = "red";
  103.                 placeholderTextIndex++;
  104.                 if (placeholderTextIndex > text.length) {
  105.                     clearInterval(placeholderInterval);
  106.                     isTyping = false;
  107.                 }
  108.             }, interval);
  109.         }
  110.         function shakeSearchBox() {
  111.             if (isTyping) {
  112.                 clearInterval(placeholderInterval);
  113.                 isTyping = false;
  114.                 searchBox.removeAttribute("style");
  115.                 searchBoxMobile.removeAttribute("style");
  116.             }
  117.             searchBox.value = "";
  118.             searchBox.removeAttribute("placeholder");
  119.             searchBox.focus();
  120.             searchBox.classList.add("shake");
  121.             searchBoxMobile.value = "";
  122.             searchBoxMobile.removeAttribute("placeholder");
  123.             $('#search-popup').addClass("active");
  124.             searchBoxMobile.focus();
  125.             searchBoxMobile.classList.add("shake");
  126.             setTimeout(function() {
  127.                 searchBox.classList.remove("shake");
  128.                 searchBoxMobile.classList.remove("shake");
  129.                 typePlaceholderText(searchBox, placeholderText, 100);
  130.                 typePlaceholderText(searchBoxMobile, placeholderText, 100);
  131.             }, 600);
  132.             searchBox.focus();
  133.             searchBoxMobile.focus();
  134.         }
  135.         searchLinkMobile.addEventListener("click", function(event) {
  136.             event.preventDefault();
  137.             shakeSearchBox();
  138.             closeMenu.click();
  139.         });
  140.     });
  141. </script>