Template:CompositionBar: Difference between revisions

From EarthMC
Jump to navigation Jump to search
No edit summary
Tag: Manual revert
(Blanked the page)
Tag: Blanking
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
<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>

Latest revision as of 05:34, 24 July 2025