Highlight the selected page

This commit is contained in:
Alexandra
2024-10-17 17:45:16 -06:00
parent c13f3eccbb
commit ed4cf2639e
2 changed files with 13 additions and 1 deletions

View File

@@ -48,4 +48,7 @@
.footer-text{
margin: 0;
}
.selected{
color: rgb(255, 189, 51)!important;
}
</style>

View File

@@ -14,4 +14,13 @@
<a class="nav-link text-white" href="/settings">Settings</a>
</li>
</ul>
</nav>
</nav>
<script defer>
const aTags = document.querySelectorAll('a')
aTags.forEach(aTag => {
if(aTag.getAttribute('href') == window.location.pathname){
aTag.classList.add('selected')
}
})
</script>