CardOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Every setting of <fuda-card> as an object. cardAttributes(options) turns it into the element's attributes, so the same object
works in a framework, a script and a test.
インポート
import type { CardOptions } from "@johnmorrisdotca/fuda-cards";
定義
interface CardOptions {
title?: string;
category?: string;
subtitle?: string;
description?: string;
number?: string;
rarity?: string;
variant?: CardVariant;
finish?: CardFinish;
thickness?: number;
material?: string;
stack?: number;
stackMessiness?: number;
stackSeed?: number;
stackDepth?: number;
wear?: string | number;
wearSeed?: number;
wearCorners?: number;
wearEdges?: number;
wearSurface?: number;
wearCreases?: number;
flipped?: boolean;
motion?: "still" | "pan";
playing?: boolean;
autoplay?: "focus";
panDirection?: "down" | "up";
panLoop?: "alternate" | "restart";
cardSpin?: "center" | "corner";
cardSpinDirection?: "normal" | "reverse";
cardSpinPaused?: boolean;
cardView?: boolean;
fan?: "open";
takenOff?: number;
deckLand?: "face-up" | "face-down";
animate?: "on" | "off";
speed?: "slow" | "normal" | "quick";
pileControls?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
title (省略可) | string | undefined | |
category (省略可) | string | undefined | |
subtitle (省略可) | string | undefined | |
description (省略可) | string | undefined | |
number (省略可) | string | undefined | |
rarity (省略可) | string | undefined | |
variant (省略可) | CardVariant | undefined | |
finish (省略可) | CardFinish | undefined | |
thickness (省略可) | number | undefined | Card thickness in millimetres at the 63 mm wide card size; overrides the material's. Default 0.325, 0 for a flat card. |
material (省略可) | string | undefined | A material's id (see |
stack (省略可) | number | undefined | How many cards the stack holds (1 to 1000); the stack is that many times the card's thickness high. Default 1, one card. |
stackMessiness (省略可) | number | undefined | From 0 (squared up) to 1 (very messy) for the cards under the top one. Default 0.3. |
stackSeed (省略可) | number | undefined | The stack's seed: the same seed lays the same stack the same way. Default 1. |
stackDepth (省略可) | number | undefined | How many cards under the top one are laid out nudged and turned, at most 52. Default 10. |
wear (省略可) | string | number | undefined | A card that is not perfect: a preset's id ( |
wearSeed (省略可) | number | undefined | The wear's seed: the same seed draws the same marks the same way. Default 1. |
wearCorners (省略可) | number | undefined | One level of the wear on its own, from 0 to 1, over the preset's. |
wearEdges (省略可) | number | undefined | |
wearSurface (省略可) | number | undefined | |
wearCreases (省略可) | number | undefined | |
flipped (省略可) | boolean | undefined | The card shows its back. |
motion (省略可) | "still" | "pan" | undefined | |
playing (省略可) | boolean | undefined | The picture is moving now (needs |
autoplay (省略可) | "focus" | undefined |
|
panDirection (省略可) | "down" | "up" | undefined | |
panLoop (省略可) | "alternate" | "restart" | undefined | |
cardSpin (省略可) | "center" | "corner" | undefined | |
cardSpinDirection (省略可) | "normal" | "reverse" | undefined | |
cardSpinPaused (省略可) | boolean | undefined | |
cardView (省略可) | boolean | undefined | The page turns the card with |
fan (省略可) | "open" | undefined |
|
takenOff (省略可) | number | undefined | How many cards are on the pile beside the stack. |
deckLand (省略可) | "face-up" | "face-down" | undefined | How a card taken off lands: |
animate (省略可) | "off" | "on" | undefined |
|
speed (省略可) | "normal" | "slow" | "quick" | undefined | How long a move takes: |
pileControls (省略可) | boolean | undefined | The three buttons under a stack: Fan, Take a card off and Put it back. |
例
import { type CardOptions, cardAttributes } from "@johnmorrisdotca/fuda-cards";
const options: CardOptions = { title: "Explorer One", variant: "sport", stack: 10, wear: "near-mint" };
console.log(cardAttributes(options).variant); // sportsport出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。