diff --git a/src/components/GameBoard.svelte b/src/components/GameBoard.svelte index 3e7c3c7..be70313 100644 --- a/src/components/GameBoard.svelte +++ b/src/components/GameBoard.svelte @@ -1,4 +1,13 @@
{#each cells as cell (cell.row * cols + cell.col)} + {@const tile = tileFor(cell)}
oncellclick?.(cell.row, cell.col)} - >
+ > + + {#if previewCells.has(`${cell.row},${cell.col}`) && !cell.isLight} +
+ +
+ {/if} +
{/each} @@ -44,22 +68,23 @@ position: relative; } .cell { + position: relative; width: 100%; height: 100%; - background: var(--grid-empty); - border: 1px solid var(--grid-border); cursor: pointer; - transition: background 0.2s ease; } - .cell.wall { background: var(--grid-wall); cursor: default; } - .cell.goal { background: var(--grid-goal); } - .cell.lit { background: var(--grid-lit); } - .cell.preview { background: rgba(255, 234, 0, 0.15); border-color: rgba(255, 234, 0, 0.3); } + .cell.wall { cursor: default; } + .preview-overlay { + position: absolute; + inset: 0; + pointer-events: none; + opacity: 0.7; + } .cell.detected-flash { animation: cell-flash 0.4s ease-out; } @keyframes cell-flash { - 0% { background: #ff0000; } - 100% { background: var(--grid-lit); } + 0% { filter: brightness(2) hue-rotate(-60deg); } + 100% { filter: none; } } diff --git a/src/components/GameHud.svelte b/src/components/GameHud.svelte index 0fc602c..79057c8 100644 --- a/src/components/GameHud.svelte +++ b/src/components/GameHud.svelte @@ -2,6 +2,9 @@ import { getText } from '../lib/localization.js'; import { isMuted, setMuted, playClick } from '../lib/audio.js'; import Button from './Button.svelte'; + import Pixel from '../lib/pixel/Pixel.svelte'; + import { HEART_ART, HEART_ART_EMPTY, HEART_PAL, + ICON_UNDO, ICON_EYE, ICON_PAUSE, ICON_PAL } from '../lib/pixel/art-ui.js'; let { lives = 3, level = 1, turns = 0, showPreview = false, canUndo = false, ontogglepreview, onpause, onmenu, onundo, onshowcontrols } = $props(); let muted = $state(isMuted()); @@ -11,20 +14,33 @@ setMuted(muted); if (!muted) playClick(); } + + const MAX_LIVES = 3; + let hearts = $derived(Array.from({ length: MAX_LIVES }, (_, i) => i < lives));
- {getText('lives')}{lives} +
+ {#each hearts as full} + + {/each} +
Turns: {turns}
- {getText('level')}{level} -
@@ -43,5 +59,25 @@ align-items: center; gap: 12px; } + .lives { + display: flex; + gap: 2px; + align-items: center; + } .turns { color: var(--text-secondary); font: var(--font-small); } + .level-label { font: var(--font-ui); color: var(--text-primary); } + .icon-btn { + background: var(--btn-default); + border: 2px solid var(--btn-border); + border-radius: 4px; + padding: 4px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: background 0.15s; + } + .icon-btn:hover:not(:disabled) { background: var(--btn-hover); } + .icon-btn:disabled { opacity: 0.4; cursor: default; } + .icon-btn.active { background: var(--btn-hover); border-color: var(--text-accent); } diff --git a/src/components/GuardSprite.svelte b/src/components/GuardSprite.svelte index 4c5c0ec..867fbe1 100644 --- a/src/components/GuardSprite.svelte +++ b/src/components/GuardSprite.svelte @@ -1,10 +1,19 @@
+ {#if sprite} + + {/if} {#if hasDirection}
{/if} @@ -21,28 +33,26 @@ diff --git a/src/scenes/MainMenu.svelte b/src/scenes/MainMenu.svelte index ffd6ebc..30a9fca 100644 --- a/src/scenes/MainMenu.svelte +++ b/src/scenes/MainMenu.svelte @@ -1,13 +1,15 @@ @@ -20,8 +22,14 @@ >
{/each} +
+ +
+

{getText('gameTitle')}

-
+
+ +