website/public/bar.js

14 lines
325 B
JavaScript
Raw Permalink Normal View History

2024-03-21 17:10:38 +00:00
const links = [].slice.call(document.getElementById("links").children)
links.sort((a, b) => b.href.length - a.href.length);
for(let i in links){
if(!location.href.startsWith(links[i].href)){
continue
}
links[i].style = `
color: var(--bright-second);
font-weight: 900;
text-decoration: underline;`
break
}