A Wiki in the Desert
Log in

Difference between revisions of "Template:ProgressBarBlock"

From A Wiki in the Desert
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<templatestyles src="ProgressBarBlock/main.css" />
 
<templatestyles src="ProgressBarBlock/main.css" />
{{#vardefine:barwidth|50.0}}{{#vardefine: w|{{#expr:100.0 / ({{{1|5}}} + {{{2|10}}}+2)}}}}
+
{{#vardefine:current|{{#expr:{{{1|2}}}}}}}{{#vardefine:progressing|{{#expr:{{{2|6}}}}}}}{{#vardefine:count|{{#expr:{{{3|10}}}}}}}{{#vardefine: w|{{#expr:(100.0 / {{#var:count}})-0.25}}}}<div class="bar">
<div class="bar" style="width:{{#var:barwidth}}%;">
+
{{#vardefine:color|seagreen}}
{{#loop: i | 0 | {{{1|5}}} |<nowiki/><div class="bar-block" style="background-color: green; width:{{#var:w}}%;"></div><unesc>\n</unesc>}}{{#loop: i | 0 | {{{2|10}}} |<div class="bar-block" style="width:{{#var:w}}%;"></div><unesc>\n</unesc>}}
+
{{#loop: i  
 +
| 0  
 +
| {{#var:count}}
 +
| {{#ifexpr:{{#var:i}} >= {{#var:current}}|{{#vardefine:color|lightgreen}}}}{{#ifexpr:{{#var:i}} >= {{#expr:{{#var:current}}+{{#var:progressing}}}}|{{#vardefine:color|salmon}}}}
 +
<nowiki/><div class="bar-block" style="background-color: {{#var:color}};"></div>
 +
}}
 
</div>
 
</div>

Latest revision as of 13:00, 23 September 2021