Difference between revisions of "Template:AbilityCard"
Jump to navigation
Jump to search
(Created page with "<noinclude>Creates a card, styled to create a common theme for Class Abilities. == Usage == Parameters: [Title] | [TitleSize] | [CardWidth] | Body Title, TitleSize and CardW...") |
|||
Line 47: | Line 47: | ||
</noinclude><includeonly><!-- | </noinclude><includeonly><!-- | ||
-->{{#vardefine: | -->{{#vardefine:awidth|W}}<!-- | ||
-->{{#vardefine: | -->{{#vardefine:acolor|white}}<!-- | ||
-->{{#if: {{{2|}}}| | -->{{#if: {{{2|}}}| | ||
{{#if: {{{3|}}}| | {{#if: {{{3|}}}| | ||
{{#if: {{{4|}}}| | {{#if: {{{4|}}}| | ||
{{#ifeq:{{{1}}}|"none"||{{#vardefine: | {{#ifeq:{{{1}}}|"none"||{{#vardefine:atitle|{{{1}}}}}}} | ||
{{#vardefine: | {{#vardefine:atitlesize|{{{2}}}}} | ||
{{#vardefine: | {{#vardefine:awidth|{{{3}}}}} | ||
{{#vardefine: | {{#vardefine:abody|{{{4}}}}} | ||
| | | | ||
{{#ifeq:{{{1}}}|"none"||{{#vardefine: | {{#ifeq:{{{1}}}|"none"||{{#vardefine:atitle|{{{1}}}}}}} | ||
{{#vardefine: | {{#vardefine:atitlesize|{{{2}}}}} | ||
{{#vardefine: | {{#vardefine:abody|{{{3}}}}} | ||
}} | }} | ||
| | | | ||
{{#ifeq:{{{1}}}|"none"||{{#vardefine: | {{#ifeq:{{{1}}}|"none"||{{#vardefine:atitle|{{{1}}}}}}} | ||
{{#vardefine: | {{#vardefine:atitlesize|4}} | ||
{{#vardefine: | {{#vardefine:abody|{{{2}}}}} | ||
}} | }} | ||
| | | | ||
{{#vardefine: | {{#vardefine:atitlesize|4}} | ||
{{#vardefine: | {{#vardefine:abody|{{{1}}}}} | ||
}}{{#ifeq: {{#var: | }}{{#ifeq: {{#var:awidth}}|S| | ||
{{#vardefine: | {{#vardefine:awidth|200px}} | ||
| | | | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:awidth}}|M| | ||
{{#vardefine: | {{#vardefine:awidth|300px}} | ||
| | | | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:awidth}}|W| | ||
{{#vardefine: | {{#vardefine:awidth|450px}} | ||
| | | | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:awidth}}|VW| | ||
{{#vardefine: | {{#vardefine:awidth|650px}} | ||
| | | | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:awidth}}|XW| | ||
{{#vardefine: | {{#vardefine:awidth|945px}} | ||
| | | | ||
{{#vardefine: | {{#vardefine:awidth|300px}} | ||
}} | }} | ||
}} | }} | ||
}} | }} | ||
}} | }} | ||
}}<div style="display:inline-table;max-width:{{#var: | }}<div style="display:inline-table;max-width:{{#var:awidth}};margin:10px;background-color:{{#var:acolor}};padding:.8em;border:1px solid #DDDDDD;"> | ||
{{#if: {{#varexists: | {{#if: {{#varexists:atitle}}| | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:atitlesize}}|2| | ||
<h2 style="margin-top:0px">{{#var: | <h2 style="margin-top:0px">{{#var:atitle}}</h2> | ||
| | | | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:atitlesize}}|3| | ||
<h3 style="margin-top:-8px">{{#var: | <h3 style="margin-top:-8px">{{#var:atitle}}</h3> | ||
| | | | ||
<h4 style="margin-top:-8px">{{#var: | <h4 style="margin-top:-8px">{{#var:atitle}}</h4> | ||
}} | }} | ||
}} | }} | ||
}} | }} | ||
{{#var: | {{#var:abody}} | ||
</div></includeonly> | </div></includeonly> |
Revision as of 00:07, 9 July 2021
Creates a card, styled to create a common theme for Class Abilities.
Usage
Parameters: [Title] | [TitleSize] | [CardWidth] | Body
Title, TitleSize and CardWidth are optional.
Number Parameters | Title | TitleSize | CardWidth | Body |
---|---|---|---|---|
4 | 1 | 2 | 3 | 4 |
3 | 1 | 2 | - | 3 |
2 | 1 | - | - | 2 |
1 | - | - | - | 1 |
Example:
{{Card|Title|2|W|This is the body}}
or
{{Card|Title|This is the body}}
Title: If no title text is given, the card is created without a header. If title is 'none' card will also be created without a header.
TitleSize: Titlesize defaults to Level 3. It accepts '2', '3' and '4' as values.
CardWidth: CardWidth defaults to '300px'. It accepts any css compatible width value. It also accepts the enum values below. Contributors are encouraged to use the default or enum values. If another value seems widely needed, a discussion should be started on whether another static value is needed.
Enum | Value |
---|---|
'S' | 200px |
'M' | 300px |
'W' | 450px |
'VW' | 650px |
'XW' | 945px |