Reference · SVG faces and looks
tileSvgfunction
One tile on its own, as a whole <svg>: a solid block, the face on its ivory over a back plate whose thickness shows
on two sides, named for a screen reader. Its width and height are the caller's, through CSS; the picture keeps its
box (TILE_BOX). With flat, the old look (a sliver of its side in 32 by 42), and with bare the face alone in
30 by 40. Null for a letter that is no face.
Import it
import { tileSvg } from "@johnmorrisdotca/jarajara/faces";
Definition
function tileSvg(code: string, options?: TileSvgOptions): string | null
Parameters
| Name | Type | Description |
|---|---|---|
code | string | The one-character face code or tile identifier. |
options (optional) | TileSvgOptions | Native game, SVG, sound or presentation options. |
Returns
string | null
A complete SVG tile string, or null for an unknown face code.
Examples
import { tileSvg } from "@johnmorrisdotca/jarajara/faces";
console.log(tileSvg("a",{title:"One of characters"})?.startsWith("<svg"));trueWhat it prints (run when this page was built)