Difference between revisions of "Template:Composition bar"

From NSWiki
Jump to: navigation, search
(Created page with "<div style="border: {{{border-width|1px}}} solid {{{border-color|#c0c0c0}}}; background-color: {{{background-color|#f0f0f0}}}; width: {{{width|100}}}px; height: 1.5em;"><div s...")
 
Line 1: Line 1:
 +
<noinclude>:<code><nowiki>{{</nowiki>Composition bar|''amount''|''total''|''bar-color''|color=''color''|background-color=''background-color''|per=0/1<nowiki>}}</nowiki></code></noinclude>
 
<div style="border: {{{border-width|1px}}} solid {{{border-color|#c0c0c0}}}; background-color: {{{background-color|#f0f0f0}}}; width: {{{width|100}}}px; height: 1.5em;"><div style="position: absolute; background-color:{{#if:{{both|{{{4|}}}|{{{5|}}}}}
 
<div style="border: {{{border-width|1px}}} solid {{{border-color|#c0c0c0}}}; background-color: {{{background-color|#f0f0f0}}}; width: {{{width|100}}}px; height: 1.5em;"><div style="position: absolute; background-color:{{#if:{{both|{{{4|}}}|{{{5|}}}}}
 
     |rgb({{#expr:255*{{{3|255}}}}},{{#expr:255*{{{4|0}}}}},{{#expr:255*{{{5|0}}}}})
 
     |rgb({{#expr:255*{{{3|255}}}}},{{#expr:255*{{{4|0}}}}},{{#expr:255*{{{5|0}}}}})
 
     |{{{hex|{{{3|#CCCCCC}}}}}} }}; width: {{#expr:floor({{{width|100}}}*{{{1|{{#expr:{{{width|100}}}/2}}}}}/{{{2|{{{width|100}}}}}})}}px; height: 1.5em;"></div><div style="position: absolute; font-weight: bold; width: {{{width|100}}}px; height: 1.5em; text-align: center; z-index: 10; color: {{{color|#000}}};">{{formatnum:{{{1|50}}}}}&nbsp;/&nbsp;{{formatnum:{{{2|100}}}}}{{#if:{{{per|}}}|&nbsp;&nbsp;&nbsp;({{#expr:(({{{1|50}}}/{{{2|100}}})*100)round 0}}%)}}</div></div>
 
     |{{{hex|{{{3|#CCCCCC}}}}}} }}; width: {{#expr:floor({{{width|100}}}*{{{1|{{#expr:{{{width|100}}}/2}}}}}/{{{2|{{{width|100}}}}}})}}px; height: 1.5em;"></div><div style="position: absolute; font-weight: bold; width: {{{width|100}}}px; height: 1.5em; text-align: center; z-index: 10; color: {{{color|#000}}};">{{formatnum:{{{1|50}}}}}&nbsp;/&nbsp;{{formatnum:{{{2|100}}}}}{{#if:{{{per|}}}|&nbsp;&nbsp;&nbsp;({{#expr:(({{{1|50}}}/{{{2|100}}})*100)round 0}}%)}}</div></div>

Revision as of 19:57, 26 February 2014

{{Composition bar|amount|total|bar-color|color=color|background-color=background-color|per=0/1}}
50 / 100