本文へ移動

Fuda Cards札

画像やライブ3Dを入れるコレクション用のカード枠です。本物の厚み、縁、箔、山、傷み、バインダーを、2つのWebコンポーネントで使えます。

「札(ふだ)」は、カードや札を指す日本語です。 名前について(英語)

目次

リファレンス · コレクションと山:計算部分

fanLayout関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { fanLayout } from "@johnmorrisdotca/fuda-cards/collection";

定義

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

引数

名前型説明
countnumber

How many cards; none gives an empty fan.

seed (省略可)number

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

step (省略可)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.

戻り値

FanPlace[]

The places of the cards, first card first.

例

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

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/fuda-cards 0.11.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。