Спорт-вики — википедия научного бодибилдинга
Шаблон:Progress bar — различия между версиями
Ars (обсуждение | вклад) м (Ars переименовал страницу Шаблон:Progress в Шаблон:Progress bar без оставления перенаправления) |
Ars (обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
− | <includeonly> | + | <includeonly>{{ |
− | + | #vardefine: lpbCurrent | | |
− | + | {{#ifexpr: {{{current|0}}} - {{{max|100}}} > 0 | | |
− | + | {{{max|100}}} | | |
− | + | {{{current|0}}} | |
− | + | }} | |
− | + | }}{{ | |
− | + | #vardefine: lpbProgression | | |
− | + | {{{progression | | |
− | + | {{#ifexpr: ({{#var:lpbCurrent}} - {{{min|0}}} >= 0) and ({{{max|100}}} - {{{min|0}}} > 0) | | |
− | + | {{#expr: (({{#var:lpbCurrent}} - {{{min|0}}}) / ({{{max|100}}} - {{{min|0}}})) * 100 round 1}}% | | |
− | + | 0% | |
− | + | }} | |
− | + | }}} | |
− | + | }}{{ | |
− | + | #vardefine: lpbTooltipDisplayMode | | |
− | + | {{{tooltip-display-mode | | |
− | + | {{#if: {{#var:pb-tooltip-display-mode}} | | |
− | + | {{#var:pb-tooltip-display-mode}} | | |
− | + | percentage | |
− | + | }} | |
− | + | }}} | |
− | + | }}{{ | |
− | + | #vardefine: lpbTooltipText | | |
− | + | {{#switch: {{#var:lpbTooltipDisplayMode}} | | |
− | + | percentage = {{formatnum:{{#var:lpbProgression}}}} | | |
− | + | current = {{formatnum:{{{current|0}}}}} | | |
− | + | remaining = {{formatnum:{{#expr: {{{max|100}}} - {{{current|0}}}}}}} | | |
− | + | ratio = {{formatnum:{{{current|0}}}}} / {{formatnum:{{{max|100}}}}} | | |
− | + | }}{{{tooltip-text | | |
− | + | {{#if: {{#var:pb-tooltip-text}} | | |
− | + | {{#var:pb-tooltip-text}} | | |
− | + | }} | |
− | + | }}} | |
− | + | }}{{ | |
− | + | #vardefine: lpbBarDisplayMode | | |
− | + | {{{bar-display-mode | | |
− | + | {{#if: {{#var:pb-bar-display-mode}} | | |
− | + | {{#var:pb-bar-display-mode}} | | |
− | + | percentage | |
− | + | }} | |
− | + | }}} | |
− | + | }}{{ | |
− | + | #vardefine: lpbBarText | | |
− | + | {{#switch: {{#var:lpbBarDisplayMode}} | | |
− | + | percentage = {{formatnum:{{#var:lpbProgression}}}} | | |
− | + | current = {{formatnum:{{{current|0}}}}} | | |
+ | remaining = {{formatnum:{{#expr: {{{max|0}}} - {{{current|0}}}}}}} | | ||
+ | ratio = {{formatnum:{{{current|0}}}}} / {{formatnum:{{{max|100}}}}} | | ||
+ | }}{{{bar-text | | ||
+ | {{#if: {{#var:pb-bar-text}} | | ||
+ | {{#var:pb-bar-text}} | | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBarBackground | | ||
+ | {{{bar-background | | ||
+ | {{#if: {{#var:pb-bar-background}} | | ||
+ | {{#var:pb-bar-background}} | | ||
+ | #AAD5FF | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBarCustomStyle | | ||
+ | {{{bar-custom-style | | ||
+ | {{#if: {{#var:pb-bar-custom-style}} | | ||
+ | {{#var:pb-bar-custom-style}} | | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBoxBackground | | ||
+ | {{{box-background | | ||
+ | {{#if: {{#var:pb-box-background}} | | ||
+ | {{#var:pb-box-background}} | | ||
+ | white | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBoxBorder | | ||
+ | {{{box-border | | ||
+ | {{#if: {{#var:pb-box-border}} | | ||
+ | {{#var:pb-box-border}} | | ||
+ | 1px solid black | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBoxMargin | | ||
+ | {{{box-margin | | ||
+ | {{#if: {{#var:pb-box-margin}} | | ||
+ | {{#var:pb-box-margin}} | | ||
+ | 1px | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBoxPadding | | ||
+ | {{{box-padding | | ||
+ | {{#if: {{#var:pb-box-padding}} | | ||
+ | {{#var:pb-box-padding}} | | ||
+ | 1px | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBoxWidth | | ||
+ | {{{box-width | | ||
+ | {{#if: {{#var:pb-box-width}} | | ||
+ | {{#var:pb-box-width}} | | ||
+ | 100% | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbBoxCustomStyle | | ||
+ | {{{box-custom-style | | ||
+ | {{#if: {{#var:pb-box-custom-style}} | | ||
+ | {{#var:pb-box-custom-style}} | | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbTextColor | | ||
+ | {{{text-color | | ||
+ | {{#if: {{#var:pb-text-color}} | | ||
+ | {{#var:pb-text-color}} | | ||
+ | black | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbTextSize | | ||
+ | {{{text-size | | ||
+ | {{#if: {{#var:pb-text-size}} | | ||
+ | {{#var:pb-text-size}} | | ||
+ | small | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #vardefine: lpbTextWeight | | ||
+ | {{{text-weight | | ||
+ | {{#if: {{#var:pb-text-weight}} | | ||
+ | {{#var:pb-text-weight}} | | ||
+ | bold | ||
+ | }} | ||
+ | }}} | ||
+ | }}{{ | ||
+ | #if: {{{title|}}} | <span style="font-size:{{#var:lpbTextSize}};font-weight:{{#var:lpbTextWeight}}">{{{title|}}}</span> | | ||
+ | }}<div role="progressbar" aria-valuemin="{{{min|0}}}" aria-valuemax="{{{max|100}}}" aria-valuenow="{{{current|{{{progression|0}}}}}}" aria-valuetext="{{#var:lpbBarText}}" title="{{#var:lpbTooltipText}}" style="background:{{#var:lpbBoxBackground}};border:{{#var:lpbBoxBorder}};margin:{{#var:lpbBoxMargin}};padding:{{#var:lpbBoxPadding}};width:{{#var:lpbBoxWidth}};color:{{#var:lpbTextColor}};font-size:{{#var:lpbTextSize}};font-weight:{{#var:lpbTextWeight}};line-height:1.25em;{{#var:lpbBoxCustomStyle}}"><div style="margin:0;padding:0;position:relative;"><div style="margin:0;padding:0;width:{{#var:lpbProgression}};background:{{#var:lpbBarBackground}};height:1.25em;{{#var:lpbBarCustomStyle}}"> </div><div style="margin:0;padding:0;width:100%;position:absolute;top:0;z-index:1;background-color:transparent;text-align:center;">{{#var:lpbBarText}}</div></div></div></includeonly><noinclude> |