Template:Dots: Difference between revisions
Jump to navigation
Jump to search
Created page with "<includeonly><span style="white-space: nowrap;">{{ #ifexpr: {{{ 1 | 0 }}} > 0 | 10px | {{ #ifexpr: {{{ 2 | 1 }}} | 10px }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 1 | 10px | {{ #ifexpr: {{{ 2 | 1 }}} | 10px }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 2 | 10px | {{ #ifexpr: {{{ 2 | 1 }}} | 10px }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 3 | 10px | {{..." |
Dots V2! Doesn't use images but instead some CSS magic, allowing for greater control over how the dots are displayed. |
||
Line 1: | Line 1: | ||
<includeonly><span style="white-space: nowrap;">{{ #ifexpr: {{{ 1 | 0 }}} > 0 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 1 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 2 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 3 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 4 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 5 | <br />{{ #ifexpr: {{{ 1 | 0 }}} > 5 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 6 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 7 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 8 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 9 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }} }}</span></includeonly><noinclude>This template allows you to quickly and easily indicate stat values with dots, much like in the books. | <includeonly>{{#css: | ||
.dot_item { | |||
border-radius: 25px; | |||
width: 10px; | |||
height: 10px; | |||
margin: 1px; | |||
} | |||
}}<div class="dot_container" style="display: flex; flex-direction: row; ">{{#ifexpr: {{{1|0}}} > 0|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 0|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 1|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 1|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 2|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 2|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 3|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 3|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 4|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 4|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 5|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 5|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 6|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 6|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 7|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 7|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 8|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 8|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}{{#ifexpr: {{{1|0}}} > 9|<div class="dot_item" style="{{#ifeq: {{{gradient|no}}} | yes | background-image: linear-gradient(to bottom right, rgba(255,255,255,1), rgba(255,255,255,0), rgba(255,255,255,0) ); }} background-color: {{{fill_color | black }}}; border: 1px solid {{{fill_color | black }}};"></div>|{{#ifexpr: {{{2|5}}} > 9|<div class="dot_item" style="border: 1px solid {{{empty_color | {{{fill_color | black }}} }}};"></div>}} }}</div><!-- OLD CODE: <span style="white-space: nowrap;">{{ #ifexpr: {{{ 1 | 0 }}} > 0 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 1 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 2 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 3 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 4 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 5 | <br />{{ #ifexpr: {{{ 1 | 0 }}} > 5 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 6 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 7 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 8 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }}{{ #ifexpr: {{{ 1 | 0 }}} > 9 | [[Image:Dot-filled.png|10px]] | {{ #ifexpr: {{{ 2 | 1 }}} | [[Image:Dot.png|10px]] }} }} }}</span> --></includeonly><noinclude>This template allows you to quickly and easily indicate stat values with dots, much like in the books. | |||
<pre> | |||
{{dots|<value>|<max>|gradient=<gradient>|fill_color=<fill_color>|empty_color=<empty_color>}} | |||
<gradient>: If set to 'yes' will put a gradient over the circles to give them a 3D appearance | |||
<fill_color>: The color for full dots. This can be color names (red), or HTML codes (#F633AB). Defaults to 'black'. | |||
<empty_color>: The color for the borders of empty dots. This can be color names (red) or HTML codes (#F633AB). Defaults to the value of <fill_color>. | |||
</pre> | |||
{| | {| | ||
! colspan="2" | Basic | ! colspan="2" | Basic examples | ||
|- | |- | ||
|<nowiki>{{dots|1}}</nowiki> | |<nowiki>{{dots|1}}</nowiki> | ||
|{{dots|1}} | |{{dots|1|gradient=no}} | ||
|- | |- | ||
|<nowiki>{{dots|2}}</nowiki> | |<nowiki>{{dots|2}}</nowiki> | ||
Line 19: | Line 34: | ||
|{{dots|5}} | |{{dots|5}} | ||
|- | |- | ||
! colspan="2" | | ! colspan="2" | Playing with some options | ||
|- | |- | ||
|<nowiki>{{dots|3|10}}</nowiki> | |<nowiki>{{dots|3|10}}</nowiki> | ||
|{{dots|3|10}} | |{{dots|3|10}} | ||
|- | |- | ||
|<nowiki>{{dots| | |<nowiki>{{dots|3|10|gradient=yes}}</nowiki> | ||
|{{dots| | |{{dots|3|10|gradient=yes}} | ||
|- | |- | ||
|<nowiki>{{dots| | |<nowiki>{{dots|3|10|gradient=yes|fill_color=#F633AB}}</nowiki> | ||
|{{dots| | |{{dots|3|10|gradient=yes|fill_color=#F633AB}} | ||
|- | |- | ||
|<nowiki>{{dots| | |<nowiki>{{dots|3|10|gradient=yes|fill_color=#F633AB|empty_color=blue}}</nowiki> | ||
|{{dots| | |{{dots|3|10|gradient=yes|fill_color=#F633AB|empty_color=blue}} | ||
|} | |} | ||
Big thanks to Sigil for the initial idea. | |||
</noinclude> | </noinclude> |
Latest revision as of 21:03, 14 September 2024
This template allows you to quickly and easily indicate stat values with dots, much like in the books.
{{dots|<value>|<max>|gradient=<gradient>|fill_color=<fill_color>|empty_color=<empty_color>}} <gradient>: If set to 'yes' will put a gradient over the circles to give them a 3D appearance <fill_color>: The color for full dots. This can be color names (red), or HTML codes (#F633AB). Defaults to 'black'. <empty_color>: The color for the borders of empty dots. This can be color names (red) or HTML codes (#F633AB). Defaults to the value of <fill_color>.
Basic examples | |
---|---|
{{dots|1}} | |
{{dots|2}} | |
{{dots|3}} | |
{{dots|4}} | |
{{dots|5}} | |
Playing with some options | |
{{dots|3|10}} | |
{{dots|3|10|gradient=yes}} | |
{{dots|3|10|gradient=yes|fill_color=#F633AB}} | |
{{dots|3|10|gradient=yes|fill_color=#F633AB|empty_color=blue}} |
Big thanks to Sigil for the initial idea.