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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。