-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
25 lines (23 loc) · 1020 Bytes
/
script.js
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
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling for navigation 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');
contactForm.addEventListener('submit', function(e) {
e.preventDefault();
// Here you would typically send the form data to a server
// For this example, we'll just log it to the console
const formData = new FormData(contactForm);
console.log('Form submitted with data:', Object.fromEntries(formData));
alert('Thank you for your message! I will get back to you soon.');
contactForm.reset();
});
// Add any additional interactive features here
});