-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
33 lines (29 loc) · 1.08 KB
/
script.js
File metadata and controls
33 lines (29 loc) · 1.08 KB
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
26
27
28
29
30
31
32
33
// Page Navigation
document.addEventListener('DOMContentLoaded', function() {
// Mobile Menu Toggle
const menuToggle = document.getElementById('menuToggle');
const navMenu = document.getElementById('navMenu');
if (menuToggle) {
menuToggle.addEventListener('click', function() {
navMenu.classList.toggle('active');
});
}
// Highlight active page in navigation
const currentPath = window.location.pathname.split('/').pop();
const navLinks = document.querySelectorAll('.nav-link');
navLinks.forEach(link => {
const linkPage = link.getAttribute('href').split('/').pop();
if (linkPage === currentPath) {
link.classList.add('active');
}
});
// Contact Form Submission
const contactForm = document.getElementById('contactForm');
if (contactForm) {
contactForm.addEventListener('submit', function(e) {
e.preventDefault();
alert('Thank you for your message! We will get back to you soon.');
contactForm.reset();
});
}
});