Skip to content

Commit

Permalink
Update animation.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Kxsumi authored May 6, 2024
1 parent 644d333 commit cd26c78
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@ document.addEventListener("DOMContentLoaded", function() {

observer.observe(document.querySelector('.center-text'));
});

document.addEventListener('DOMContentLoaded', () => {
const currentPage = window.location.pathname;
const navLinks = document.querySelectorAll('.navbar a');

navLinks.forEach((link) => {
if (link.href.includes(currentPage)) {
link.classList.add('active');
} else {
link.classList.remove('active');
}
});
});

0 comments on commit cd26c78

Please sign in to comment.