/** * AirTheme v1.0 — base theme scripts * Author: alexwp12 | cryptolamer.ru */ document.addEventListener('DOMContentLoaded', function() { // === Fade-in effect for main content blocks === const fadeBlocks = document.querySelectorAll('.airtheme-content, .airtheme-form-container, .hero-inner'); fadeBlocks.forEach(el => { el.style.opacity = '0'; el.style.transition = 'opacity 0.8s ease-out'; }); // Small delay to make the fade-in smooth setTimeout(() => { fadeBlocks.forEach(el => el.style.opacity = '1'); }, 150); // === Smooth scroll for anchor links === const smoothLinks = document.querySelectorAll('a[href^="#"]'); for (let link of smoothLinks) { link.addEventListener('click', function (e) { e.preventDefault(); const id = link.getAttribute('href'); if (id && id.length > 1) { document.querySelector(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); } // === Console message for debug === console.log('%cAirTheme loaded successfully 🌬️', 'color:#ff6600;font-weight:bold;'); }); // === Mobile burger menu === document.addEventListener("DOMContentLoaded", function () { const toggle = document.getElementById("menu-toggle"); const menu = document.querySelector(".main-menu"); if (toggle && menu) { toggle.addEventListener("click", function () { menu.classList.toggle("active"); toggle.classList.toggle("open"); }); } }); // Fix for touch devices (prevents delay on some browsers) document.addEventListener('touchstart', function() {}, true);