Spaces:
Running
Running
File size: 772 Bytes
87f5555 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
// 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.querySelector('form');
if (contactForm) {
contactForm.addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
// Here you would typically send the data to a server
console.log('Form submitted:', Object.fromEntries(formData));
// Show success message
alert('Merci pour votre message! Je vous répondrai dès que possible.');
this.reset();
});
} |