| |
|
|
| document.addEventListener('DOMContentLoaded', function() { |
| |
| const currentPage = window.location.pathname.split('/').pop(); |
| const navLinks = document.querySelectorAll('nav a'); |
| navLinks.forEach(link => { |
| if (link.getAttribute('href') === currentPage) { |
| link.style.fontWeight = 'bold'; |
| } |
| }); |
| |
| |
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { |
| anchor.addEventListener('click', function (e) { |
| e.preventDefault(); |
| const target = document.querySelector(this.getAttribute('href')); |
| if (target) { |
| target.scrollIntoView({ |
| behavior: 'smooth', |
| block: 'start' |
| }); |
| } |
| }); |
| }); |
| |
| |
| const contactForm = document.getElementById('contactForm'); |
| if (contactForm) { |
| contactForm.addEventListener('submit', function(e) { |
| e.preventDefault(); |
| alert('Thank you for your message! I will get back to you soon.'); |
| this.reset(); |
| }); |
| } |
| |
| |
| }); |
|
|
|
|