The peeked token joins its card — and stops hiding behind it

Clicking a board token now shows the thing itself, enlarged, above
its card in the peek modal — whichever art is active, photograph or
SVG. The art tables move to art.ts so the board renderer and the
modal share one source.

First cut overlapped: the card scales 2.1x out of its layout box, so
flow neighbors sat underneath its visual footprint (the note had been
compensating with a 6.8rem margin hack). A card-stage now reserves
the card's TRUE visual size; token above, note below, nothing buried.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-17 11:58:25 -04:00
co-authored by Claude Fable 5
parent 1d015681d3
commit 4528c66057
3 changed files with 56 additions and 23 deletions
+1 -19
View File
@@ -2,7 +2,7 @@
import type { GameView } from "@wizwar/engine";
import type { Side } from "@wizwar/engine";
import { colorIndexOf as sharedColorIndex, wizardColor } from "./colors";
import { tokenArt } from "./art";
import { CREATURE_ART, objectArt, TERRAIN_ART, tokenArt } from "./art";
import TokenArt from "./TokenArt.svelte";
import { FX_SPRITES } from "./fx-sprites";
@@ -90,24 +90,6 @@
// Real token art, cropped from the owner's physical set (public/tokens/).
// Anything without an entry falls back to the vector rendering below.
const USE_TOKEN_ART = true;
const TERRAIN_ART: Record<string, string> = {
stone: "solid-stone", thornbush: "thorn-bush", rosebush: "rosebush",
ooze: "killer-ooze", dust: "dustcloud", slime: "slime",
tacks: "tacks", pit: "pit", safe: "safe",
};
const CREATURE_ART: Record<string, string> = {
skeleton: "skeleton", troll: "troll", wraith: "wraith",
"fire-imp": "fire-imp", "democratic-monster": "democratic-monster",
shadow: "shadow", "alter-ego": "alter-ego",
};
function objectArt(cardId: string): string | null {
if (cardId === "dagger") return "dagger";
if (cardId === "large-rock") return "rock";
if (cardId === "master-key") return "master-key";
if (cardId.endsWith("stone")) return "magic-stone";
if (cardId.endsWith("-wand")) return "magic-wand";
return null;
}
// Ongoing spells wear their look: ghostly when unseen, webbed when caught,
// stone-gray under Medusa's gaze.
function hasSpell(id: string, cardId: string): boolean {