Skip to the content

Fuda Cards札

Collectible card frames for images and live 3D: a true thickness, an edge, foil, stacks, wear and a binder, as two web components.

Fuda is the Japanese word 札 for a card or a tag. About the name

Contents

Reference · Collections and piles: pure helpers

fanLayoutfunction

Where the cards of a fan lie: each card turns eleven degrees more than the one before, up to 110 degrees from the first to the last, centred on the pile.

Import it

import { fanLayout } from "@johnmorrisdotca/fuda-cards/collection";

Definition

function fanLayout(count: number, seed?: number, step?: number): FanPlace[]

Parameters

NameTypeDescription
countnumber

How many cards; none gives an empty fan.

seed (optional)number

The seed that nudges the squared-up deck the fan closes to. Unless said, 1.

step (optional)number

How far apart neighbouring cards lie across, in card widths; the angle does the rest of the spreading. A phone uses a smaller one. Unless said, 0.34.

Returns

FanPlace[]

The places of the cards, first card first.

Examples

import { fanLayout } from "@johnmorrisdotca/fuda-cards/collection";

console.log(fanLayout(3).map((place) => place.angle)); // [ -11, 0, 11 ]
[ -11, 0, 11 ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/fuda-cards 0.11.0.