Reference
Options, materials, stacks and wear
import { … } from "@johnmorrisdotca/fuda-cards";
Exports
| Name | Kind | What it is |
|---|---|---|
cardAttributes | function | 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. |
CardFinish | type | A card's finish: foil catches the light and shows a rainbow in its frame, matte does not. |
cardFinishes | constant | The two finishes, foil and matte. |
cardMaterial | function | The material with this id. |
CardMaterial | type | 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. |
CardMaterialGroup | type | The kind of stock a material is: plain paper card, plastic, a thick trading-card stock or metal. |
cardMaterials | constant | Every material the package knows, each with a thickness and the page it was read from. |
CardMaterialSource | type | Where a number was read: the maker's or the standard's page, and what it says there. |
CardOptions | type | Every setting of <fuda-card> as an object. |
CardVariant | type | A card's look: classic gold, silver sport or cosmic violet. |
cardVariants | constant | The three looks, in the order the studio offers them. |
CornerKind | type | How a corner is worn: sharp, softened, rounded, chipped or folded. |
DEFAULT_CARD_THICKNESS_MM | constant | 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). |
mmPerPoint | constant | 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. |
stackHeightMm | function | The height of a stack of cards, in millimetres: the count times the thickness of one, to a thousandth of a millimetre. |
stackLayout | function | 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. |
StackLayoutOptions | type | How a stack is laid out: how messy, from which seed and how many cards deep. |
StackPlace | type | 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. |
StackPreset | type | 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. |
stackPresets | constant | The usual sizes of a stack of cards, each with where the number comes from. |
VERSION | constant | The version of this package, the same as package.json's (a test holds the two together). |
WearCorner | type | One corner of a worn card: how it is worn and how far the damage reaches. |
WearFeatures | type | Every mark of a worn card: its corners, its centring, and the creases, scratches, specks and stain of each face. |
wearLayout | function | Where every mark of a card lies. |
wearLevels | function | 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. |
WearLevels | type | How much of each kind of wear, from 0 (none) to 1 (the worst the preset names). |
WearOptions | type | What a card asks of its wear: a grade or a number, a seed, and any level on its own. |
wearOutline | function | The outline of a face as an SVG path in the 250 by 350 box, corners as worn. |
wearOverlaySvg | function | The SVG laid over one face: whitening, folds, creases, scratches, specks, stain and toning. |
wearPreset | function | The grade with this id. |
WearPreset | type | A grading term with the levels it stands for and what it means in a few words. |
wearPresets | constant | The seven grades, from perfect to damaged. |