add: multiple pages in one entry, details syntax

This commit is contained in:
trisua 2025-08-14 03:11:46 -04:00
parent db63427795
commit a127a0407d
3 changed files with 217 additions and 4 deletions

View file

@ -349,3 +349,20 @@ globalThis.toggle_metadata_css = (e) => {
window.location.reload();
}
};
globalThis.hash_check = (hash) => {
if (hash.startsWith("#/")) {
for (const x of Array.from(document.querySelectorAll(".subpage"))) {
x.classList.add("hidden");
}
document.getElementById(hash).classList.remove("hidden");
}
};
window.addEventListener("hashchange", (_) => hash_check(window.location.hash));
setTimeout(() => {
// run initial hash check
hash_check(window.location.hash);
}, 150);