Difference between revisions of "Template:Progress Bar"
Jump to navigation
Jump to search
(Imported from OpenStreetMap) |
|||
Line 1: | Line 1: | ||
− | <div style=" | + | <div style="display:inline-block;font-size:{{{text-size|90%}}};line-height:1.5;margin:{{{box-margin|1px}}};margin-left:0;margin-right:0;min-width:5em;{{#if:{{{box-width|}}}|width:{{{box-width|}}};}}font-weight:{{{text-weight|bold}}}" {{#if:{{{title|}}}|title="{{{title|}}}"}}><div style="background:{{{box-background|#FFF}}};color:{{{text-color|#222}}};border:{{{box-border|1px solid #AAA}}};padding:{{{box-padding|1px}}}"><div style="position:relative"><!-- |
− | < | + | --><div style="position:relative;z-index:1;top:0;left:0;background:{{#if:{{{bar-background|}}} |
− | <!--{{ | + | | {{{bar-background|}}} |
− | <!-- | + | | {{#ifexpr:{{#if:{{{current|}}}|({{{current|}}})<({{{min|0}}})or({{{max|100}}})<=({{{min|0}}})|1}} |
− | </noinclude> | + | | <!--0%:lightred:rgb(255,51,51)-->#F33 |
+ | | {{#ifexpr:({{{current|}}})>=({{{max|100}}}) | ||
+ | | <!--100%:lightgreen:rgb(0,255,0)-->#0F0 | ||
+ | | <!--linear from 0%:lightred:rgb(255,51,51) to 100%:lightgreen:rgb(0,255,0)-->rgb({{#expr: | ||
+ | ((({{{current|}}})-({{{min|0}}}))/(({{{max|100}}})-({{{min|0}}}))*( 0-255)+255)round0}},{{#expr: | ||
+ | ((({{{current|}}})-({{{min|0}}}))/(({{{max|100}}})-({{{min|0}}}))*(255- 51)+ 51)round0}},{{#expr: | ||
+ | ((({{{current|}}})-({{{min|0}}}))/(({{{max|100}}})-({{{min|0}}}))*( 0- 51)+ 51)round0}}) | ||
+ | }} | ||
+ | }} | ||
+ | }};color:transparent;width:{{#if:{{{progression|}}} | ||
+ | | {{{progression|}}} | ||
+ | | {{#ifexpr:{{#if:{{{current|}}}|({{{current|}}})<=({{{min|0}}})or({{{max|100}}})<=({{{min|0}}})|1}} | ||
+ | | 0 | ||
+ | | {{#ifexpr:({{{current|}}})>=({{{max|100}}}) | ||
+ | | 100 | ||
+ | | {{#expr:(({{{current|}}})-({{{min|0}}}))/(({{{max|100}}})-({{{min|0}}}))*100round6}} | ||
+ | }} | ||
+ | }}% | ||
+ | }};text-align:left"> </div><!-- | ||
+ | --><div style="position:absolute;z-index:2;top:0;left:0;background:transparent;width:100%;text-align:center">{{#if:{{{progression-text|}}} | ||
+ | | {{{progression-text|}}} | ||
+ | | {{#if:{{{progression|}}} | ||
+ | | {{{progression|}}} | ||
+ | | {{#ifeq:{{{mode|}}}|value | ||
+ | | {{{current|}}} | ||
+ | | {{#ifexpr:{{#if:{{{current|}}}|({{{min|0}}})>=({{{max|100}}})|1}} | ||
+ | | ? | ||
+ | | {{#expr:(({{{current|}}})-({{{min|0}}}))/(({{{max|100}}})-({{{min|0}}}))*100round1}} % | ||
+ | }} | ||
+ | }} | ||
+ | }} {{{desc|}}} | ||
+ | }}</div><!-- | ||
+ | --></div></div></div><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 17:21, 17 August 2019
?