This commit is contained in:
Maciej Caderek
2022-01-17 05:27:14 +01:00
parent afe8efd568
commit 2214e73ad4
2 changed files with 7 additions and 5 deletions

View File

@@ -92,6 +92,7 @@ class Board {
} }
async renderTitleScreen(header: { [key: string]: string | undefined }) { async renderTitleScreen(header: { [key: string]: string | undefined }) {
console.log(header);
this.tempCtx.clearRect(0, 0, this.size, this.size); this.tempCtx.clearRect(0, 0, this.size, this.size);
await drawSquare(this.tempCtx, this.size, 0, 0, this.style.border); await drawSquare(this.tempCtx, this.size, 0, 0, this.style.border);
@@ -101,8 +102,7 @@ class Board {
async render(boardData: BoardData | null, move: Move | null = null) { async render(boardData: BoardData | null, move: Move | null = null) {
this.lastMove = move; this.lastMove = move;
this.boardData = boardData; this.boardData = boardData;
const { background, dark, light, moveIndicator, border, coords } = const { background, dark, light, border, coords } = this.style;
this.style;
const hasBorder = border && this.borderVisible; const hasBorder = border && this.borderVisible;
const tempBorderWidth = hasBorder ? this.size / 32 : 0; const tempBorderWidth = hasBorder ? this.size / 32 : 0;

View File

@@ -3,9 +3,9 @@ import "./style.css";
import Board from "./board/Board"; import Board from "./board/Board";
import styles from "./board/styles-board"; import styles from "./board/styles-board";
import Game from "./game/Game"; import Game from "./game/Game";
import pgns from "./test-data/pgns"; // import pgns from "./test-data/pgns";
import createSimpleGIF from "./gif/createSimpleGIF"; import createSimpleGIF from "./gif/createSimpleGIF";
import { compressPGN, decompressPGN } from "./game/PGNHelpers"; import { decompressPGN } from "./game/PGNHelpers";
const $app = document.querySelector<HTMLImageElement>("#app"); const $app = document.querySelector<HTMLImageElement>("#app");
@@ -47,8 +47,10 @@ const createDownloadLink = async (pgn: string, style: Style) => {
return link; return link;
}; };
console.log(createDownloadLink.name);
const main = async () => { const main = async () => {
const style = styles.calm; const style = styles.avocado;
window.location.hash = window.location.hash =
"#QiBEdWtlIEthcmwgLyBDb3VudCBJc291YXJkCkQgMTg1OC4/Py4/PwpFIFBhcmlzClIgMS0wClMgUGFyaXMgRlJBClcgUGF1bCBNb3JwaHkKCmU0IGU1IE5mMyBkNiBkNCBCZzQgZHhlNSBCeGYzIFF4ZjMgZHhlNSBCYzQgTmY2IFFiMyBRZTcgTmMzIGM2IEJnNSBiNSBOeGI1IGN4YjUgQnhiNSsgTmJkNyBPLU8tTyBSZDggUnhkNyBSeGQ3IFJkMSBRZTYgQnhkNysgTnhkNyBRYjgrIE54YjggUmQ4Iw=="; "#QiBEdWtlIEthcmwgLyBDb3VudCBJc291YXJkCkQgMTg1OC4/Py4/PwpFIFBhcmlzClIgMS0wClMgUGFyaXMgRlJBClcgUGF1bCBNb3JwaHkKCmU0IGU1IE5mMyBkNiBkNCBCZzQgZHhlNSBCeGYzIFF4ZjMgZHhlNSBCYzQgTmY2IFFiMyBRZTcgTmMzIGM2IEJnNSBiNSBOeGI1IGN4YjUgQnhiNSsgTmJkNyBPLU8tTyBSZDggUnhkNyBSeGQ3IFJkMSBRZTYgQnhkNysgTnhkNyBRYjgrIE54YjggUmQ4Iw==";