make avtive button in nav bar white

This commit is contained in:
Anton Livaja 2025-03-22 19:56:37 -07:00
parent e47aef5b74
commit e81f052317
Signed by: anton
GPG Key ID: 44A86CFF1FDF0E85
2 changed files with 24 additions and 0 deletions

View File

@ -29,4 +29,24 @@
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
let pathSegment = window.location.pathname.split('/')[1];
if (pathSegment.endsWith('.html')) {
pathSegment = pathSegment.replace('.html', '');
}
const navLinks = document.querySelectorAll('.header-page-links li a');
navLinks.forEach(link => {
let linkPath = link.getAttribute('href').replace('/', '').replace('.html', '');
if (linkPath === pathSegment) {
link.classList.add('active');
}
});
});
</script>
</header>

View File

@ -1475,6 +1475,10 @@ pre {
color: var(--light-grey);
}
.active {
color: white !important;
}
/** end carousel */
/**