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 · Options, materials, stacks and wear

CardOptionstype

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 it

import type { CardOptions } from "@johnmorrisdotca/fuda-cards";

Definition

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;
}

Members

NameTypeDescription
title (optional)string | undefined
category (optional)string | undefined
subtitle (optional)string | undefined
description (optional)string | undefined
number (optional)string | undefined
rarity (optional)string | undefined
variant (optional)CardVariant | undefined
finish (optional)CardFinish | undefined
thickness (optional)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 (optional)string | undefined

A material's id (see cardMaterials): its sourced thickness and edge colour.

stack (optional)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 (optional)number | undefined

From 0 (squared up) to 1 (very messy) for the cards under the top one. Default 0.3.

stackSeed (optional)number | undefined

The stack's seed: the same seed lays the same stack the same way. Default 1.

stackDepth (optional)number | undefined

How many cards under the top one are laid out nudged and turned, at most 52. Default 10.

wear (optional)string | number | undefined

A card that is not perfect: a preset's id (mint, near-mint, lightly-played, moderately-played, heavily-played, damaged) or a number from 0 to 1. Default: perfect, nothing drawn.

wearSeed (optional)number | undefined

The wear's seed: the same seed draws the same marks the same way. Default 1.

wearCorners (optional)number | undefined

One level of the wear on its own, from 0 to 1, over the preset's.

wearEdges (optional)number | undefined
wearSurface (optional)number | undefined
wearCreases (optional)number | undefined
flipped (optional)boolean | undefined

The card shows its back.

motion (optional)"still" | "pan" | undefined
playing (optional)boolean | undefined

The picture is moving now (needs motion: "pan").

autoplay (optional)"focus" | undefined

focus: the card in focus animates its art (needs motion: 'pan'); never with reduced motion.

panDirection (optional)"down" | "up" | undefined
panLoop (optional)"alternate" | "restart" | undefined
cardSpin (optional)"center" | "corner" | undefined
cardSpinDirection (optional)"normal" | "reverse" | undefined
cardSpinPaused (optional)boolean | undefined
cardView (optional)boolean | undefined

The page turns the card with --fuda-yaw and --fuda-tilt instead of the built-in spin.

fan (optional)"open" | undefined

open: a stack of more than one card fans open.

takenOff (optional)number | undefined

How many cards are on the pile beside the stack.

deckLand (optional)"face-up" | "face-down" | undefined

How a card taken off lands: face-up or turned over (face-down).

animate (optional)"off" | "on" | undefined

off ends every move at once.

speed (optional)"normal" | "slow" | "quick" | undefined

How long a move takes: slow, normal or quick.

pileControls (optional)boolean | undefined

The three buttons under a stack: Fan, Take a card off and Put it back.

Examples

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); // sport
sport

What it prints (run when this page was built)

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