本文へ移動

Toranpuトランプ

デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。

「トランプ」は、日本語で playing cards を指す言葉です。 名前について(英語)

目次

リファレンス · カードの裏面

cardBackSvg関数

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

A back as a whole SVG document, 100 by 140. name is one of CARD_BACKS (an unknown name draws the classic red); the options recolour it, put words in its middle, size it and name it.

Drawn into a page, a back takes its colours from the CSS custom properties --toranpu-back, --toranpu-back-ink and --toranpu-back-paper where they are set and no colour is given here; as an image, it keeps its own.

インポート

import { cardBackSvg } from "@johnmorrisdotca/toranpu/card-backs";

定義

function cardBackSvg(name?: CardBackName | string, given?: CardBackOptions): string

引数

名前型説明
name (省略可)string

The registered card design or card-back name.

given (省略可)CardBackOptions

Explicit card-back settings to override the defaults.

戻り値

string

A back as a whole SVG document, 100 by 140. name is one of CARD_BACKS (an unknown name draws the classic red); the options recolour it, put words in its middle, size it and name it. Drawn into a page, a back takes its colours from the CSS custom properties --toranpu-back, --toranpu-back-ink and --toranpu-back-paper where they are set and no colour is given here; as an image, it keeps its own.

例

import { cardBackSvg } from "@johnmorrisdotca/toranpu/card-backs";

console.log(cardBackSvg("classic-red", { width: 80 }).slice(0, 160));
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 140" width="80" height="112" aria-hidden="true" style="user-select:none;-webkit-user-select:none"><rect

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

ソースを見るGitHub で編集@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。

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