| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize Feather Icons | |
| if (window.feather) { | |
| feather.replace(); | |
| } | |
| // Initialize mobile menu for custom navbar | |
| const initCustomNavbar = () => { | |
| const navbar = document.querySelector('custom-navbar'); | |
| if (navbar) { | |
| const shadowRoot = navbar.shadowRoot; | |
| const mobileMenuButton = shadowRoot.getElementById('mobile-menu-button'); | |
| const mobileMenu = shadowRoot.getElementById('mobile-menu'); | |
| if (mobileMenuButton && mobileMenu) { | |
| mobileMenuButton.addEventListener('click', () => { | |
| mobileMenu.classList.toggle('hidden'); | |
| if (window.feather) { | |
| feather.replace(); | |
| } | |
| }); | |
| } | |
| } | |
| }; | |
| initCustomNavbar(); | |
| // Form handling for contact page | |
| const contactForm = document.querySelector('form'); | |
| if (contactForm) { | |
| contactForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // Here you would typically send the form data to a server | |
| alert('Thank you for your message! We will get back to you soon.'); | |
| this.reset(); | |
| }); | |
| } | |
| }); |