本文へ移動

Fuda Cards札

画像やライブ3Dを入れるコレクション用のカード枠です。本物の厚み、縁、箔、山、傷み、バインダーを、2つのWebコンポーネントで使えます。

「札(ふだ)」は、カードや札を指す日本語です。 名前について(英語)

目次

リファレンス · カードの中のライブ3D

LiveCardsOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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.

インポート

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

定義

interface LiveCardsOptions<T extends ThreeLike = ThreeLike> extends Omit<SharedRendererOptions<T>, "scheduler" | "assets" | "clock" | "document"> {
    turnSeconds?: number;
    dwellMs?: number;
    lookAheadPx?: number;
}

メンバー

名前型説明
turnSeconds (省略可)number | undefined

Seconds for one turn of the card in focus (12). 0 does not turn it.

dwellMs (省略可)number | undefined

How long the pointer has to rest on a card before it goes live, in milliseconds (150), so moving the pointer across a page of cards starts nothing. A press or the keyboard does not wait.

lookAheadPx (省略可)number | undefined

How far outside the view a card with no picture of its own gets its still made, in pixels (300).

load() => Promise<T>

() => import("three"): where three is loaded from, once, when a view first goes live or a still is first made.

maxPixels (省略可)number | undefined
maxSide (省略可)number | undefined
maxRatio (省略可)number | undefined
stillSize (省略可)number | undefined

Longest side of a still, in pixels (320).

stillBytes (省略可)number | undefined

Decoded bytes the stills may hold (32 MB).

lingerMs (省略可)number | undefined

Milliseconds an unused shared asset is kept (1000).

releaseMs (省略可)number | undefined

Milliseconds out of sight, in a hidden tab, after which the context is let go and the views show stills (30000). It comes back when the view does.

antialias (省略可)boolean | undefined
onContext (省略可)((state: "lost" | "restored" | "unavailable") => void) | undefined

Called when the context is lost or restored, or WebGL is not available.

例

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

const options: LiveCardsOptions = { load: () => import("three"), turnSeconds: 20, dwellMs: 250 };
console.log(options.turnSeconds);

ソースを見るGitHub で編集@johnmorrisdotca/fuda-cards 0.11.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。