Skip to the content

Fuda Cards documentation

Fuda Cards API: every export

Every export of every entry point, each with its own page. This page keeps the addresses the old one-page reference had.

@johnmorrisdotca/fuda-cards/element

FudaCardclass

<fuda-card>: a collectible card frame around a picture you give it (or a live 3D view), drawn with a true thickness, an edge, a back, foil or matte, a stack, wear and the three looks.

@johnmorrisdotca/fuda-cards/element/define

@johnmorrisdotca/fuda-cards/live-3d

AddOptionstype

What a card brings when it is added: the picture it already has.

LiveCardstype

The live cards of a page: add a card, put one in focus, let go.

LiveCardsOptionstype

How the live cards behave: the shared renderer's options (kazoku-ui's), and how long a turn takes, how long the pointer rests before a card goes live and how far ahead a still is made.

LiveItemtype

What a card shows in 3D: a key (items with the same key share their pictures) and a scene made from shared assets (assets.acquire).

LiveScenetype

A scene for a card: kazoku-ui's scene, with object, the thing that turns about its upright axis while the card is in focus.

@johnmorrisdotca/fuda-cards/collection

CollectionCardtype

One item of a collection: an id, a name, the front's picture, optionally the back's, its kind and its metadata.

CollectionMetadatatype

What a collector writes about a card: its set, year, number, edition, condition, grade, quantity and notes.

CollectionViewtype

The name of a display of <fuda-collection>: the view attribute's values.

collectionViewAliasesconstant

Display names that earlier versions accepted and that now open another display, so a page that sets them keeps working.

collectionViewsconstant

The ten displays, in the order the buttons show them, each with the label on its button.

DeckLandingtype

How a card taken off a pile lands on the pile at its side: still facing up, or turned over sideways (as a person turns a card, like a page) to show its back.

deckLandingsconstant

The two ways a card can land, with the label on each button: face-up (still facing up) and face-down (turned over sideways on the way).

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.

FanPlacetype

Where one card of a fan lies, first card on the left when open and on top when closed.

isCardfunction

Whether an item is a card: anything that does not say it is an object.

movePagefunction

The first card of the page that is delta pages away, wrapping round at either end.

normalizeLandingfunction

The landing a value means: face-down (also upside-down and turned-over) is turned over; anything else is still facing up.

parseCollectionfunction

Check a collection and make it the shape the element draws: an array of cards, or an object with a cards array.

randomDrawIndexfunction

Choose a card whose name contains the filter, avoiding the current card when another match exists.

@johnmorrisdotca/fuda-cards/collection-element

CollectionLivetype

Live 3D in a collection's cards: the shared cards from createLiveCards and the 3D item of a card, if it has one.

FudaCollectionclass

<fuda-collection>: a whole collection in one of ten displays (a deck, a rolodex, binder pages, a display case, a random draw, a story scroll, a gallery wall, a spotlight, a card table, a fan), with zoom, Fit and Centre, the choices kept in the page address and a card detail on a press.

@johnmorrisdotca/fuda-cards

cardAttributesfunction

The attributes of a <fuda-card> for these options, ready to set one by one (element.setAttribute(name, value)): names are the kebab-case of the option's, a true boolean is the empty string (the attribute is present) and a false one, like anything that is undefined or null, is left out.

CardFinishtype

A card's finish: foil catches the light and shows a rainbow in its frame, matte does not.

CardMaterialtype

A card material: a stock or a metal with a thickness read from a maker or a standard, and the colour its edge is drawn in.

CardMaterialGrouptype

The kind of stock a material is: plain paper card, plastic, a thick trading-card stock or metal.

cardMaterialsconstant

Every material the package knows, each with a thickness and the page it was read from.

CardMaterialSourcetype

Where a number was read: the maker's or the standard's page, and what it says there.

CardOptionstype

Every setting of <fuda-card> as an object.

CardVarianttype

A card's look: classic gold, silver sport or cosmic violet.

cardVariantsconstant

The three looks, in the order the studio offers them.

CornerKindtype

How a corner is worn: sharp, softened, rounded, chipped or folded.

DEFAULT_CARD_THICKNESS_MMconstant

The thickness of a card that names no material or thickness: a playing card's black-core stock, 13 pt, 0.325 mm (Qin Printing, Black Core Paper 310 gsm, 0.325 mm).

mmPerPointconstant

One thousandth of an inch ("pt" in card and paper trade talk) in millimetres, 0.0254: a 13 pt card is 13 × 0.0254 mm.

stackHeightMmfunction

The height of a stack of cards, in millimetres: the count times the thickness of one, to a thousandth of a millimetre.

stackLayoutfunction

Where the cards of a stack lie, from neat to messy, the same every time for the same seed: the cards under the top one, bottom first, at most depth of them, as the top card is the live one and lies square.

StackLayoutOptionstype

How a stack is laid out: how messy, from which seed and how many cards deep.

StackPlacetype

Where one card of a stack lies, as the stack's layout says: how far it is nudged across and down, in card widths, and how far it is turned.

StackPresettype

A count of cards for a stack, with where the number comes from: a deck of 52, a Pokémon deck of 60, a booster pack of about 10.

stackPresetsconstant

The usual sizes of a stack of cards, each with where the number comes from.

VERSIONconstant

The version of this package, the same as package.json's (a test holds the two together).

WearCornertype

One corner of a worn card: how it is worn and how far the damage reaches.

WearFeaturestype

Every mark of a worn card: its corners, its centring, and the creases, scratches, specks and stain of each face.

wearLayoutfunction

Where every mark of a card lies.

wearLevelsfunction

The levels a card's wear asks for: the grade's or the number's, with any level named on its own laid over them.

WearLevelstype

How much of each kind of wear, from 0 (none) to 1 (the worst the preset names).

WearOptionstype

What a card asks of its wear: a grade or a number, a seed, and any level on its own.

wearOutlinefunction

The outline of a face as an SVG path in the 250 by 350 box, corners as worn.

wearOverlaySvgfunction

The SVG laid over one face: whitening, folds, creases, scratches, specks, stain and toning.

WearPresettype

A grading term with the levels it stands for and what it means in a few words.

wearPresetsconstant

The seven grades, from perfect to damaged.