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
m (borderColour)
(parameters)
 
(10 intermediate revisions by 2 users not shown)
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 0.{{{border|0}}}rem {{{borderColour|#fafafa}}};border-radius:0.2rem;padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.15rem;padding-right:0.15rem;line-height:1.7rem;color:{{{colour|#000}}};">{{{|&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 {{{borderColor|#fff0}}};border-radius:0.2rem;padding:0.25rem 0.15rem;line-height:calc({{{size|1}}}rem + 0.7rem);color:{{{color|#000}}};text-shadow:0 0 calc({{{size|1}}}rem/20) {{{outlineColor|#fff0}}},0 0 calc({{{size|1}}}rem/20) {{{outlineColor|#fff0}}},0 0 calc({{{size|1}}}rem/20) {{{outlineColor|#fff0}}},0 0 calc({{{size|1}}}rem/20) {{{outlineColor|#fff0}}},0 0 calc({{{size|1}}}rem/20) {{{outlineColor|#fff0}}},0 0 calc({{{size|1}}}rem/20) {{{outlineColor|#fff0}}};font-size:{{{size|1}}}rem;white-space:nowrap">{{{1|&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 9: Line 9:
|<code><nowiki>{{diamond}}</nowiki></code>
|<code><nowiki>{{diamond}}</nowiki></code>
|<code><nowiki>{{cardBack}}</nowiki></code>
|<code><nowiki>{{cardBack}}</nowiki></code>
|<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 19: Line 18:
|{{diamond}}
|{{diamond}}
|{{cardBack}}
|{{cardBack}}
|{{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>1</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>colour</code>
  <div><code><nowiki>{{card|A</nowiki></code>
|<code>#000</code> (black)
<code><nowiki>|size=1.5}}</nowiki></code></div>
|<code><nowiki>{{card|=A|colour=green}}</nowiki></code>
  <div style="text-align:center;">{{card|A|size=1.5}}</div>
|style="text-align:center;"|{{card|=A|colour=green}}
  <div>'''''Optional:''''' specify the text size in rem units.</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><code>color</code></div>
|-
  <div><code>#000</code>
|<code>background</code>
(black)</div>
|<code>#fafafa</code> (almost white)
  <div><code><nowiki>{{card|A</nowiki></code>
|<code><nowiki>{{card|=A|colour=white|background=green}}</nowiki></code>
<code><nowiki>|color=green}}</nowiki></code></div>
|style="text-align:center;"|{{card|=A|colour=white|background=green}}
  <div style="text-align:center;">{{card|A|color=green}}</div>
|<b><i>Optional:</i></b> specify the background colour as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS colour].
  <div>'''''Optional:''''' specify the text color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
|-
  <div><code>outlineColor</code></div>
|<code>border</code>
  <div><code>#fff0</code>
|<code>0</code>
(transparent)</div>
|<code><nowiki>{{card|=A|colour=white|background=green|border=1}}</nowiki></code>
  <div><code><nowiki>{{card|A|color=white</nowiki></code>
|style="text-align:center;"|{{card|=A|colour=white|background=green|border=1}}
<code><nowiki>|outlineColor=green}}</nowiki></code></div>
|<b><i>Optional:</i></b> specify the border width in ⅒ rem units.
  <div style="text-align:center;">{{card|A|color=white|outlineColor=green}}</div>
|-
  <div>'''''Optional:''''' specify the text outline color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
|<code>borderColour</code>
  <div><code>background</code></div>
|<code>#fafafa</code> (almost white)
  <div><code>#fafafa</code>
|<code><nowiki>{{card|=A|border=1|borderColour=green}}</nowiki></code>
(almost&nbsp;white)</div>
|style="text-align:center;"|{{card|=A|border=1|borderColour=green}}
  <div><code><nowiki>{{card|A|color=white</nowiki></code>
|<b><i>Optional:</i></b> specify the border 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|color=white|background=green}}</div>
  <div>'''''Optional:''''' specify the background color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
  <div><code>borderColor</code></div>
  <div><code>#fff0</code>
(transparent)</div>
  <div><code><nowiki>{{card</nowiki></code>
<code><nowiki>|borderColor=green}}</nowiki></code></div>
  <div style="text-align:center;">{{card|borderColor=green}}</div>
  <div>'''''Optional:''''' specify the border color as a [https://developer.mozilla.org/en-US/docs/Web/CSS/color CSS color].</div>
  <div><code>borderThickness</code></div>
  <div><code>0.1</code></div>
  <div><code><nowiki>{{card|borderColor=green</nowiki></code>
<code><nowiki>|borderThickness=0.2}}</nowiki></code></div>
  <div style="text-align:center;">{{card|borderColor=green|borderThickness=0.2}}</div>
  <div>'''''Optional:''''' specify the border thickness 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}} .
<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}} .
</pre>
----
{|class="wikitable" style="width:auto; text-align:center;"
!style="width:8rem;"|Table
!style="width:4rem;"|In hand
!style="width:8rem;"|Rearrange
!style="width:8rem;"|Add card
|-
|{{club|=5|colour=green}}{{diamond|=5|colour=blue}}{{heart|=5}}{{spade|=5}}
{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
|{{club|=4|colour=green}}
|{{diamond|=5|colour=blue}}{{heart|=5}}{{spade|=5}}
{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
|{{diamond|=5|colour=blue}}{{heart|=5}}{{spade|=5}}
{{club|=4|colour=green}}{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
|-
|{{club|=5|colour=green}}{{diamond|=5|colour=blue}}{{heart|=5}}
{{club|=6|colour=green}}{{diamond|=6|colour=blue}}{{heart|=6}}
 
{{club|=7|colour=green}}{{diamond|=7|colour=blue}}{{heart|=7}}
|{{club|=8|colour=green}}
|{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}
{{diamond|=5|colour=blue}}{{diamond|=6|colour=blue}}{{diamond|=7|colour=blue}}
 
{{heart|=5}}{{heart|=6}}{{heart|=7}}
|{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
{{diamond|=5|colour=blue}}{{diamond|=6|colour=blue}}{{diamond|=7|colour=blue}}


{{heart|=5}}{{heart|=6}}{{heart|=7}}
* A player may play a combination, such as {{spade|6}}{{diamond|6|color=blue}}{{heart|6}} or {{spade|6}}{{spade|7}}{{spade|8}}, or may extend the existing set by playing {{club|5|color=green}} .
|}
<pre>
<pre>
{|class="wikitable" style="width:auto; text-align:center;"
* A player may play a combination, such as {{spade|6}}{{diamond|6|color=blue}}{{heart|6}} or {{spade|6}}{{spade|7}}{{spade|8}}, or may extend the existing set by playing {{club|5|color=green}} .
!style="width:8rem;"|Table
!style="width:4rem;"|In hand
!style="width:8rem;"|Rearrange
!style="width:8rem;"|Add card
|-
|{{club|=5|colour=green}}{{diamond|=5|colour=blue}}{{heart|=5}}{{spade|=5}}
{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
|{{club|=4|colour=green}}
|{{diamond|=5|colour=blue}}{{heart|=5}}{{spade|=5}}
{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
|{{diamond|=5|colour=blue}}{{heart|=5}}{{spade|=5}}
{{club|=4|colour=green}}{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
|-
|{{club|=5}}{{diamond|=5|colour=blue}}{{heart|=5}}
{{club|=6}}{{diamond|=6|colour=blue}}{{heart|=6}}
 
{{club|=7|colour=green}}{{diamond|=7|colour=blue}}{{heart|=7}}
|{{club|=8|colour=green}}
|{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}
{{diamond|=5|colour=blue}}{{diamond|=6|colour=blue}}{{diamond|=7|colour=blue}}
 
{{heart|=5}}{{heart|=6}}{{heart|=7}}
|{{club|=5|colour=green}}{{club|=6|colour=green}}{{club|=7|colour=green}}{{club|=8|colour=green}}
{{diamond|=5|colour=blue}}{{diamond|=6|colour=blue}}{{diamond|=7|colour=blue}}
 
{{heart|=5}}{{heart|=6}}{{heart|=7}}
|}
</pre>
</pre>


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


{|class="wikitable" style="width:auto; text-align:center;"
{|class="wikitable" style="width:auto; text-align:center;"
Line 147: Line 99:
|-
|-
|'''A'''
|'''A'''
|{{heart|=3}}{{club|=3}}
|{{heart|3}}{{club|3}}
{{spade|=4}}{{club|=4}}
{{spade|4}}{{club|4}}
|{{club|=7}}{{Diamond|=7}}{{spade|=7}}
|{{club|7}}{{Diamond|7}}{{spade|7}}
{{cardBack}}{{cardBack}}{{cardBack}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{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.
|-
|rowspan="4"|'''C'''
|{{spade|=8}}{{heart|=8}}{{club|=8}}
{{heart|=6}}{{club|=6}}{{Diamond|=6}}{{spade|=6}}
|{{club|=10}}{{Diamond|=10}}{{spade|=10}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{Diamond|=8}}
|style="text-align:left;"|Plays {{spade|=8}}{{heart|=8}}{{club|=8}} .
This '''[[#Special_action_cards_and_plays|burns]]''' all the cards in the stack and grants an additional turn.
|-
|{{heart|=6}}{{club|=6}}{{Diamond|=6}}{{spade|=6}}
|{{club|=10}}{{Diamond|=10}}{{spade|=10}}
{{cardBack}}{{cardBack}}{{cardBack}}
| -
|style="text-align:left;"|Plays {{heart|=6}}{{club|=6}}{{Diamond|=6}}{{spade|=6}} .
This '''[[#Special_action_cards_and_plays|burns]]''' all the cards in the stack and grants ''another'' additional turn.
|-
| -
|{{club|=10}}{{Diamond|=10}}{{spade|=10}}
{{cardBack}}{{cardBack}}{{cardBack}}
| -
|style="text-align:left;"|Plays {{club|=10}}{{Diamond|=10}}{{spade|=10}} .
This '''[[#Special_action_cards_and_plays|burns]]''' the stack and grants ''yet another'' additional turn.
|-
| -
| -
{{club|=Q}}{{cardBack}}{{cardBack}}
| -
|style="text-align:left;"|Plays a face-down card, {{club|=Q}} .
|-
|'''D'''
|{{club|=9}}{{heart|=10}}
|{{club|=K}}{{Diamond|=K}}{{spade|=K}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{club|=Q}}
|style="text-align:left;"|Cannot play and picks up the stack.
''Luckily it's just the'' {{club|=Q}} .
|}
|}


<pre>
<pre style="background:none;border:none;">
{|class="wikitable" style="width:auto; text-align:center;"
{|class="wikitable" style="width:auto; text-align:center;"
|+style="text-align:left;"|''The deck is already empty''
|+style="text-align:left;"|''The deck is already empty''
Line 209: Line 117:
|-
|-
|'''A'''
|'''A'''
|{{heart|=3}}{{club|=3}}
|{{heart|3}}{{club|3}}
{{spade|=4}}{{club|=4}}
{{spade|4}}{{club|4}}
|{{club|=7}}{{Diamond|=7}}{{spade|=7}}
|{{club|7}}{{Diamond|7}}{{spade|7}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{diamond|=2}}
|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.
|-
|rowspan="4"|'''C'''
|{{spade|=8}}{{heart|=8}}{{club|=8}}
{{heart|=6}}{{club|=6}}{{Diamond|=6}}{{spade|=6}}
|{{club|=10}}{{Diamond|=10}}{{spade|=10}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{Diamond|=8}}
|style="text-align:left;"|Plays {{spade|=8}}{{heart|=8}}{{club|=8}} .
This '''[[#Special_action_cards_and_plays|burns]]''' all the cards in the stack and grants an additional turn.
|-
|{{heart|=6}}{{club|=6}}{{Diamond|=6}}{{spade|=6}}
|{{club|=10}}{{Diamond|=10}}{{spade|=10}}
{{cardBack}}{{cardBack}}{{cardBack}}
| -
|style="text-align:left;"|Plays {{heart|=6}}{{club|=6}}{{Diamond|=6}}{{spade|=6}} .
This '''[[#Special_action_cards_and_plays|burns]]''' all the cards in the stack and grants ''another'' additional turn.
|-
| -
|{{club|=10}}{{Diamond|=10}}{{spade|=10}}
{{cardBack}}{{cardBack}}{{cardBack}}
| -
|style="text-align:left;"|Plays {{club|=10}}{{Diamond|=10}}{{spade|=10}} .
This '''[[#Special_action_cards_and_plays|burns]]''' the stack and grants ''yet another'' additional turn.
|-
| -
| -
{{club|=Q}}{{cardBack}}{{cardBack}}
| -
|style="text-align:left;"|Plays a face-down card, {{club|=Q}} .
|-
|'''D'''
|{{club|=9}}{{heart|=10}}
|{{club|=K}}{{Diamond|=K}}{{spade|=K}}
{{cardBack}}{{cardBack}}{{cardBack}}
{{cardBack}}{{cardBack}}{{cardBack}}
|{{club|=Q}}
|{{diamond|2}}
|style="text-align:left;"|Cannot play and picks up the stack.
|style="text-align:left;"|Plays {{heart|3}}{{club|3}} .
''Luckily it's just the'' {{club|=Q}} .
|}
|}
</pre>
</pre>

Latest revision as of 21:37, 18 February 2024

   

Card template examples
Type {{club}} {{spade}} {{heart}} {{diamond}} {{cardBack}} {{card|A}} {{club|A}}
Result ​♣ ​♠ ​♥ ​♦ 🟔 A A♣

Available parameters

Parameter
Default value
Example
Result
Description
1
&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.
color
#000 (black)
{{card|A |color=green}}
A
Optional: specify the text color as a CSS color.
outlineColor
#fff0 (transparent)
{{card|A|color=white |outlineColor=green}}
A
Optional: specify the text outline color as a CSS color.
background
#fafafa (almost white)
{{card|A|color=white |background=green}}
A
Optional: specify the background color as a CSS color.
borderColor
#fff0 (transparent)
{{card |borderColor=green}}
   
Optional: specify the border color as a CSS color.
borderThickness
0.1
{{card|borderColor=green |borderThickness=0.2}}
   
Optional: specify the border thickness in rem units.

Examples

Machiavelli

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

Palace

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

4♠4♣

7♣7♦7♠

🟔🟔🟔

2♦ Plays 3♥3♣ .
{|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}} .
|}