This commit is contained in:
Maciej Caderek
2022-01-30 15:15:47 +01:00
parent 3023329586
commit 6ca3836586
12 changed files with 250 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
import { BoardConfig, PiecesStyle } from "./../types";
import { Material, MoveWithPly } from "./../game/Game";
import { Material, MoveWithDetails } from "../game/Game_x";
import { Style, BoardData } from "../types";
import drawRectangle from "./layers/drawRectangle";
import drawCoords from "./layers/drawCoords";
@@ -41,7 +41,7 @@ class Board {
private ctx: CanvasRenderingContext2D;
private tempCtx: CanvasRenderingContext2D;
private borderVisible: boolean = true;
private lastMove: MoveWithPly | null = null;
private lastMove: MoveWithDetails | null = null;
private lastMaterial: Material | undefined = undefined;
public canvas: HTMLCanvasElement = document.createElement("canvas");
private tempCanvas: HTMLCanvasElement = document.createElement("canvas");
@@ -174,7 +174,7 @@ class Board {
return this;
}
isCheck(move: MoveWithPly | null) {
isCheck(move: MoveWithDetails | null) {
if (!move) {
return false;
}
@@ -182,7 +182,7 @@ class Board {
return move.san.includes("+");
}
isMate(move: MoveWithPly | null) {
isMate(move: MoveWithDetails | null) {
if (!move) {
return false;
}
@@ -267,7 +267,7 @@ class Board {
async frame(
boardData: BoardData | null,
header: { [key: string]: string | undefined },
move: MoveWithPly | null = null,
move: MoveWithDetails | null = null,
material?: Material
) {
this.currentScreen = "move";

View File

@@ -1,4 +1,4 @@
import { Material } from "../../game/Game";
import { Material } from "../../game/Game_x";
import { Style } from "./../../types";
import drawText from "./drawText";

View File

@@ -41,5 +41,3 @@ const style: Style = {
};
export default style;
// background-image: linear-gradient( 68.3deg, rgba(245,177,97,1) 0.4%, rgba(236,54,110,1) 100.2% );

View File

@@ -1,3 +1,4 @@
import chesscom from "./mono/chesscom";
import lichess from "./mono/lichess";
import lila from "./mono/lila";
import peach from "./mono/peach";
@@ -15,6 +16,7 @@ import rainbowLight from "./gradient/rainbow-light";
import kittens from "./pic/kittens";
export default {
chesscom,
lichess,
lila,
peach,

View File

@@ -0,0 +1,41 @@
import { Style } from "../../../types";
const style: Style = {
name: "Chessc*m",
category: "mono",
background: {
type: "solid",
data: {
color: "transparent",
},
},
dark: {
type: "solid",
data: {
color: "#769656",
},
},
light: {
type: "solid",
data: {
color: "#eeeed2",
},
},
moveIndicator: {
type: "color",
data: "#ffff007f",
},
border: {
type: "solid",
data: {
color: "#40522f",
},
},
coords: {
onLight: "#40522f",
onDark: "#fcfce1",
onBorder: "#eeeed2",
},
};
export default style;