Enhance navbar design and functionality in index.html, styles.css, and script.js. Implement a glass effect for the navbar, add animated hover effects for navigation links, and introduce a scroll effect that changes the navbar's appearance on scroll. Update styles for improved responsiveness and visual appeal.

This commit is contained in:
Alvin
2025-06-04 11:12:00 +02:00
parent 1b0f0ca1a6
commit 2a9e57bb5d
3 changed files with 147 additions and 9 deletions

View File

@@ -209,4 +209,14 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
}
// Navbar scroll effect
const navbar = document.querySelector('.navbar');
window.addEventListener('scroll', () => {
if (window.scrollY > 50) {
navbar.classList.add('scrolled');
} else {
navbar.classList.remove('scrolled');
}
});
});