😺💾 Checkpoint

./2024/index.html:69682263/625
./for-artists/index.html:69682263/7638
./scripts/nav.js:69682263/450
This commit is contained in:
Glitch (fedizinefest)
2025-05-24 01:34:49 +00:00
parent 42c69cc5e8
commit 95cc06d7ba
3 changed files with 19 additions and 15 deletions

38
scripts/nav.js Normal file
View File

@ -0,0 +1,38 @@
let navItems = [
{
"href": "/",
"title": "home"
},
{
"href": "/signup",
"title": "signup"
},
{
"href": "/status",
"title": "status"
},
{
"href": "/zines",
"title": "zines!"
}
]
function populateNav() {
let nav = document.getElementById("top-nav");
let path = window.location.pathname;
for (let i = 0; i < navItems.length; i++) {
if (navItems[i].href == path) {
continue;
}
let a = document.createElement("a");
a.classList.add("nav-item");
a.href = navItems[i].href;
a.innerHTML = " " + navItems[i].title + " ";
nav.append(a);
}
}
populateNav();