From b31488201839d4a5e6be5bb380795ba3b67027f3 Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Wed, 20 May 2026 12:16:42 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20diagonal=20line=20in=20top-left=20?= =?UTF-8?q?=E2=80=94=20arrow=20animation=20now=20only=20runs=20when=20visi?= =?UTF-8?q?ble,=20hidden=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.js | 3 ++- style.css | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/game.js b/game.js index 323f0d3..6f1b069 100644 --- a/game.js +++ b/game.js @@ -440,11 +440,12 @@ class Game { _updateDirArrow(nearNPC) { const arrow = document.getElementById('map-dir-arrow'); if (!arrow) return; - if (nearNPC) { arrow.style.display = 'none'; return; } + if (nearNPC) { arrow.style.display = 'none'; arrow.style.animation = 'none'; return; } const world = document.getElementById('map-inner'); const viewH = world ? world.parentElement.offsetHeight : 300; arrow.textContent = '▶'; arrow.style.display = 'block'; + arrow.style.animation = 'arrowPulse .7s ease-in-out infinite'; arrow.style.removeProperty('left'); arrow.style.bottom = (viewH * 0.28) + 'px'; } diff --git a/style.css b/style.css index 8173f79..8d3be7a 100644 --- a/style.css +++ b/style.css @@ -474,9 +474,10 @@ html, body { text-shadow: 0 0 6px rgba(248,192,48,.8), 2px 2px 0 rgba(0,0,0,.5); pointer-events: none; z-index: 50; - animation: arrowPulse .7s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(248,192,48,.6)); - right: 12px; /* pinned to right edge of map viewport */ + right: 12px; + display: none; + bottom: -9999px; /* ensure off-screen when hidden */ } /* NPC lives inside .map-inner, positioned in world-px via JS */ .map-npc-wrap { position:absolute; text-align:center; z-index: 30; } @@ -525,7 +526,7 @@ html, body { background-position: 0 0; image-rendering: pixelated; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.4)); - z-index: 999; + z-index: 10; font-size: 0; color: transparent; }