Website: use one navigation bar across pages

Co-Authored-By: OpenCode gpt-6.1-sol <noreply@opencode.ai>
This commit is contained in:
rdbtCVS
2026-10-25 01:40:39 +00:00
parent 947d65e64d
commit e820e9e1af
9 changed files with 50 additions and 105 deletions
+3 -5
View File
@@ -135,14 +135,12 @@ async function setUpLive() {
// --- Navigation ----------------------------------------------------------------------
function setUpNav() {
const bar = document.querySelector(".nav");
// The sections on this page (the nav also links to other pages, such as /server).
const links = [...document.querySelectorAll('.nav-links a[href^="#"]')];
const sections = links.map((a) => document.querySelector(a.getAttribute("href")));
// The home sections use the same root-relative links in every page's header.
const links = [...document.querySelectorAll('.nav-links a[href^="/#"]')];
const sections = links.map((a) => document.querySelector(a.hash));
let current = null;
const update = () => {
bar.classList.toggle("is-scrolled", scrollY > 24);
const line = innerHeight * 0.4;
let index = -1;
sections.forEach((s, i) => {