Template:CompositionBar: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<div style="{{# | <div class="composition-bar-wrapper" style=" | ||
{{#if:{{{width|}}}|width:{{{width}}};|width:100px;}} | |||
{{#if:{{{float|}}}|float:{{{float}}};}} | |||
margin-left:auto; margin-right:0; /* Default align right */ | |||
border:{{{5|{{{border_style|1px solid gray}}}}}}; | |||
"> | |||
<div class="composition-bar-fill" style=" | |||
width:{{#expr: ({{{1|{{{amount|0}}}}} / {{{2|{{{total|100}}}}}}) * 100 round 0}}%; | |||
background-color:{{{3|{{{color|#4CAF50}}}}}}; | |||
color:{{{text_color|white}}}; | |||
"> | |||
<span class="segment-label"> | |||
{{#ifeq:{{{per|no}}}|yes | |||
|{{{1|{{{amount|0}}}}}}/{{{2|{{{total|100}}}}}} | |||
|{{#expr: ({{{1|{{{amount|0}}}}} / {{{2|{{{total|100}}}}}}) * 100 round 0}}% | |||
}} | |||
</span> | |||
</div> | |||
</div> | |||