// Mobile menu toggle functionality document.addEventListener('DOMContentLoaded', function() { const menuButton = document.querySelector('nav button'); const mobileMenu = document.createElement('div'); mobileMenu.className = 'md:hidden fixed inset-0 bg-[#0D0D0D] z-50 flex flex-col items-center justify-center hidden'; mobileMenu.innerHTML = `
FRAGRANCES ABOUT COLLECTIONS JOURNAL
`; document.body.appendChild(mobileMenu); menuButton.addEventListener('click', function() { mobileMenu.classList.remove('hidden'); }); mobileMenu.querySelector('button').addEventListener('click', function() { mobileMenu.classList.add('hidden'); }); // Close mobile menu when clicking on a link mobileMenu.querySelectorAll('a').forEach(link => { link.addEventListener('click', function() { mobileMenu.classList.add('hidden'); }); }); // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // Add subtle scroll animations const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('fade-in'); } }); }, observerOptions); document.querySelectorAll('section').forEach(section => { observer.observe(section); }); });