You are viewing the MafiaScum.net Wiki. To play the game, visit the forum.

Template:WDL-Bar: Difference between revisions

From MafiaWiki
Jump to navigation Jump to search
(Created page with "<includeonly>{| cellpadding="0" cellspacing="0" width="{{{size|250px}}}" {{#if {{{style}}} | style="{{{style}}}" }} | {| cellspacing="0" width="100%" {{#if: {{{caption|}}} | {...")
 
No edit summary
 
Line 1: Line 1:
<includeonly>{| cellpadding="0" cellspacing="0" width="{{{size|250px}}}" {{#if {{{style}}} | style="{{{style}}}" }}
<includeonly>{| cellpadding="0" cellspacing="0" width="{{{size|250px}}}" {{#if {{{style}}} | style="{{#ifeq: {{{style}}} | basic | background:#eee; border-style: solid; border-width: 1px; border-color: #000; padding:5px; margin: 10px auto 10px auto; | {{{style}}} }}" }}
|
|
{| cellspacing="0" width="100%"
{| cellspacing="0" width="100%"
Line 26: Line 26:
Creates a percentage bar comparing the given numbers of wins, draws and losses. Like this:  
Creates a percentage bar comparing the given numbers of wins, draws and losses. Like this:  


{{WDL-Bar|caption='''Wins, Draws and Losses:'''|wins=7|draws=1|losses=2|style=background:#ddd; border-style: solid; border-width: 1px; border-color: #000; padding:5px; margin: 10px auto 0px auto;}}
{{WDL-Bar|caption='''Wins, Draws and Losses:'''|wins=7|draws=1|losses=2|style=basic}}


== Syntax ==
== Syntax ==
Line 48: Line 48:
Will be displayed above the bar. Optional.
Will be displayed above the bar. Optional.


=== {{{wins}}} ===
=== {{{wins}}}, {{{draws}}} and {{{losses}}} ===


Defines the number of wins. Defaults to <code>0</code>.
Changes the values to be computed. All default to <code>0</code>.
 
=== {{{draws}}} ===
 
Defines the number of draws. Defaults to <code>0</code>.
 
=== {{{losses}}} ===
 
Defines the number of losses. Defaults to <code>0</code>.


=== {{{captioncolor}}} ===
=== {{{captioncolor}}} ===
Line 64: Line 56:
Changes the color or the caption if there is one. Defaults to <code><span style="color:#000">#000</span></code>.
Changes the color or the caption if there is one. Defaults to <code><span style="color:#000">#000</span></code>.


=== {{{wincolor}}} ===
=== {{{wincolor}}}, {{{drawcolor}}} and {{{losscolor}}} ===


Changes the color that represents the wins. Defaults to <code><span style="color:#0f0">#0f0</span></code>.
Changes the color will represent the wins, draws and losses, respectivelly. The defaults are <code><span style="color:#0f0">#0f0</span></code> for wins, <code><span style="color:#00f">#00f</span></code> for draws and <code><span style="color:#f00">#f00</span></code> for losses.
 
=== {{{drawcolor}}} ===
 
Changes the color that represents the draws. Defaults to <code><span style="color:#00f">#00f</span></code>.
 
=== {{{losscolor}}} ===
 
Changes the color that represents the losses. Defaults to <code><span style="color:#f00">#f00</span></code>.


=== {{{size}}} ===
=== {{{size}}} ===
Line 82: Line 66:
=== {{{style}}} ===
=== {{{style}}} ===


Sets the attribute ''style'' for the entire table, allowing for greater customization. Optional.
If this is set to <code>basic</code>, it will give the box a basic formating. Otherwise, it sets the attribute <code>style="{{{style}}}"</code>, allowing for greater customization. Optional.


== Examples ==
== Examples ==
Line 159: Line 143:
| losses=7
| losses=7
| size=50%
| size=50%
| style=padding: 5px 5px 5px 5px; background:#ddd; border-style: solid; border-width: 2px; border-color:#000; margin: auto;
| style=basic
}}</pre>
 
{{WDL-Bar|caption='''Wins, Draws and Losses:'''|wins=10|draws=3|losses=7|size=50%|style=basic}}
 
<pre>{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
| size=50%
| style=padding: 5px 5px 5px 5px; background:#ddf; border-style: solid; border-width: 5px; border-color:#004; margin: auto;
}}</pre>
}}</pre>


{{WDL-Bar|caption='''Wins, Draws and Losses:'''|wins=10|draws=3|losses=7|size=50%|style=padding: 5px 5px 5px 5px; background:#ddd; border-style: solid; border-width: 2px; border-color:#000; margin: auto;}}</noinclude>
{{WDL-Bar|caption='''Wins, Draws and Losses:'''|wins=10|draws=3|losses=7|size=50%|style=padding: 5px 5px 5px 5px; background:#ddf; border-style: solid; border-width: 5px; border-color:#004; margin: auto;}}</noinclude>

Latest revision as of 02:53, 14 January 2022

Name:
  • WDL-Bar
Type:
Sub-Template:
  • No
Designer:

Creates a percentage bar comparing the given numbers of wins, draws and losses. Like this:

Wins, Draws and Losses:
W:7 D:1 L:2

Syntax

{{WDL-Bar
| caption=
| wins=
| draws=
| losses=
| captioncolor=
| wincolor=
| drawcolor=
| losscolor=
| size=
| style=
}}

Parameters

{{{caption}}}

Will be displayed above the bar. Optional.

{{{wins}}}, {{{draws}}} and {{{losses}}}

Changes the values to be computed. All default to 0.

{{{captioncolor}}}

Changes the color or the caption if there is one. Defaults to #000.

{{{wincolor}}}, {{{drawcolor}}} and {{{losscolor}}}

Changes the color will represent the wins, draws and losses, respectivelly. The defaults are #0f0 for wins, #00f for draws and #f00 for losses.

{{{size}}}

Changes the width of the bar. Can be in pixels (px) or percentage of space (%). Defaults to 250px.

{{{style}}}

If this is set to basic, it will give the box a basic formating. Otherwise, it sets the attribute style="{{{style}}}", allowing for greater customization. Optional.

Examples

{{WDL-Bar}}
W:0 D:0 L:0
{{WDL-Bar
| wins=1
}}
W:1 D:0 L:0
{{WDL-Bar
| wins=9
| losses=2
}}
W:9 D:0 L:2
{{WDL-Bar
| wins=10
| draws=3
| losses=7
}}
W:10 D:3 L:7
{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
}}
Wins, Draws and Losses:
W:10 D:3 L:7
{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
| captioncolor=#005
| wincolor=#0ff
| drawcolor=#ff0
| losscolor=#f0f
}}
Wins, Draws and Losses:
W:10 D:3 L:7
{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
| size=500px
}}
Wins, Draws and Losses:
W:10 D:3 L:7
{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
| size=50%
}}
Wins, Draws and Losses:
W:10 D:3 L:7
{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
| size=50%
| style=basic
}}
Wins, Draws and Losses:
W:10 D:3 L:7
{{WDL-Bar
| caption='''Wins, Draws and Losses:'''
| wins=10
| draws=3
| losses=7
| size=50%
| style=padding: 5px 5px 5px 5px; background:#ddf; border-style: solid; border-width: 5px; border-color:#004; margin: auto;
}}
Wins, Draws and Losses:
W:10 D:3 L:7