Difference between revisions of "Template:Brick chart/Bricks/sandbox"
Jump to navigation
Jump to search
imported>Wikid77 (created, as a sandbox version of Template:Brick_chart/Bricks, to test changes) |
imported>Wikid77 (changed first # if to # ifexpr, indented 3 levels of if-structures; put section "NOTES".) |
||
| Line 1: | Line 1: | ||
| − | <noinclude> | + | <noinclude><!-- |
| − | + | -============================================================================= | |
| − | </noinclude>{{# | + | - Brick_chart/Bricks - Draw bricks for 1 value in {Brick_chart} |
| + | -============================================================================= | ||
| + | -- (see NOTES at bottom) | ||
| + | --> | ||
| + | </noinclude>{{ | ||
| + | #ifexpr:{{{count|0}}} > 0 | ||
| + | |<!--show initial brick(s)--><div style=" | ||
background:{{{color|silver}}}; | background:{{{color|silver}}}; | ||
float:left; | float:left; | ||
| Line 7: | Line 13: | ||
height:{{#expr:100/{{{stride|10}}}}}%; | height:{{#expr:100/{{{stride|10}}}}}%; | ||
overflow:hidden; | overflow:hidden; | ||
| − | width:{{#expr:{{min|{{#expr:({{{stride|10}}} - {{{offset|0}}} mod {{{stride|10}}})}}|{{{count|0}}}}} * 100/{{{stride|10}}} }}%; | + | width:{{#expr: |
| − | "> </div>{{#ifexpr:{{{count|0}}} > {{min|{{#expr:({{{stride|10}}} - {{{offset|0}}} mod {{{stride|10}}})}}|{{{count|0}}}}} | + | {{min|{{#expr:({{{stride|10}}} - {{{offset|0}}} mod {{{stride|10}}})}} |
| − | |<div style=" | + | |{{{count|0}}}}} * 100/{{{stride|10}}} }}%; |
| − | + | "> </div>{{ | |
| − | + | #ifexpr:{{{count|0}}} > {{min|{{#expr:( {{{stride|10}}} - | |
| − | + | {{{offset|0}}} mod {{{stride|10}}})}}|{{{count|0}}} }} | |
| − | + | |<!--show full-line bricks--><div style=" | |
| − | + | background:{{{color|grey}}}; | |
| − | + | float:left; | |
| − | + | clear:left; | |
| − | + | width:100%; | |
| − | + | overflow:hidden; | |
| − | + | height:{{#expr: | |
| − | + | floor( ({{{count|0}}} | |
| − | + | - {{min|{{#expr:({{{stride|10}}} | |
| − | + | - {{{offset|0}}} mod {{{stride|10}}})}}|{{{count|0}}}}} | |
| − | + | - ( ({{{count|0}}} + {{{offset|0}}}) mod {{{stride|10}}}) | |
| − | + | )/{{{stride|10}}}) * 100/{{{stride|10}}} }}%;<!-- | |
| − | + | -->"> </div>{{ | |
| − | + | #ifexpr:(({{{count|0}}} + {{{offset|0}}}) mod {{{stride|10}}}) > 0 | |
| − | + | |<!--show final bricks (if any)--><div style=" | |
| − | + | background:{{{color|silver}}}; | |
| − | }} | + | float:left; |
| − | }} | + | clear:left; |
| − | }} | + | height:{{#expr:100/{{{stride|10}}} }}%; |
| + | width:{{#expr:( ({{{count|0}}} + {{{offset|0}}}) mod {{{stride|10}}} | ||
| + | ) * 100/{{{stride|10}}} }}%;<!-- | ||
| + | -->"> </div> | ||
| + | }} | ||
| + | }} | ||
| + | }}<noinclude><!-- | ||
| + | -------------------------------------------------------------------------- | ||
| + | -- | ||
| + | --NOTES | ||
| + | -- | ||
| + | -- NOTE A1: This template draws 1-3 line segments for: the initial bricks, | ||
| + | -- whole lines of middle bricks, and the final bricks (if any). | ||
| + | -- | ||
| + | -- NOTE S2: For a line to be visible, there must be a non-breaking space, | ||
| + | -- where the div-tag contains an " ". | ||
| + | -- | ||
| + | --> | ||
| + | |||
| + | The '''[[Template:Brick_chart/Bricks]]''' draws bricks for {{tl|Brick chart}}. | ||
| + | |||
| + | </noinclude> | ||