AbChess API for JavaScript provides the tools to build HTML playable chessboards with animated pieces. It also lets you import, play and export chessgames with the PGN notation.
-
Chessboard :
- customizable board and pieces
- playable pieces :
- with two-clicks
- with drag-and-drop
- animated pieces :
- for moves
- for wrong moves
- for captures
- for position changes
-
Chess logic :
- pieces basic movements
- pieces special rules :
- promotion
- en passant
- castling
- kings opposition
- check detection
- result detection :
- checkmate
- stalemate
- 50 moves rule
- insufficient material
-
Validation :
- FEN string
- PGN string
-
Game :
- input moves and get data
- parse a PGN string and display the game
Download the latest release and simply follow these steps :
Load the CSS file.
<link rel="stylesheet" href="AbChess-x.x.x.css">
Add a chessboard container.
<div id="chessboard"></div>
Load the JavaScript file.
<script src="AbChess-x.x.x.js"></script>
This script will display a chessboard with the default configuration.
var abChess = new AbChess("chessboard");
abChess.setFEN();
More informations are available on the GitHub pages :