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

SpinOptionstype

How a card is spun.

Import it

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

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

Definition

type SpinOptions = {
    direction?: "clockwise" | "anticlockwise";
    turns?: number;
    ms?: number;
};

Members

NameTypeDescription
direction (optional)"clockwise" | "anticlockwise" | undefined

Which way it spins. Unless said, clockwise.

turns (optional)number | undefined

How many whole turns before it comes to rest where it lay. Unless said, 3; at most 20.

ms (optional)number | undefined

How long the spin takes, in milliseconds. Unless said, 700 and 420 a turn.

Examples

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

const value: SpinOptions = { direction: "clockwise", turns: 1, ms: 300 };
console.log(value.turns);
1

What it prints (run when this page was built)

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