website: fixes

This commit is contained in:
nym21
2026-04-20 18:11:30 +02:00
parent 08175009d2
commit 327873d010
9 changed files with 140 additions and 96 deletions

View File

@@ -74,6 +74,8 @@ const lineWidth = /** @type {1} */ (/** @type {unknown} */ (1.5));
const MAX_SIZE = 10_000;
let hintShown = false;
/** @typedef {{ label: string, index: IndexLabel, from: number }} RangePreset */
/** @returns {RangePreset[]} */
@@ -1677,6 +1679,20 @@ export function createChart({ parent, brk, fitContent }) {
});
chartEl.append(captureButton);
if (!hintShown) {
hintShown = true;
const hint = document.createElement("div");
hint.className = "chart-hint";
hint.textContent = matchMedia("(pointer: coarse)").matches
? "pinch to zoom · swipe to pan"
: "scroll to zoom · drag to pan";
root.append(hint);
const dismiss = () => hint.classList.add("done");
chartEl.addEventListener("wheel", dismiss, { once: true, passive: true });
chartEl.addEventListener("pointerdown", dismiss, { once: true });
}
return chart;
}