sparkwire-electrics / script.js
GD-Huggingfaces's picture
can you take a look at the website on this url: electrician-template.framer.website and replicate it completely, in as much detail as you can
d0d30e5 verified
Raw History Blame Contribute Delete
1.16 kB
document.addEventListener('DOMContentLoaded', () => {
// Mobile menu toggle functionality
const mobileMenuButton = document.getElementById('mobile-menu-button');
const mobileMenu = document.getElementById('mobile-menu');
if (mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener('click', () => {
mobileMenu.classList.toggle('hidden');
});
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Form submission handling
const contactForm = document.getElementById('contact-form');
if (contactForm) {
contactForm.addEventListener('submit', (e) => {
e.preventDefault();
// Here you would typically send the form data to a server
alert('Thank you for your message! We will contact you soon.');
contactForm.reset();
});
}
});