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 · Realistic faces

REALISTICconstant

The realistic design: Knoll's 39 cards in a box 167.0869141 by 242.6669922, and Fomin's English pattern for every other card.

Import it

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

Definition

const REALISTIC: CardDesign

Members

NameTypeDescription
namestring

The design's name, as cardFaceSvg and an element's design attribute take it.

boxreadonly [number, number]

The width and height each card is drawn in.

artReadonly<Record<string, string>>

Each card's drawing, by its id.

fallback (optional)CardDesign | undefined

Where the set has no drawing for a card, the set that draws it instead; then plain.

draw (optional)((card: string, context: { language: "en" | "ja"; }) => string | null) | undefined

Cards drawn by a function rather than from art: given a card's id and the language, the drawing (what goes inside an <svg> of box), or null where the set has no such card. Use it for a card whose words change with the language, or whose picture is worked out from its id, such as a territory card.

label (optional)((card: string, language: "en" | "ja") => string | null | undefined) | undefined

What a screen reader says for a card of the set, in the language asked for; null or nothing for a card the set leaves to its usual name (a standard card), or to its id (any other).

frame (optional)"paper" | "none" | undefined

How the card is framed. "paper" (unless said) draws the card's paper and edge under the art, as the standard cards have; "none" draws nothing under it, for art that fills the whole card and draws its own edge.

Examples

import { REALISTIC } from "@johnmorrisdotca/toranpu/card-faces/realistic";
console.log(REALISTIC.name);
realistic

What it prints (run when this page was built)

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