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

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. Numbers are written as plain text.

Import it

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

Definition

function cardAttributes(options: CardOptions): Record<string, string>

Parameters

NameTypeDescription
optionsCardOptions

The settings of the card, by their camel-case names.

Returns

Record<string, string>

The attributes by name; set each with element.setAttribute(name, value). Nothing is shared with options.

Examples

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

console.log(cardAttributes({ title: "Explorer One", stackMessiness: 0.5, flipped: true, wear: undefined }));
// { title: 'Explorer One', 'stack-messiness': '0.5', flipped: '' }
{ title: 'Explorer One', 'stack-messiness': '0.5', flipped: '' }

What it prints (run when this page was built)

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