From e354ddc2240d15cf9da2eb5aa390ae0ef9d44451 Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Thu, 14 May 2026 10:47:27 -0700 Subject: [PATCH] Move direction arrow inside game on right edge, always points right toward NPC --- game.js | 8 +++----- style.css | 7 ++++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/game.js b/game.js index c85a11a..f9bcb41 100644 --- a/game.js +++ b/game.js @@ -256,13 +256,11 @@ class Game { if (!arrow) return; if (nearNPC) { arrow.style.display = 'none'; return; } const world = document.getElementById('map-inner'); - const viewW = world ? world.parentElement.offsetWidth : 420; const viewH = world ? world.parentElement.offsetHeight : 300; - const npcScreenX = this.state.npcWorldX - this.state.worldX; - arrow.textContent = npcScreenX >= viewW / 2 ? '▶' : '◀'; + arrow.textContent = '▶'; arrow.style.display = 'block'; - arrow.style.left = (viewW / 2 + 30) + 'px'; - arrow.style.bottom = (viewH * 0.48) + 'px'; + arrow.style.removeProperty('left'); + arrow.style.bottom = (viewH * 0.42) + 'px'; } _nearNPC() { diff --git a/style.css b/style.css index 5bd6cb5..f449821 100644 --- a/style.css +++ b/style.css @@ -427,14 +427,15 @@ html, body { } /* Directional nudge arrow */ .map-dir-arrow { - position: fixed; - font-size: clamp(20px, 6vw, 28px); + position: absolute; + font-size: clamp(24px, 7vw, 34px); color: var(--yellow); text-shadow: 0 0 6px rgba(248,192,48,.8), 2px 2px 0 rgba(0,0,0,.5); pointer-events: none; - z-index: 20; + 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 */ } /* NPC lives inside .map-inner, positioned in world-px via JS */ .map-npc-wrap { position:absolute; text-align:center; z-index: 30; }