<script>
  //expander code
document.addEventListener("DOMContentLoaded", function() {
    var expander = document.querySelector(".bt-account-container__expander");
    var sideWrapper = document.querySelector(".bt-account-container__side-wrapper");

    if (expander && sideWrapper) {
        // Add 'no-transition' class on page load
        sideWrapper.classList.add("no-transition");

        // Function to check viewport width and set classes accordingly
        function setInitialClasses() {
            var viewportWidth = window.innerWidth;
            var isCollapsed = localStorage.getItem("expanderActive") === "true";

            if (viewportWidth <= 767 || isCollapsed) {
                // Add initial classes for smaller viewports or if previously collapsed
                expander.classList.add("active");
                sideWrapper.classList.add("collapse");
                sideWrapper.classList.remove("expand");
                expander.setAttribute("aria-expanded", "false");
            } else {
                // Remove initial classes for larger viewports if not previously collapsed
                expander.classList.remove("active");
                sideWrapper.classList.remove("collapse");
                sideWrapper.classList.add("expand");
                expander.setAttribute("aria-expanded", "true");
            }
        }

        // Set initial classes based on viewport width and local storage
        setInitialClasses();

        // Add a click event listener to the expander
        expander.addEventListener("click", function() {
            var isActive = expander.classList.toggle("active");

            if (isActive) {
                sideWrapper.classList.add("collapse");
                sideWrapper.classList.remove("expand");
                expander.setAttribute("aria-expanded", "false");
                localStorage.setItem("expanderActive", "true");
            } else {
                sideWrapper.classList.remove("collapse");
                sideWrapper.classList.add("expand");
                expander.setAttribute("aria-expanded", "true");
                localStorage.setItem("expanderActive", "false");
            }

            // Remove 'no-transition' class after the first click
            sideWrapper.classList.remove("no-transition");
            // Remove event listener to ensure it only triggers once
            expander.removeEventListener("click", this);
        });

        // Optional: Add a resize event listener to handle viewport changes
        window.addEventListener("resize", setInitialClasses);
    } else {
        console.error("Expander or sideWrapper not found");
    }
});
</script>


<script>
  //current page script
document.addEventListener('DOMContentLoaded', () => {
    // Get the current pathname
    const currentPath = window.location.pathname;

    // Get all elements with the class 'bt-account__link'
    const links = document.querySelectorAll('.bt-account__link');

    links.forEach(link => {
        // Create a URL object from the link's href
        const linkPath = new URL(link.href).pathname;

        // Check if the pathname matches the current path
        if (linkPath === currentPath) {
            // Add the 'current' class and 'aria-current' attribute to the matching link
            link.classList.add('current');
            link.setAttribute('aria-current', 'page');
        } else {
            // Remove the 'current' class and 'aria-current' attribute if present
            link.classList.remove('current');
            link.removeAttribute('aria-current');
        }
    });
});
</script>

Ho trovato 57 articoli che corrispondono alla tua ricerca"".