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 · Cards, hands and piles

HandLayoutOptionstype

How a hand is laid out.

Import it

import type { HandLayoutOptions } from "@johnmorrisdotca/toranpu/element";

Also exported from: @johnmorrisdotca/toranpu/element/define

Definition

type HandLayoutOptions = {
    open?: number;
    step?: number;
    turn?: number;
    peek?: number;
};

Members

NameTypeDescription
open (optional)number | undefined

How far open, from 0 (squared up: only the top card shows) to 1 (a clear fan). Unless said, 1.

step (optional)number | undefined

How far apart neighbours lie when the hand is open, in card widths. Unless said, 0.42.

turn (optional)number | undefined

How far the cards turn across the whole fan when it is open, in degrees. Unless said, 4 a card, at most 40.

peek (optional)number | undefined

How much of each card under the top one still shows when the hand is squared up, in card widths. Unless said, 0.04.

Examples

import type { HandLayoutOptions } from "@johnmorrisdotca/toranpu/element";

const value: HandLayoutOptions = { open: 1, step: 30 };
console.log(value.open);
1

What it prints (run when this page was built)

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