Files
brk/website_next/header/index.js
T
2026-06-05 18:12:46 +02:00

33 lines
846 B
JavaScript

import { createCube } from "../cube/index.js";
import { primaryRoutes } from "../routes.js";
export function createHeader() {
const header = document.createElement("header");
const home = document.createElement("a");
const cube = document.createElement("span");
home.href = "/";
home.ariaLabel = "bitview home";
cube.append(createCube());
home.append(cube, "bitview");
const nav = document.createElement("nav");
const list = document.createElement("ul");
nav.setAttribute("aria-label", "Primary");
for (const { pathname, label } of primaryRoutes) {
const item = document.createElement("li");
const anchor = document.createElement("a");
anchor.href = pathname;
anchor.append(label);
item.append(anchor);
list.append(item);
}
nav.append(list);
header.append(home, nav);
return header;
}