Template:Cards
通常の52枚のトランプのカード:
基本
ランク
52枚のデッキ
通常の52枚のトランプのカード:
{{Cards|A}},{{Cards|K}},{{Cards|Q}},{{Cards|J}}= , , ,{{Cards|10}}or{{Cards|T}}={{Cards|9}}-{{Cards|2}}= -
56枚のデッキ
56枚のトランプのカード:
{{Cards|kn}}または{{Cards|n}}= (標準の56枚のトランプのナイト){{Cards|1}}= (標準の56枚のトランプ){{Cards|11}}= (標準的でない56枚のトランプ)
ジョーカー
{{Cards|Jkr}}=
「r」で赤いジョーカー、「b」で黒いジョーカー:
パラメータ「rank_name」および「suit_name」で指定することも可能(詳細は後述の「高度な使い方」を参照):
?
不明なランクを指定するためのシンボル:
カスタマイズされたカード
実は「カード」としてどんな文字列でも指定することが可能である。例: {{Cards|Cd}} = , {{Cards|Vs}} = , {{Cards|€h}} = , {{Cards|勾c}} =
「s・h・d・c・r・b」(大小文字は区別しない)のいずれか、または「♠・♥・♦・♣」のいずれかで終わっている場合、その文字はスートを表すものとみなされる。「&」をエスケープ文字として使用することも可能である。例:
{{Cards|R&}} = , {{Cards|Joker&}} = , {{Cards|♥♥&}} =
文字列が「a・k・q・kn・j・jkr・x」のいずれかで始まっている場合、最初の文字は大文字化される。大文字化を防ぐには、<span></span>でくくること:{{Cards|<span>k</span>s}} =
スート
{{Cards|s}}または{{Cards|♠}}={{Cards|h}}または{{Cards|♥}}={{Cards|d}}または{{Cards|♦}}={{Cards|c}}または{{Cards|♣}}={{Cards|r}}={{Cards|b}}=
複合
{{Cards|Ac|Kd|Ts|2h}}または{{Cards|A♣|K♦|10♠|2♥}}=- ランクのみでスートがない:
{{Cards|A|K|T|2}}= - スートのシンボルのみ:
{{Cards|c|d|s|h}}or{{Cards|♣|♦|♠|♥}}=
その他の使い方
定義済みの文字列「a・k・q・kn・j・jkr・x」および「s・h・d・c・r・b」は大文字と小文字を区別しない。
基本的な、名前のない(カードの)数値パラメータは1から15までの範囲になければならない。
高度な使い方
全パラメータの説明
{{Cards
| <!-- first card's rank and/or suit,
as described above in the "Basic" section -->
| <!-- second card --><!--
... 15 max. -->
| separator =
| sortable = <!-- "yes" or anything else -->
| rankname = <!-- "full" or anything else -->
| suitname = <!-- "full" or "letter" or anything else -->
| hand_style =
| spades_color =
| hearts_color =
| diamonds_color =
| clubs_color =
| card_style = <!--
| use_image = -->
}}
|
|
|
|
どのパラメータも必須ではない。
separator: カードとカードを分離する文字列。デフォルトは ノーブレークスペース ( )sortable: 「yes」またはそれ以外を指定するyes: ランクとスートの順位をソートできるように隠れたキーを設定する。カードは高い方から順に: Jkr, A, K, Q, Kn, J, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 それ以外の順序に並ぶ。スートは高い方から順に: ♠, ♥, ♦, ♣, red, black, スートなしの順序に並ぶ。注意:この機能は最初のカードのランク、2枚目のランク……を見るだけなので、ひとつのテンプレートが2枚以上のカードを含むときはカードの実際の価値を反映しない可能性があることに- それ以外(空パラメタまたはパラメタを指定しない場合を含む):デフォルト、ソートキーを生成しない
rank_name: 「full」またはそれ以外を指定するfull: ランク名をフルネームで表示する: "Joker", "Ace", "King", "Queen", "Knight", "Jack", "11", "10", "9"……- それ以外(空パラメタまたはパラメタを指定しない場合を含む):デフォルト、通常の省略したランク名: "Jkr", "A", "K", "Q", "Kn", "J", "11", "10", "9"……
suit_name: 「full」・「letter」・それ以外full: スペースに続けてスートのフルネームを表示する: "", "", "", "", "", ""。スートのフルネームを使用した場合、ランクもフルネームにして、間をコンマかスペース(ノーブレークスペース「 」を使う必要がある)で区切るのが普通だろうが、そうするには以下のように書く:{{Cards|Ac|Kd|10s|2h|separator=, |rank_name=full|suit_name=full}}= , , ,letter: スート名をアルファベット1文字で記す: "", "", "", "", "", ""- それ以外(空パラメタまたはパラメタを指定しない場合を含む):デフォルト、普通のスート名: "", "", "", "", "", ""
hand_style: ポーカーハンド用の CSS スタイル<b style="" class="pokerhands"></b>spades_color,hearts_color,diamonds_color,clubs_color: 各スートのカード用の色(CSSの色、「#FFFFFF」あるいは「white」)。通常は黒と赤であるが、このパラメータを使うことによって、4色デックを実現できる:{{Cards|Ac|Kd|10s|2h|diamonds_color=blue|clubs_color=green}}=card_style: 各カード用のCSSスタイル<span style="" class="playingcards"></span>use_image: (未実装)カードをあらわす画像
HTML・クラス名・CSS
このテンプレートによって生成されるHTMLマークアップはマイクロフォーマットを含んでおり、 "pokerhands", "playingcards", "spades", "hearts", "diamonds", "clubs", "cardranks", "cardsuits" といったクラス名を含んでいるので、計算機による解析が可能になっている。
例えば、{{Cards|Ac|10♥|Knd|?|J|s}} は を生成し、そのHTMLマークアップは以下のようになる。
<!-- sortable hidden key, if needed, is inserted before <b /> and is like:
<span class="sortkey" style="display:none;">&140&10&100&30&115&20&000&00&110&00&105&40</span> -->
<b style="" class="pokerhands"><!-- value of 'hand_style', if exists, is added here inside 'style=""' -->
<span style="color:black;" class="playingcards clubs"><!-- 'black' will changed to 'clubs_color''s value if defined;
'card_style''s value, if exists, is added here inside 'style=""', and after the color value;
same things apply to below ones -->
<span class="cardranks">A</span><span class="cardsuits">♣</span>
</span> <!-- will be replaced by user defined 'separator' if there is one;
same thing applys to below ones -->
<span style="color:red;" class="playingcards hearts">
<span class="cardranks">10</span><span class="cardsuits">♥</span>
</span>
<span style="color:red;" class="playingcards diamonds">
<span class="cardranks">Kn</span><span class="cardsuits">♦</span>
</span>
<span style="" class="playingcards"><!-- 'card_style''s value, if exists, is added here inside 'style=""';
same thing applys to below one -->
<span class="cardranks">?</span>
</span>
<span style="" class="playingcards">
<span class="cardranks">J</span>
</span>
<span style="color:black;" class="playingcards spades">
<span class="cardsuits">♠</span>
</span>
</b>
トランプ用のテンプレートは標準的なスート色に合わせて自動的に赤・黒の色をつける。それ以外の色を使いたい場合には、以下のCSSをユーザースタイルシートに追加すること。
/* Standard four-color deck */
.diamonds { color: blue !important }
.clubs { color: green !important }
開発者用リンク
| このテンプレートの記述は複雑な構成となっています。編集後の結果が予想できないか、または変更にともなう影響を修正する用意ができていない場合は編集をお控えください。練習や実験はテンプレートのサンドボックス・サブページ、テストケース・サブページもしくはあなた自身の利用者スペースのページでお願いします。 |
関連項目
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.