cm-chessboard

Example: Set different positions, with animation

Animations are queued automatically.


Not animated

Animated

<button onclick="window.board.setPosition('rn2k1r1/ppp1pp1p/3p2p1/5bn1/P7/2N2B2/1PPPPP2/2BNK1RR')">Position 3</button>

Move piece
board.movePiece(squareFrom, squareTo)

board.setPiece("e4", PIECE.wn)
await board.movePiece("e4", "c3")
await board.movePiece("c3", "d5")
await board.movePiece("d5", "f4")