website/public/bar.js

14 lines
325 B
JavaScript

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
}