Reference · Browser table and SVG
mountTenkafunction
A WHOLE TABLE OF TENKA IN PLAIN DOM: the map, whose turn it is and what to
do, the players, your cards and the last dice, played against the
computer (or by people taking turns on one device, with computers all
false). No framework and no server; everything is in the element given.
Tap your own territory to place an army; to attack or move, tap where from, then where to, and choose from the buttons under the map. Under the players is the record of the game, which saves as JSON, text or CSV and loads a saved game back.
Import it
import { mountTenka } from "@johnmorrisdotca/tenka/ui";
Definition
function mountTenka(target: HTMLElement, options?: TenkaTableOptions): TenkaTableHandle
Parameters
| Name | Type | Description |
|---|---|---|
target | HTMLElement | The host element, including a host in a shadow root. |
options (optional) | TenkaTableOptions | Native game and presentation settings. |
Returns
TenkaTableHandle
The table handle; destroy it when the host is removed.
Examples
import { mountTenka } from "@johnmorrisdotca/tenka/ui";
const show = (host: HTMLElement) => mountTenka(host, { seed: 7, record: false });
console.log(typeof show);functionWhat it prints (run when this page was built)