Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Card designs

loadCardDesignfunction

A design by its name, loaded when it is first asked for: "english" fetches the English pattern (about 700 kB, 200 kB compressed) only then. "plain" and "four-colour" are drawn here and need no loading; they give null. A design the page registered under the name is given as it is.

Import it

import { loadCardDesign } from "@johnmorrisdotca/toranpu/card-faces";

Definition

function loadCardDesign(name: CardDesignName | string): Promise<CardDesign | null>

Parameters

NameTypeDescription
namestring

The registered card design or card-back name.

Returns

Promise<CardDesign | null>

A design by its name, loaded when it is first asked for: "english" fetches the English pattern (about 700 kB, 200 kB compressed) only then. "plain" and "four-colour" are drawn here and need no loading; they give null. A design the page registered under the name is given as it is.

Examples

import { loadCardDesign } from "@johnmorrisdotca/toranpu/card-faces";

console.log((await loadCardDesign("english"))?.name);
english

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.