This commit is contained in:
Maciej Caderek
2022-02-11 16:20:40 +01:00
parent 4374db0197
commit 56abf27629
4 changed files with 24 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { BoardConfig, GameConfig } from "./types";
import { BoardConfig, BoardStyle, GameConfig, PiecesStyle } from "./types";
import Board from "./board/Board";
import Game from "./game/Game";
import pgns from "./test-data/pgns";
@@ -33,6 +33,8 @@ const gameConfig: GameConfig = {
fromPly: null,
toPly: null,
loop: true,
format: "GIF",
size: "M",
};
const createDownloadLink = async (pgn: string, boardConfig: BoardConfig) => {
@@ -104,6 +106,12 @@ const main = async () => {
player.pause();
player.goto(ply);
},
changeBoardStyle(style: BoardStyle) {
board.updateConfig({ boardStyle: style });
},
changePiecesStyle(style: PiecesStyle) {
board.updateConfig({ piecesStyle: style });
},
};
/**
@@ -130,6 +138,9 @@ const main = async () => {
// controls.load();
};
// @ts-ignore
window.board = board;
document.addEventListener(
"contextmenu",
(e) => {