{% if currentPath == '/es/empresa' or currentPath == '/en/about-us'%}
{% set isAboutUs = true%}
{% else %}
{% set isAboutUs = false %}
{% endif %}
<div class="mobile-nav-wrapper" role="navigation">
<div id='closeMenu' class="closemobileMenu"><i class="icon an an-times-l pull-right"></i>{{ 'movile.navigation_close_menu' | trans }}</div>
<ul id="MobileNav" class="mobile-nav">
<!-- Dropdown menu for "Professional Area" -->
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '#featured-services' : navStartNode~'#featured-services' }}" class="lvl-1">
{{ 'layout.footer.information.professional-area_translations' | trans }}
<i class="an an-plus-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="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#technicalAdvice" class="site-nav">{{ 'home.about-us-cards.technical_advice_translations' | trans }}</a></li>
<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>
<li><a href="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#stockLogistic" class="site-nav">{{ 'home.about-us-cards.stock_and_logistics_translations' | trans }}</a></li>
<li><a href="/{{ app.request.locale == 'en' ? 'en/about-us' : 'es/empresa' }}#training" class="site-nav">{{ 'home.about-us-cards.training_translations'| trans }}</a></li>
</ul>
</li>
<!-- Other menu items -->
<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>
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '/#technicalArea' : navStartNode~'/#technicalArea' }}" class="lvl-1">
{{ 'Layout.Navegation.Technical-Area_translations' | trans }}
<i class="an an-plus-l"></i>
</a>
<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="#" onclick="event.preventDefault()" id="search-link-mobile" class="site-nav">{{ "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>
</li>
<li class="lvl1 bottom-link"><a href="/#catalog">{{ 'home.catalog.title_translations' | trans }}</a></li>
<li class="lvl1 bottom-link"><a href="{{path('rates-view')}}">{{ 'lbl_Tarifa' | trans }}</a></li>
<li class="lvl1 parent dropdown">
<a href="{{ isRoot ? '/#collaborators' : navStartNode~'/#collaborators' }}" class="lvl-1">
{{ 'layout.navegation.collaborators_translations' | trans }}
<i class="an an-plus-l"></i>
</a>
<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>
</li>
<li class="lvl1 bottom-link"><a href="/#news">{{ 'layout.navbar-desktop.new-arrivals_translations' | trans }}</a></li>
<li class="lvl1 bottom-link"><a href="/{{ app.request.locale }}#contact">{{ 'BotonContacto' | trans }}</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 %}
{% if not eventBlock.isEmpty() %}
{% set eventsPath = app.request.locale == 'en' ? '/en/recent-events' : '/es/eventos-recientes' %}
<li class="lvl1 bottom-link"><a href="{{ eventsPath }}">{{ 'Events' | trans }}</a></li>
{% endif %}
<li><a href="/myAccount">{{ 'layout.footer.information.my-account_translations' | trans }}</a></li>
<li><a href="{{ path('account_logout')}}">{{ "Logout" | trans }}</a></li>
{% else %}
<li><a href="/account/login">{{ 'home.footer_login_translations' | trans }}</a></li>
<li><a id="register-btn" href="/{{ app.request.locale }}/#contact-title">{{ "Regístrate" | trans }}</a></li>
{% endif %}
</ul>
</div>
<script>
// JavaScript code to handle the dropdown toggle
document.addEventListener("DOMContentLoaded", function () {
const dropdownToggles = document.querySelectorAll(".dropdown-toggle")
const searchLinkMobile = document.getElementById("search-link-mobile");
const closeMenu = document.getElementById("closeMenu");
var searchBox = document.getElementById("search-box");
var searchBoxMobile = document.getElementById("search-box-mobile");
var searchBoxMobile = document.getElementById("search-box-mobile");
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;
dropdownToggles.forEach(function (toggle) {
toggle.addEventListener("click", function () {
const dropdownMenu = this.nextElementSibling;
const icon = this.querySelector(".an");
if (dropdownMenu.classList.contains("active")) {
dropdownMenu.classList.remove("active");
icon.classList.remove("an-minus-l");
icon.classList.add("an-plus-l");
} else {
dropdownMenu.classList.add("active");
icon.classList.remove("an-plus-l");
icon.classList.add("an-minus-l");
}
});
});
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.removeAttribute("style");
searchBoxMobile.removeAttribute("style");
}
searchBox.value = "";
searchBox.removeAttribute("placeholder");
searchBox.focus();
searchBox.classList.add("shake");
searchBoxMobile.value = "";
searchBoxMobile.removeAttribute("placeholder");
$('#search-popup').addClass("active");
searchBoxMobile.focus();
searchBoxMobile.classList.add("shake");
setTimeout(function() {
searchBox.classList.remove("shake");
searchBoxMobile.classList.remove("shake");
typePlaceholderText(searchBox, placeholderText, 100);
typePlaceholderText(searchBoxMobile, placeholderText, 100);
}, 600);
searchBox.focus();
searchBoxMobile.focus();
}
searchLinkMobile.addEventListener("click", function(event) {
event.preventDefault();
shakeSearchBox();
closeMenu.click();
});
});
</script>