<style>
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap');
{% if is_authenticated %}
.menu-outer{
background-color: #737474;
}
{% else %}
.menu-outer{
background-color: #106eea;
}
{% endif %}
#siteNav.medium {
font-family: 'Raleway', sans-serif; /* Establece el tipo de fuente para todo el navbar */
}
{% if currentPath == '/es/empresa' or currentPath == '/en/about-us'%}
{% set isAboutUs = true%}
{% else %}
{% set isAboutUs = false %}
{% endif %}
#siteNav.medium > li a {
font-size: 16px;
padding: 8px 16px;
margin-left: 10px;
font-weight: 700;
color: #fff;
position: relative;
display: inline-block;
overflow: hidden;
text-transform: capitalize;
}
#siteNav.medium > li a::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 2px;
background-color: #fff;
transition: width 0.3s ease-out, transform 0.3s ease-out;
transform: translateX(-50%);
transform-origin: center;
}
#siteNav.medium > li a:hover::after {
width: 100%;
transform: translateX(-50%) scaleX(2);
}
#siteNav.medium > li a:hover {
color: #fff;
}
#siteNav.medium > li .dropdown-item {
color: #000;
}
@keyframes shake {
0%, 100% {
transform: translateX(0);
}
10%, 30%, 50%, 70%, 90% {
transform: translateX(-5px);
}
20%, 40%, 60%, 80% {
transform: translateX(5px);
}
}
.shake {
animation: shake 0.5s;
}
#search-box::placeholder {
color: #FF0000;
}
</style>
<div class="menu-outer d-none d-lg-block pb-1">
<div class="container">
<div class="row">
<div class="col-1 col-sm-1 col-md-1 col-lg-12 align-self-center d-menu-col">
<nav class="grid__item" id="AccessibleNav">
<ul id="siteNav" class="site-nav medium center hidearrow">
{# HOME #}
<li class="lvl1">
<a href="{{ isRoot ? '#sticky-header' : navStartNode~'/' }}">{{ "layout.navbar-desktop.home_translations" | trans }}
<i class="an an-angle-down-l"></i>
</a>
</li>
{# ABOUT US #}
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#featured-services' : navStartNode~'#featured-services' }}">{{ 'layout.footer.information.professional-area_translations' | trans }}
<i class="an an-angle-down-l"></i>
</a>
<ul class="dropdown">
<li><a href="{{ isAboutUs ? '#company' : navStartNode~'/'~ (app.request.locale == 'en' ? 'about-us' : 'empresa') }}" class="site-nav">{{ 'home.about-us_title_translations' | trans}}</a></li>
<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>
<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>
<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>
<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>
</ul>
</li>
{# PRODUCTS #}
<li class="lvl1 parent dropdown">
<a href="{{ '/' ~ (app.request.locale == 'en' ? 'en/products/default_m1' : 'es/productos/default_m1') }}">{{ 'layout.navbar-desktop.products_translations'|trans }}
<i class="an an-angle-down-l"></i>
</a>
</li>
{# Technical Area #}
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#technicalArea' : navStartNode~'#technicalArea' }}">{{ 'Layout.Navegation.Technical-Area_translations' | trans }}
<i class="an an-angle-down-l"></i>
</a>
{% if currentPath != '/' and currentPath != '/en' %}
<ul class="dropdown">
<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>
<li><a href="#" class="site-nav" id="search-link">{{ "Fichas técnicas y de seguridad" | trans }}</a></li>
<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>
<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>
</ul>
{% endif %}
</li>
{# Catalog Area #}
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#catalog' : navStartNode~'#catalog' }}">{{ 'lbl_Catálogo' | trans }}
<i class="an an-angle-down-l"></i>
</a>
</li>
{% if not is_authenticated %}
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#collaborators' : navStartNode~'#collaborators' }}">{{ "layout.navegation.collaborators_translations" | trans}}<i class="an an-angle-down-l"></i></a>
{% if currentPath != '/' and currentPath != '/en' %}
<ul class="dropdown">
<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>
<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>
</ul>
{% endif %}
</li>
{% else %}
{# Define las rutas para ambos idiomas #}
{% set ratesEnRoute = 'rates-view-translated-en' %}
{% set ratesEsRoute = 'rates-view-translated-es' %}
{# Asigna las rutas según el idioma actual #}
{% if currentLocale == 'en' %}
{% set ratesRoute = ratesEnRoute %}
{% else %}
{% set ratesRoute = ratesEsRoute %}
{% endif %}
<li class="lvl1 parent dropdown">
<a href="{{path(ratesRoute)}}">{{ 'lbl_Tarifa' | trans }}<i class="an an-angle-down-l"></i></a>
</li>
{% endif %}
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#news' : navStartNode~'#news' }}">{{ 'layout.navbar-desktop.new-arrivals_translations' | trans }}<i class="an an-angle-down-l"></i></a>
</li>
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#contact' : navStartNode~'#contact' }}" class="site-nav">
{{ 'BotonContacto' | trans }}<i class="an an-angle-down-l"></i>
</a>
</li>
{# Gets the events document dinamically with his path to get the data from the editables in it#}
{% set documentName = app.request.locale == 'en' ? '/recent-events' : '/eventos-recientes' %}
{% set eventDocument = pimcore_document_by_path('/' ~ app.request.locale ~ documentName) %}
{% set eventBlock = eventDocument.getEditable('eventBlock') %}
{% if is_authenticated and eventBlock is not null and not eventBlock.isEmpty() %}
<li class="lvl1 parent dropdown">
{% set eventsPath = app.request.locale == 'en' ? '/en/recent-events' : '/es/eventos-recientes' %}
<a href="{{ eventsPath }}" class="site-nav">
{{ 'Events' | trans }}<i class="an an-angle-down-l"></i>
</a>
</li>
{% endif %}
</ul>
</nav>
</div>
</div>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function() {
var searchLink = document.getElementById("search-link");
var searchBox = document.getElementById("search-box");
var lang = document.documentElement.lang;
var placeholderText = lang === "en" ? "What product do you want technical information for?" : "¿De qué producto quiere su ficha técnica?";
var placeholderInterval;
var placeholderTextIndex = 0;
var isTyping = false;
function typePlaceholderText(element, text, interval) {
placeholderTextIndex = 0;
clearInterval(placeholderInterval);
isTyping = true;
placeholderInterval = setInterval(function() {
element.setAttribute("placeholder", text.slice(0, placeholderTextIndex));
element.style.color = "red";
placeholderTextIndex++;
if (placeholderTextIndex > text.length) {
clearInterval(placeholderInterval);
isTyping = false;
}
}, interval);
}
function shakeSearchBox() {
if (isTyping) {
clearInterval(placeholderInterval);
isTyping = false;
searchBox.style.color = "black";
}
searchBox.value = "";
searchBox.removeAttribute("placeholder");
searchBox.focus();
searchBox.classList.add("shake");
setTimeout(function() {
searchBox.classList.remove("shake");
typePlaceholderText(searchBox, placeholderText, 100);
}, 600);
searchBox.focus();
}
searchLink.addEventListener("click", function(event) {
event.preventDefault();
shakeSearchBox();
});
searchBox.addEventListener("input", function() {
if (searchBox.getAttribute("placeholder") === placeholderText) {
searchBox.value = "";
searchBox.removeAttribute("placeholder");
}
if (searchBox.value.length > 0) {
searchBox.style.setProperty("color", "#000000", "important");
} else if (!isTyping) {
searchBox.style.setProperty("color", "#FF0000", "important");
}
});
searchBox.addEventListener("keydown", function() {
if (isTyping) {
clearInterval(placeholderInterval);
isTyping = false;
searchBox.removeAttribute("style");
}
});
});
</script>