Template:CompositionBar: Difference between revisions

From EarthMC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<div style="{{#ifeq:{{{width|}}}|auto||width: {{#iferror:{{#expr:{{{width|}}}}}|{{{width}}}|{{{width|100}}}px}};}}"><span class="nowrap">{{formatnum:{{{1|50}}}}} / {{formatnum:{{{2|100}}}}}{{#if:{{{per|}}}|&emsp;({{#expr:(({{{1|50}}}/{{{2|100}}})*100) round (-1*{{min|0|{{Order of magnitude|{{#expr:({{{1|50}}}/{{{2|100}}})*100}}}}}}) }}%)}}{{{ref|}}}</span><div style="{{#ifeq:{{{border|{{{border-color|}}}}}}|none||box-sizing: border-box; border: 1px solid {{{border|{{{border-color|#aaa}}}}}};}} {{#if:{{{background-color|}}}|background-color: {{{background-color}}};}} height: 1.15em; position: relative;"><div style="background-color: {{#if:{{Both|{{{4|}}}|{{{5|}}}}}
<div class="composition-bar-wrapper" style="
| rgb({{#expr:255*{{{3|255}}}}}, {{#expr:255*{{{4|0}}}}}, {{#expr:255*{{{5|0}}}}})
  {{#if:{{{width|}}}|width:{{{width}}};|width:100px;}}
| {{{hex|{{{3|#CCCCCC}}}}}}
  {{#if:{{{float|}}}|float:{{{float}}};}}
}}; color:inherit; width: {{#expr:(({{{1|50}}}/{{{2|100}}})*100) round (-1*{{min|0|{{Order of magnitude|{{#expr:({{{1|50}}}/{{{2|100}}})*100}}}}}}) }}%; height: 100%;"></div></div></div>
  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>

Revision as of 05:15, 24 July 2025

 <div class="composition-bar-fill" style="
   width:Expression error: Unrecognized punctuation character "{".%;
   background-color:#4CAF50;
   color:white;
 ">
   
     Expression error: Unrecognized punctuation character "{".%