// Form submission handling document.addEventListener('DOMContentLoaded', function() { const contactForm = document.querySelector('form'); if (contactForm) { contactForm.addEventListener('submit', function(e) { e.preventDefault(); // Get form values const name = document.getElementById('name').value; const email = document.getElementById('email').value; const message = document.getElementById('message').value; // Here you would typically send the data to a server console.log('Form submitted:', { name, email, message }); // Show success message alert('Tack för ditt meddelande! Vi återkommer så snart vi kan.'); contactForm.reset(); }); } // Add animations to coffee products on scroll const observerOptions = { threshold: 0.1 }; const observer = new IntersectionObserver(function(entries) { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-fadeIn'); } }); }, observerOptions); document.querySelectorAll('.bg-white.rounded-lg').forEach(card => { observer.observe(card); card.classList.add('opacity-0', 'transition-opacity', 'duration-500'); }); });