From 8786fda23190616dcdcbe8257c75bc8c1b6f82d6 Mon Sep 17 00:00:00 2001 From: dax Date: Tue, 4 Aug 2026 11:15:47 +0000 Subject: restore mouse hover ghosts alongside scroll preview (one preview at a time) --- public/app.css | 1 + public/app.js | 11 ++++++++++- public/index.html | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'public') diff --git a/public/app.css b/public/app.css index ef32380..8a1b201 100644 --- a/public/app.css +++ b/public/app.css @@ -50,6 +50,7 @@ html, body { box-shadow: 0 0 0 2px rgba(125, 211, 252, .65); } .dropzone { position: absolute; cursor: pointer; } +.dropzone.hidden { visibility: hidden; } .dropzone .preview { width: 100%; height: 100%; diff --git a/public/app.js b/public/app.js index b0a0db4..a80623f 100644 --- a/public/app.js +++ b/public/app.js @@ -210,7 +210,6 @@ function renderNav(id) { if (!TOUCH) { zone.addEventListener("pointermove", () => { if (adjacentTile(id, ex.dir)) return - if (cur && cur.id === id) return cancelHideGhost() showGhost(choosePlacement(id, ex.dir)) }) @@ -344,6 +343,13 @@ function traverseFrom(id, dir) { let ghost = null let ghostKey = "" +let ghostVisible = false +function setPreviewHidden(hidden) { + ghostVisible = hidden + if (!cur) return + const zs = zones.get(cur.id) + if (zs) for (const z of zs) z.classList.toggle("hidden", hidden) +} function showGhost(p) { if (!p) return const key = p.id + "|" + p.rect.x + "," + p.rect.y @@ -362,6 +368,7 @@ function showGhost(p) { el.appendChild(img) world.appendChild(el) ghost = el + setPreviewHidden(true) } function hideGhost() { @@ -370,6 +377,7 @@ function hideGhost() { ghost = null } ghostKey = "" + setPreviewHidden(false) } let hideGhostTimer = 0 @@ -435,6 +443,7 @@ function renderTileZones(id) { z.addEventListener("click", () => traverseFrom(id, bestDir)) world.appendChild(z) zones.set(id, [z]) + setPreviewHidden(ghostVisible) } function refreshPreviews() { diff --git a/public/index.html b/public/index.html index e4f77d5..2e4f8c1 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ pathways - +
@@ -16,6 +16,6 @@

four paths, one per direction. walk them.

- + -- cgit v1.3.1