import Swiper from 'https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.mjs' document.addEventListener("DOMContentLoaded", function () { const carousel = document.querySelector('.card-tile-carousel'); new Swiper(carousel, { // Optional parameters loop: true, autoplay:false, pagination: { el: carousel.querySelector('.swiper-pagination'), clickable: true, // Make pagination buttons clickable }, navigation: { nextEl: carousel.querySelector('.swiper-button-next'), prevEl: carousel.querySelector('.swiper-button-prev'), }, grabCursor: true, }); var currentUrl = window.location.href; var urlParts = currentUrl.split("/").filter((part) => part.trim() !== ""); // Remove empty parts currentUrl = urlParts[urlParts.length - 1]; var links = document.querySelectorAll(".list-prestazioni-menu-item a"); links.forEach(function (link) { var urlParts = link.href.split("/"); var lastPart = urlParts[urlParts.length - 1]; if (lastPart === currentUrl) { link.parentElement.classList.add("list-prestazioni-menu-item-selected"); return; } }); });