Every edge answers a hover: tooltips for walls, doors, fire, illusions
Only the special door lock states carried titles. Now plain walls ('a
wall'), locked doors, the wall of fire (with its 4-damage warning), the
untested shimmer ('tap to test your eyes'), the known-illusion ghost,
and battle cracks (damage taken so far) all speak on hover. The
firewall's hover target is its bar; the flames stay click-through.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138A8CjeQRpvzKxuMfz1Bqc
This commit is contained in:
co-authored by
Claude Fable 5
parent
d8b8f8fd53
commit
9eeb89caca
@@ -11,6 +11,7 @@
|
||||
const CELL = 48;
|
||||
const WALL = 7;
|
||||
const cls = $derived(state === "door" ? `door${lock ? ` ${lock}` : ""}` : "wall");
|
||||
const tip = $derived(title ?? (state === "door" ? "a locked door" : "a wall"));
|
||||
</script>
|
||||
|
||||
{#if kind === "V"}
|
||||
@@ -18,13 +19,13 @@
|
||||
x={(x + 1) * CELL - WALL / 2} y={y * CELL - WALL / 2}
|
||||
width={WALL} height={CELL + WALL}
|
||||
class={cls}
|
||||
>{#if title}<title>{title}</title>{/if}</rect>
|
||||
><title>{tip}</title></rect>
|
||||
{:else}
|
||||
<rect
|
||||
x={x * CELL - WALL / 2} y={(y + 1) * CELL - WALL / 2}
|
||||
width={CELL + WALL} height={WALL}
|
||||
class={cls}
|
||||
>{#if title}<title>{title}</title>{/if}</rect>
|
||||
><title>{tip}</title></rect>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user