mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 23:29:58 -07:00
website: fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user