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

Open in your IDE?
  1. <style>
  2.     @import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap');
  3.     {% if is_authenticated %}
  4.     .menu-outer{
  5.         background-color: #737474;
  6.     }
  7.     {% else %}
  8.     .menu-outer{
  9.         background-color: #106eea;
  10.     }
  11.     {% endif %}
  12.     #siteNav.medium {
  13.         font-family: 'Raleway', sans-serif; /* Establece el tipo de fuente para todo el navbar */
  14.     }
  15.     {% if currentPath == '/es/empresa' or currentPath == '/en/about-us'%}
  16.     {% set isAboutUs = true%}
  17.     {% else %}
  18.     {% set isAboutUs = false %}
  19.     {%  endif %}
  20.     #siteNav.medium > li a {
  21.         font-size: 16px;
  22.         padding: 8px 16px;
  23.         margin-left: 10px;
  24.         font-weight: 700;
  25.         color: #fff;
  26.         position: relative;
  27.         display: inline-block;
  28.         overflow: hidden;
  29.         text-transform: capitalize;
  30.     }
  31.     #siteNav.medium > li a::after {
  32.         content: '';
  33.         position: absolute;
  34.         bottom: 0;
  35.         left: 50%;
  36.         width: 0;
  37.         height: 2px;
  38.         background-color: #fff;
  39.         transition: width 0.3s ease-out, transform 0.3s ease-out;
  40.         transform: translateX(-50%);
  41.         transform-origin: center;
  42.     }
  43.     #siteNav.medium > li a:hover::after {
  44.         width: 100%;
  45.         transform: translateX(-50%) scaleX(2);
  46.     }
  47.     #siteNav.medium > li a:hover {
  48.         color: #fff;
  49.     }
  50.     #siteNav.medium > li .dropdown-item {
  51.         color: #000;
  52.     }
  53.     @keyframes shake {
  54.         0%, 100% {
  55.             transform: translateX(0);
  56.         }
  57.         10%, 30%, 50%, 70%, 90% {
  58.             transform: translateX(-5px);
  59.         }
  60.         20%, 40%, 60%, 80% {
  61.             transform: translateX(5px);
  62.         }
  63.     }
  64.     .shake {
  65.         animation: shake 0.5s;
  66.     }
  67.     #search-box::placeholder {
  68.         color: #FF0000;
  69.     }
  70. </style>
  71. <div class="menu-outer d-none d-lg-block pb-1">
  72.     <div class="container">
  73.         <div class="row">
  74.             <div class="col-1 col-sm-1 col-md-1 col-lg-12 align-self-center d-menu-col">
  75.                 <nav class="grid__item" id="AccessibleNav">
  76.                     <ul id="siteNav" class="site-nav medium center hidearrow">
  77.                         {#  HOME #}
  78.                         <li class="lvl1">
  79.                             <a href="{{ isRoot ? '#sticky-header' : navStartNode~'/' }}">{{ "layout.navbar-desktop.home_translations" | trans }}
  80.                                 <i class="an an-angle-down-l"></i>
  81.                             </a>
  82.                         </li>
  83.                         {# ABOUT US #}
  84.                         <li class="lvl1 parent dropdown">
  85.                             <a href="{{ isRoot ? '#featured-services' : navStartNode~'#featured-services' }}">{{ 'layout.footer.information.professional-area_translations' | trans }}
  86.                                 <i class="an an-angle-down-l"></i>
  87.                             </a>
  88.                                 <ul class="dropdown">
  89.                                     <li><a href="{{ isAboutUs ? '#company' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us' : 'empresa') }}" class="site-nav">{{ 'home.about-us_title_translations' | trans}}</a></li>
  90.                                     <li><a href="{{ isAboutUs ? '#technicalAdvice' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us#technicalAdvice' : 'empresa#technicalAdvice') }}" class="site-nav">{{ 'home.about-us-cards.technical_advice_translations' | trans }}</a></li>
  91.                                     <li><a href="{{ isAboutUs ? '#customService' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us#customService' : 'empresa#customService') }}" class="site-nav">{{ 'home.about-us-cards.custom_service_translations' | trans }}</a></li>
  92.                                     <li><a href="{{ isAboutUs ? '#stockLogistic' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us#stockLogistic' : 'empresa#stockLogistic') }}" class="site-nav">{{ 'home.about-us-cards.stock_and_logistics_translations' | trans }}</a></li>
  93.                                     <li><a href="{{ isAboutUs ? '#training' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us#training' : 'empresa#training') }}" class="site-nav">{{ 'home.about-us-cards.training_translations'| trans }}</a></li>
  94.                                 </ul>
  95.                         </li>
  96.                         {#  PRODUCTS #}
  97.                         <li class="lvl1 parent dropdown">
  98.                             <a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/products/default_m1' : 'es/productos/default_m1') }}">{{ 'layout.navbar-desktop.products_translations'|trans }}
  99.                                 <i class="an an-angle-down-l"></i>
  100.                             </a>
  101.                         </li>
  102.                         {# Technical Area #}
  103.                         <li class="lvl1 parent dropdown">
  104.                             <a href="{{ isRoot ? '#technicalArea' : navStartNode~'#technicalArea' }}">{{ 'Layout.Navegation.Technical-Area_translations' | trans }}
  105.                                 <i class="an an-angle-down-l"></i>
  106.                             </a>
  107.                             {% if  currentPath != '/' and currentPath != '/en' %}
  108.                                 <ul class="dropdown">
  109.                                     <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>
  110.                                     <li><a href="#" class="site-nav" id="search-link">{{ "Fichas técnicas y de seguridad" | trans }}</a></li>
  111.                                     <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>
  112.                                     <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>
  113.                                 </ul>
  114.                             {% endif %}
  115.                         </li>
  116.                         {# Catalog Area #}
  117.                         <li class="lvl1 parent dropdown">
  118.                             <a href="{{ isRoot ? '#catalog' : navStartNode~'#catalog' }}">{{ 'lbl_Catálogo' | trans }}
  119.                                 <i class="an an-angle-down-l"></i>
  120.                             </a>
  121.                         </li>
  122.                         {% if not is_authenticated %}
  123.                             <li class="lvl1 parent dropdown">
  124.                                 <a href="{{ isRoot ? '#collaborators' : navStartNode~'#collaborators' }}">{{ "layout.navegation.collaborators_translations" | trans}}<i class="an an-angle-down-l"></i></a>
  125.                                 {% if  currentPath != '/' and currentPath != '/en' %}
  126.                                     <ul class="dropdown">
  127.                                         <li>
  128.                                             <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>
  129.                                         </li>
  130.                                         <li>
  131.                                             <a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/industry-professionals' : 'es/profesionales-del-sector') }}" class="site-nav">{{ 'home.collaborators.industry-professionals_translations' | trans}}</a>
  132.                                         </li>
  133.                                     </ul>
  134.                                 {% endif %}
  135.                             </li>
  136.                         {% else %}
  137.                             {# Define las rutas para ambos idiomas #}
  138.                             {% set ratesEnRoute = 'rates-view-translated-en' %}
  139.                             {% set ratesEsRoute = 'rates-view-translated-es' %}
  140.                             {# Asigna las rutas según el idioma actual #}
  141.                             {% if currentLocale == 'en' %}
  142.                                 {% set ratesRoute = ratesEnRoute %}
  143.                             {% else %}
  144.                                 {% set ratesRoute = ratesEsRoute %}
  145.                             {% endif %}
  146.                             <li class="lvl1 parent dropdown">
  147.                                 <a href="{{path(ratesRoute)}}">{{ 'lbl_Tarifa' | trans }}<i class="an an-angle-down-l"></i></a>
  148.                             </li>
  149.                         {% endif %}
  150.                         <li class="lvl1 parent dropdown">
  151.                             <a href="{{ isRoot ? '#news' : navStartNode~'#news' }}">{{ 'layout.navbar-desktop.new-arrivals_translations' | trans }}<i class="an an-angle-down-l"></i></a>
  152.                         </li>
  153.                         <li class="lvl1 parent dropdown">
  154.                             <a href="{{ isRoot ? '#contact' : navStartNode~'#contact' }}" class="site-nav">
  155.                                 {{ 'BotonContacto' | trans }}<i class="an an-angle-down-l"></i>
  156.                             </a>
  157.                         </li>
  158.                         {# Gets the events document dinamically with his path to get the data from the editables in it#}
  159.                         {% set documentName = app.request.locale == 'en' ? '/recent-events' : '/eventos-recientes' %}
  160.                         {% set eventDocument = pimcore_document_by_path('/' ~ app.request.locale ~ documentName) %}
  161.                         {% set eventBlock = eventDocument.getEditable('eventBlock') %}
  162.                         {% if is_authenticated and eventBlock is not null and not eventBlock.isEmpty() %}
  163.                             <li class="lvl1 parent dropdown">
  164.                                 {% set eventsPath = app.request.locale == 'en' ? '/en/recent-events' : '/es/eventos-recientes' %}
  165.                                 <a href="{{ eventsPath }}" class="site-nav">
  166.                                     {{ 'Events' | trans }}<i class="an an-angle-down-l"></i>
  167.                                 </a>
  168.                             </li>
  169.                         {% endif %}
  170.                     </ul>
  171.                 </nav>
  172.             </div>
  173.         </div>
  174.     </div>
  175. </div>
  176. <script>
  177.     document.addEventListener("DOMContentLoaded", function() {
  178.         var searchLink = document.getElementById("search-link");
  179.         var searchBox = document.getElementById("search-box");
  180.         var lang = document.documentElement.lang;
  181.         var placeholderText = lang === "en" ? "What product do you want technical information for?" : "¿De qué producto quiere su ficha técnica?";
  182.         var placeholderInterval;
  183.         var placeholderTextIndex = 0;
  184.         var isTyping = false;
  185.         function typePlaceholderText(element, text, interval) {
  186.             placeholderTextIndex = 0;
  187.             clearInterval(placeholderInterval);
  188.             isTyping = true;
  189.             placeholderInterval = setInterval(function() {
  190.                 element.setAttribute("placeholder", text.slice(0, placeholderTextIndex));
  191.                 element.style.color = "red";
  192.                 placeholderTextIndex++;
  193.                 if (placeholderTextIndex > text.length) {
  194.                     clearInterval(placeholderInterval);
  195.                     isTyping = false;
  196.                 }
  197.             }, interval);
  198.         }
  199.         function shakeSearchBox() {
  200.             if (isTyping) {
  201.                 clearInterval(placeholderInterval);
  202.                 isTyping = false;
  203.                 searchBox.style.color = "black";
  204.             }
  205.             searchBox.value = "";
  206.             searchBox.removeAttribute("placeholder");
  207.             searchBox.focus();
  208.             searchBox.classList.add("shake");
  209.             setTimeout(function() {
  210.                 searchBox.classList.remove("shake");
  211.                 typePlaceholderText(searchBox, placeholderText, 100);
  212.             }, 600);
  213.             searchBox.focus();
  214.         }
  215.         searchLink.addEventListener("click", function(event) {
  216.             event.preventDefault();
  217.             shakeSearchBox();
  218.         });
  219.         searchBox.addEventListener("input", function() {
  220.             if (searchBox.getAttribute("placeholder") === placeholderText) {
  221.                 searchBox.value = "";
  222.                 searchBox.removeAttribute("placeholder");
  223.             }
  224.             if (searchBox.value.length > 0) {
  225.                 searchBox.style.setProperty("color", "#000000", "important");
  226.             } else if (!isTyping) {
  227.                 searchBox.style.setProperty("color", "#FF0000", "important");
  228.             }
  229.         });
  230.         searchBox.addEventListener("keydown", function() {
  231.             if (isTyping) {
  232.                 clearInterval(placeholderInterval);
  233.                 isTyping = false;
  234.                 searchBox.removeAttribute("style");
  235.             }
  236.         });
  237.     });
  238. </script>