Reference
SVG boards and notation
import { … } from "@johnmorrisdotca/sugoroku/draw";
5.2 kB minified and gzipped, with everything it imports (measured with esbuild)
Sugoroku's drawing: SVG text for a board with its checkers, dice and cube, the
style that makes it a board, and the colours it is made of. A separate entry
(@johnmorrisdotca/sugoroku/draw), so a server that only checks a game never
loads any of it.
Exports
| Name | Kind | What it is |
|---|---|---|
BoardLayout | class | The layout of a board, a function of its options: where each point, the bar, each tray, the rail and the dice sit, all in landscape units. |
BoardOptions | type | The cube, viewing side, home direction and orientation used to calculate board geometry. |
boardSize | function | The width and height the board is drawn in, which is the other way about when it stands up. |
Box | type | A box: where something is, in landscape units before any turning. |
colourProperty | function | The custom property a colour is set on. |
colourStyle | function | The inline custom properties of a drawing: the named board and checkers, then any colour given. |
drawSugoroku | function | The board as SVG text for position. |
MOST_DRAWN | constant | How many checkers are drawn on a stack before the last one carries the count. |
Orientation | type | Whether the board lies across the page or stands up in it. |
SUGOROKU_BOARD_NAMES | constant | The names of the boards. |
SUGOROKU_BOARDS | constant | The boards the drawing knows by name, set against any theme. |
SUGOROKU_CHECKER_SET_NAMES | constant | The names of the checker sets. |
SUGOROKU_CHECKER_SETS | constant | The checkers the drawing knows by name. |
SUGOROKU_COLOUR_NAMES | constant | The names of the colours, as the custom properties spell them (--sg- and the name in kebab case). |
SUGOROKU_STYLE | constant | THE STYLE a Sugoroku board is drawn with: colours as custom properties (--sg-felt, --sg-white and the rest of SugorokuColours), light by default and dark when the device is, and the one rule that matters for a game played with fingers and a mouse: nothing on the board can be selected, dragged or double-tapped. |
SugorokuBoardName | type | A named board, a set of colours for the board and its points. |
SugorokuCheckerSetName | type | A named pair of checker colours. |
SugorokuColours | type | THE COLOURS OF A BOARD. |
SugorokuDrawOptions | type | What to draw with. |