.loading-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); display: flex; justify-content: center; align-items: center; z-index: 9998; } .loading-spinner { width: 60px; height: 60px; border: 6px solid rgba(255, 255, 255, 0.3); border-top-color: #e64c00; border-radius: 50%; animation: spin 1s linear infinite; z-index: 9999; background-color: rgba(0, 0, 0, 0.7); padding: 10px; display: flex; justify-content: center; align-items: center; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
const menuItemLinks = document.querySelectorAll('.menu-item a'); const menuToggle = document.querySelector('.bricks-mobile-menu-toggle'); const handleClick = () => { menuToggle.click(); showLoadingOverlay(); } const showLoadingOverlay = () => { const overlay = document.createElement('div'); overlay.classList.add('loading-overlay'); const spinner = document.createElement('div'); spinner.classList.add('loading-spinner'); overlay.appendChild(spinner); document.body.appendChild(overlay); setTimeout(() => { overlay.remove(); }, 3000); } if (window.matchMedia('(max-width:768px)').matches) { menuItemLinks.forEach(link => { link.addEventListener('click', (event) => { handleClick(); }); }); }