![]() Please see the powerful chess.js library for this aspect of your application. This logic is distinct from the logic of the board. Please see the powerful chess.js library for an API to deal with these sorts of questions. Some examples of chessboard-element combined with chess.js: Example 5000, Example 5001, Example 5002 Problem domain and plays nicely with chessboard-element's flexible API. Specifically, chessboard-element does not understand anything about how the game of chess is played: how a knight moves, whose turn is it, is White in check?, etc.įortunately, the powerful chess.js library deals with exactly this sort of The scope of chessboard-element is limited to "just a board." This is intentional and makes chessboard-element flexible for handling a multitude of chess-related problems. Many thanks to Chris Oakman for chessboard.js. Supports arbitrary piece renderers and defaults to SVG pieces. ![]() New declarative attribute and property APIs play nice with declarative frameworks and template libraries like React and lit-html.Uses CSS transitions for all animations.Just one script tag required, all dependencies and styles are imported directly.All chessboard DOM is encapsulated in a shadow root.No need to use JavaScript for basic boards, just use the element.Relationship to chessboard.jsĬhessboard-element is a fork of of the wonderful chessboard.js library, repackaging it as a web component and updating the implementation to modern JavaScript and CSS. Build a chess server and have users play their games out using theĬhessboard-element is flexible enough to handle any of these situations with relative ease.Integrate chessboard-element and chess.js with a PGN database and allow people to search and playback games.Use to have a tactics website where users have to guess the best move.Use to show game positions alongside your expert commentary.Here's a non-exhaustive list of things you can do with chessboard-element: It is designed to be "just a board" and expose a powerful API so that it can be used in different ways. It defines a custom element that works anywhere HTML works - in plain HTML pages, JavaScript, or your framework of choice. Chessboard-element is a standalone chess board web component.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |