本文へ移動

Fuda Cards札

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

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

目次

リファレンス · 設定、素材、山、傷み

cardAttributes関数

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

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 { cardAttributes } from "@johnmorrisdotca/fuda-cards";

定義

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

引数

名前型説明
optionsCardOptions

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

戻り値

Record<string, string>

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

例

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: '' }

出力(このページを作ったときに実行した結果)

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

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