Hacker News new | ask | show | jobs
by spankalee 2362 days ago
If anyone's interested in a super-easy way to embed an interactive chessboard on their own page, I very recently made a <chess-board> web component, forked from chessboard.js: https://justinfagnani.github.io/chessboard-element/

You can put a board on a page with one tag:

    <chess-board></chess-board>
And set it up via attributes:

    <chess-board
        draggable-pieces
        position="8/R7/8/8/k1K5/8/8/8">
    </chess-board>
The element also has methods to make animated moves, set position, clear the board, etc.

I still have a few touch-interaction bugs to fix, so I haven't submitted it to HN myself yet. I hope it's useful to someone!