// Contact form functionality function handleContactForm() { const contactForm = document.getElementById('contact-form'); if (contactForm) { contactForm.addEventListener('submit', function(e) { e.preventDefault(); const formData = new FormData(contactForm); const name = formData.get('name'); const phone = formData.get('phone'); const location = formData.get('location'); // Basic validation if (!name || !phone) { alert('Please fill in all required fields (Name and Phone Number).'); return; } // You can add your form submission logic here alert('Thank you for your interest! We will contact you soon.'); contactForm.reset(); }); } } // Smooth scrolling for navigation links function handleSmoothScrolling() { const navLinks = document.querySelectorAll('a[href^="#"]'); navLinks.forEach(link => { link.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href'); const targetElement = document.querySelector(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); } // Initialize functionality function init() { handleContactForm(); handleSmoothScrolling(); } // Cleanup function function teardown() { // Remove any event listeners if needed } // Export functions if (typeof module !== 'undefined' && module.exports) { module.exports = { init, teardown }; }