This is a documentation for Board Game Arena: play board games online !

Template:Card: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
(borderThickness)
m (padding shorthand, simplification & formatting)
Line 1: Line 1:
<span style="background:{{{background|#fafafa}}};box-shadow:0.05rem 0.05rem 0.1rem 0.1rem rgba(0,0,0,0.2),inset 0 0 0 {{{borderThickness|0.1}}}rem {{{borderColour|#fff0}}};border-radius:0.2rem;padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.15rem;padding-right:0.15rem;line-height:calc({{{size|1}}}rem + 0.7rem);color:{{{colour|#000}}};text-shadow:0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}};font-size:{{{size|1}}}rem;white-space: nowrap">{{{|&nbsp;&nbsp;&nbsp;}}}</span><noinclude>
<span title="{{{alt|card}}}" style="background:{{{background|#fafafa}}};box-shadow:0.05rem 0.05rem 0.1rem 0.1rem rgba(0,0,0,0.2),inset 0 0 0 {{{borderThickness|0.1}}}rem {{{borderColour|#fff0}}};border-radius:0.2rem;padding:0.25rem 0.15rem;line-height:calc({{{size|1}}}rem + 0.7rem);color:{{{colour|#000}}};text-shadow:0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}},0 0 calc({{{size|1}}}rem / 20) {{{outlineColour|#fff0}}};font-size:{{{size|1}}}rem;white-space:nowrap">{{{|&nbsp;&nbsp;&nbsp;}}}</span><noinclude>


{|class="wikitable" style="text-align:center;"
{|class="wikitable" style="text-align:center;"
|+Playing card template examples for a BGA wiki page
|+Card template examples
!Type
!Type
|<code><nowiki>{{club}}</nowiki></code>
|<code><nowiki>{{club}}</nowiki></code>
Line 11: Line 11:
|<code><nowiki>{{card|=A}}</nowiki></code>
|<code><nowiki>{{card|=A}}</nowiki></code>
|<code><nowiki>{{club|=A}}</nowiki></code>
|<code><nowiki>{{club|=A}}</nowiki></code>
|<code><nowiki>{{club|=A|colour=green}}</nowiki></code>
|-
|-
!Result
!Result
Line 21: Line 20:
|{{card|=A}}
|{{card|=A}}
|{{club|=A}}
|{{club|=A}}
|{{club|=A|colour=green}}
|}
|}


'''Note:''' Game Help pages (e.g. '[[Gamehelpmachiavelli|GameHelpMachiavelli]]') display on Rules Summary pages
== Available parameters ==
e.g. https://boardgamearena.com/gamepanel?game=machiavelli under HOW TO PLAY? > See More > RULES SUMMARY
<div style="display:grid;grid-template-columns:repeat(4,min-content) auto;gap:0.5rem;overflow:auto;text-overflow:ellipsis;">
 
  <div style="font-weight:bold;width:8rem;">Parameter</div>
{|class="wikitable" style="text-align:left;"
  <div style="font-weight:bold;width:8rem;">Default value</div>
|+Available parameters
  <div style="font-weight:bold;width:8rem;">Example</div>
!Parameter
  <div style="font-weight:bold;width:8rem;text-align:center;">Result</div>
!Default value
  <div style="font-weight:bold;width:8rem;">Description</div>
!Example
  <div><code style="color:#b00;">null</code></div>
!Result
  <div><code><nowiki>&amp;nbsp;</nowiki></code>
!Description
<code><nowiki>&amp;nbsp;</nowiki></code>
|-
<code><nowiki>&amp;nbsp;</nowiki></code>
|<code style="color:#b00;">null</code>
(3 white spaces)</div>
|<code><nowiki>&amp;nbsp;&amp;nbsp;&amp;nbsp;</nowiki></code>
  <div><code><nowiki>{{card|=A}}</nowiki></code></div>
|<code><nowiki>{{card|=A}}</nowiki></code>
  <div style="text-align:center;">{{card|=A}}</div>
|style="text-align:center;"|{{card|=A}}
  <div>'''''Required:''''' specify a card value e.g. <code>A</code> for Ace.</div>
|<b><i>Optional:</i></b> specify a card value e.g. <code>A</code> for Ace.
  <div><code>size</code></div>
|-
  <div><code>1</code></div>
|<code>size</code>
  <div><code><nowiki>{{card|=A</nowiki></code>
|<code>1</code>
<code><nowiki>|size=1.5}}</nowiki></code></div>
|<code><nowiki>{{card|=A|size=1.5}}</nowiki></code>
  <div style="text-align:center;">{{card|=A|size=1.5}}</div>
|style="text-align:center;"|{{card|=A|size=1.5}}
  <div>'''''Optional:''''' specify the text size in rem units.</div>
|<b><i>Optional:</i></b> specify the text size in rem units.
  <div><code>colour</code></div>
|-
  <div><code>#000</code>
|<code>colour</code>
(black)</div>
|<code>#000</code> (black)
  <div><code><nowiki>{{card|=A</nowiki></code>
|<code><nowiki>{{card|=A|colour=green}}</nowiki></code>
<code><nowiki>|colour=green}}</nowiki></code></div>
|style="text-align:center;"|{{card|=A|colour=green}}
  <div style="text-align:center;">{{card|=A|colour=green}}</div>
|<b><i>Optional:</i></b> specify the text colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].
  <div>'''''Optional:''''' specify the text colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].</div>
|-
  <div><code>outlineColour</code></div>
|<code>outlineColour</code>
  <div><code>#fff0</code>
|<code>#fff0</code> (transparent white)
(transparent)</div>
|<code><nowiki>{{card|=A|colour=white|outlineColour=green}}</nowiki></code>
  <div><code><nowiki>{{card|=A|colour=white</nowiki></code>
|style="text-align:center;"|{{card|=A|colour=white|outlineColour=green}}
<code><nowiki>|outlineColour=green}}</nowiki></code></div>
|<b><i>Optional:</i></b> specify the text outline colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].
  <div style="text-align:center;">{{card|=A|colour=white|outlineColour=green}}</div>
|-
  <div>'''''Optional:''''' specify the text outline colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].</div>
|<code>background</code>
  <div><code>background</code></div>
|<code>#fafafa</code> (almost white)
  <div><code>#fafafa</code>
|<code><nowiki>{{card|=A|colour=white|background=green}}</nowiki></code>
(almost&nbsp;white)</div>
|style="text-align:center;"|{{card|=A|colour=white|background=green}}
  <div><code><nowiki>{{card|=A|colour=white</nowiki></code>
|<b><i>Optional:</i></b> specify the background colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].
<code><nowiki>|background=green}}</nowiki></code></div>
|-
  <div style="text-align:center;">{{card|=A|colour=white|background=green}}</div>
|<code>borderColour</code>
  <div>'''''Optional:''''' specify the background colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].</div>
|<code>#fff0</code> (transparent white)
  <div><code>borderColour</code></div>
|<code><nowiki>{{card|borderColour=green}}</nowiki></code>
  <div><code>#fff0</code>
|style="text-align:center;"|{{card|borderColour=green}}
(transparent)</div>
|<b><i>Optional:</i></b> specify the border colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].
  <div><code><nowiki>{{card</nowiki></code>
|-
<code><nowiki>|borderColour=green}}</nowiki></code></div>
|<code>borderThickness</code>
  <div style="text-align:center;">{{card|borderColour=green}}</div>
|<code>0.1</code>
  <div>'''''Optional:''''' specify the border colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].</div>
|<code><nowiki>{{card|borderColour=green|borderThickness=0.2}}</nowiki></code>
  <div><code>borderThickness</code></div>
|style="text-align:center;"|{{card|borderColour=green|borderThickness=0.2}}
  <div><code>0.1</code></div>
|<b><i>Optional:</i></b> specify the border thickness in rem units.
  <div><code><nowiki>{{card|borderColour=green</nowiki></code>
|}
<code><nowiki>|borderThickness=0.2}}</nowiki></code></div>
  <div style="text-align:center;">{{card|borderColour=green|borderThickness=0.2}}</div>
  <div>'''''Optional:''''' specify the text size in rem units.</div>
</div>


== Examples ==
== Examples ==


=== Machiavelli ===
=== [[Gamehelpmachiavelli|Machiavelli]] ===


* The table has the set {{spade|=5}}{{diamond|=5|colour=blue}}{{heart|=5}} .
* A player may play a combination, such as {{spade|=6}}{{diamond|=6|colour=blue}}{{heart|=6}} or {{spade|=6}}{{spade|=7}}{{spade|=8}}, or may extend the existing set by playing {{club|=5|colour=green}} .
* A player may play a combination, such as {{spade|=6}}{{diamond|=6|colour=blue}}{{heart|=6}} or {{spade|=6}}{{spade|=7}}{{spade|=8}}, or may extend the existing set by playing {{club|=5|colour=green}} .
<pre>
<pre>
* The table has the set {{spade|=5}}{{diamond|=5|colour=blue}}{{heart|=5}} .
* A player may play a combination, such as {{spade|=6}}{{diamond|=6|colour=blue}}{{heart|=6}} or {{spade|=6}}{{spade|=7}}{{spade|=8}}, or may extend the existing set by playing {{club|=5|colour=green}} .
* A player may play a combination, such as {{spade|=6}}{{diamond|=6|colour=blue}}{{heart|=6}} or {{spade|=6}}{{spade|=7}}{{spade|=8}}, or may extend the existing set by playing {{club|=5|colour=green}} .
</pre>
</pre>


=== Palace ===
=== [[Gamehelppalace|Palace]] ===


{|class="wikitable" style="width:auto; text-align:center;"
{|class="wikitable" style="width:auto; text-align:center;"
Line 106: Line 105:
|{{diamond|=2}}
|{{diamond|=2}}
|style="text-align:left;"|Plays {{heart|=3}}{{club|=3}} .
|style="text-align:left;"|Plays {{heart|=3}}{{club|=3}} .
|-
|'''B'''
| -
|{{Diamond|=8}}{{club|=J}}{{Diamond|=Q}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{heart|=3}}
|style="text-align:left;"|Plays {{Diamond|=8}} from the table.
|}
|}


Line 131: Line 123:
|{{diamond|=2}}
|{{diamond|=2}}
|style="text-align:left;"|Plays {{heart|=3}}{{club|=3}} .
|style="text-align:left;"|Plays {{heart|=3}}{{club|=3}} .
|-
|'''B'''
| -
|{{Diamond|=8}}{{club|=J}}{{Diamond|=Q}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{heart|=3}}
|style="text-align:left;"|Plays {{Diamond|=8}} from the table.
|}
|}
</pre>
</pre>
=== Hanabi ===
{|class="wikitable" style="text-align:center;"
|+Playing card template examples for a BGA wiki page
!Type
|<code><nowiki>{{HCardr}}</nowiki></code>
|<code><nowiki>{{HCardy}}</nowiki></code>
|<code><nowiki>{{HCardg}}</nowiki></code>
|<code><nowiki>{{HCardb}}</nowiki></code>
|<code><nowiki>{{HCardw}}</nowiki></code>
|<code><nowiki>{{HCardm}}</nowiki></code>
|<code><nowiki>{{HCardk}}</nowiki></code>
|-
!Result
|{{HCardr}}
|{{HCardy}}
|{{HCardg}}
|{{HCardb}}
|{{HCardw}}
|{{HCardm}}
|{{HCardk}}
|}
{|class="wikitable" style="text-align:left;"
|+Available parameters
!Parameter
!Default value
!Example
!Result
!Description
|-
|<code style="color:#b00;">null</code>
|<code><nowiki>&amp;nbsp;&amp;nbsp;</nowiki></code>
|<code><nowiki>{{HCardr|=1}}</nowiki></code>
|style="text-align:center;"|{{HCardr|=1}}
|<b><i>Optional:</i></b> specify a card value e.g. <code>1</code>.
|-
|<code>size</code>
|<code>2</code>
|<code><nowiki>{{HCardr|=1|size=1.5}}</nowiki></code>
|style="text-align:center;"|{{HCardr|=1|size=1.5}}
|<b><i>Optional:</i></b> specify the text size in rem units.
|}


[[Category:Card templates]]
[[Category:Card templates]]
</noinclude>
</noinclude>

Revision as of 16:26, 17 December 2023

   

Card template examples
Type {{club}} {{spade}} {{heart}} {{diamond}} {{cardBack}} {{card|=A}} {{club|=A}}
Result                     A    

Available parameters

Parameter
Default value
Example
Result
Description
null
&nbsp;

&nbsp; &nbsp;

(3 white spaces)
{{card|=A}}
A
Required: specify a card value e.g. A for Ace.
size
1
{{card|=A |size=1.5}}
A
Optional: specify the text size in rem units.
colour
#000 (black)
{{card|=A |colour=green}}
A
Optional: specify the text colour as a CSS colour.
outlineColour
#fff0 (transparent)
{{card|=A|colour=white |outlineColour=green}}
A
Optional: specify the text outline colour as a CSS colour.
background
#fafafa (almost white)
{{card|=A|colour=white |background=green}}
A
Optional: specify the background colour as a CSS colour.
borderColour
#fff0 (transparent)
{{card |borderColour=green}}
   
Optional: specify the border colour as a CSS colour.
borderThickness
0.1
{{card|borderColour=green |borderThickness=0.2}}
   
Optional: specify the text size in rem units.

Examples

Machiavelli

  • A player may play a combination, such as           or          , or may extend the existing set by playing     .
* A player may play a combination, such as {{spade|=6}}{{diamond|=6|colour=blue}}{{heart|=6}} or {{spade|=6}}{{spade|=7}}{{spade|=8}}, or may extend the existing set by playing {{club|=5|colour=green}} .

Palace

The deck is already empty
Player In hand On table Stack top card Action
A       

      

         

         

    Plays        .
{|class="wikitable" style="width:auto; text-align:center;"
|+style="text-align:left;"|''The deck is already empty''
!Player
!In hand
!On table
!Stack top card
!style="text-align:left;"|Action
|-
|'''A'''
|{{heart|=3}}{{club|=3}}
{{spade|=4}}{{club|=4}}
|{{club|=7}}{{Diamond|=7}}{{spade|=7}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{diamond|=2}}
|style="text-align:left;"|Plays {{heart|=3}}{{club|=3}} .
|}