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 · Live 3D in cards

createLiveCardsfunction

Make the live cards of a page. Nothing 3D is loaded until a card is first in focus (or a card with no picture of its own comes near the view and needs its still made).

Import it

import { createLiveCards } from "@johnmorrisdotca/fuda-cards/live-3d";

Definition

function createLiveCards<T extends ThreeLike = ThreeLike>(options: LiveCardsOptions<T>): LiveCards<T>

Parameters

NameTypeDescription
optionsLiveCardsOptions<T>

How to load three.js (load), and optionally the turn, the dwell and the look-ahead; see LiveCardsOptions.

Returns

LiveCards<T>

The live cards; call add for each card, and dispose when the page is done with them.

Examples

import { createLiveCards } from "@johnmorrisdotca/fuda-cards/live-3d";
import { PerspectiveCamera, Scene } from "three";

const live = createLiveCards({ load: () => import("three") });
const card = document.querySelector("fuda-card") as HTMLElement;
const remove = live.add(card, {
  key: "cube",
  build: () => ({ scene: new Scene(), camera: new PerspectiveCamera(40, 1, 0.1, 10) }),
});
remove();

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