chessfield
v1.9.1
Published
A TypeScript+ThreeJS library to render a 3D chessboard
Downloads
1,122
Maintainers
Readme
Chessfield
Chessfield is a free/libre open source chess 3D board.
This project is made possible thanks to the work going into https://github.com/lichess-org/chessground.
License
Chessfield is distributed under the GPL-3.0 license (or any later version, at your option). When you use Chessfield for your website, your combined work may be distributed only under the GPL. You must release your source code to the users of your website.
Please read more about GPL for JavaScript on greendrake.info.
Demos
Features
Chessfield is designed to be a 3d chess viewer.
- Common configuration options with Chessground
- Royalty free wooden chess set by 3D Artist: Ali Qolami
- Well typed with TypeScript
- WebGL powered by Three.js
- Zoom and rotate around the board to see games in a any angle
- Display FEN and highlight squares of the last move
Installation
npm install --save chessfield
Usage
import { Chessfield } from 'chessfield';
// Add and use a custom theme
const config = {
plugins: {
themes: {
mytheme: {
light: '#e3dbc9',
dark: '#cb4444',
highlight: '#c99a39',
selected: 'orange',
},
},
},
theme: 'mytheme',
camera: 'white',
angle: 'right',
};
const field = Chessfield(document.body, config);
Documentation
Development
Install build dependencies:
pnpm install
To build the node module:
pnpm run dev
To build the standalone:
pnpm run dist