cardFaceUrlfunction
A card's face as a data URL, for an <img src>, a CSS background or a canvas. null for anything that is not a card.
Import it
import { cardFaceUrl } from "@johnmorrisdotca/toranpu/card-faces";
Definition
function cardFaceUrl(card: string, options?: CardFaceOptions): string | null
Parameters
| Name | Type | Description |
|---|---|---|
card | string | The physical card or card id to read, draw or play. |
options (optional) | CardFaceOptions | Options for this call; omitted fields retain their documented defaults. |
Returns
string | null
A card's face as a data URL, for an <img src>, a CSS background or a canvas. null for anything that is not a card.
Examples
import { cardFaceUrl } from "@johnmorrisdotca/toranpu/card-faces";
console.log(cardFaceUrl("KH")?.slice(0, 40));data:image/svg+xml;charset=utf-8,%3Csvg%What it prints (run when this page was built)