new: Add interactive bar script

This commit is contained in:
ngn
2024-03-21 20:10:38 +03:00
parent 275053ddb3
commit 52c619d289
5 changed files with 19 additions and 4 deletions

13
public/bar.js Normal file
View File

@ -0,0 +1,13 @@
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
}