website: redesign part 1

This commit is contained in:
nym21
2026-06-03 12:34:05 +02:00
parent 5f5563fece
commit 90e8741fb7
209 changed files with 23945 additions and 176 deletions
+33
View File
@@ -0,0 +1,33 @@
/**
* @param {{ fill?: number }} [options]
*/
export function createCube({ fill = 0.5 } = {}) {
const cube = document.createElement("span");
cube.className = "cube";
cube.setAttribute("aria-hidden", "true");
cube.style.setProperty("--fill", String(fill));
/** @param {...string} names */
const face = (...names) => {
const element = document.createElement("span");
element.className = `face ${names.join(" ")}`;
return element;
};
cube.append(
face("glass", "bottom"),
face("glass", "rear-right"),
face("glass", "rear-left"),
face("liquid", "bottom"),
face("liquid", "rear-right"),
face("liquid", "rear-left"),
face("liquid", "right"),
face("liquid", "left"),
face("liquid", "top"),
face("glass", "right"),
face("glass", "left"),
face("glass", "top"),
);
return cube;
}