diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 5d191f0..4eff4e1 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,16 +2,22 @@ import { Board, startFEN } from "$lib/chess/utils"; const board = new Board(); + + let boardView = $state(Array.from(board.board)); let showIndex = $state(false); let fen = $state(startFEN); + + function updateView() { + boardView = Array.from(board.board); + }
- {#each board.board as square, index} + {#each boardView as square, index}
- {#if square}p{square}{/if} + {#if square}p{square}{/if} {showIndex ? index : ''}
{/each} @@ -22,8 +28,9 @@ +
\ No newline at end of file