Template:Reputation Table/Item: Difference between revisions

Template page
No edit summary
No edit summary
Line 7: Line 7:
</noinclude>
</noinclude>
<includeonly>
<includeonly>
<div style="width: 100%; height: 20px; background: #e0e0e0; border-radius: 5px; position: relative;">
<div style="width: 100%; height: 20px; background: transparent; border-radius: 5px; position: relative; border: 1px solid #000;">
<!-- Background gradient (red to green) -->
<!-- Dynamic bar based on the value -->
<div style="height: 100%;  
<div style="height: 100%;  
background: linear-gradient(to right, red, yellow, green);
width: 100%;
position: absolute;
left: 0;
top: 0;">
</div>
<!-- Value bar that moves left or right -->
<div style="height: 100%;
background: #3a8d3a;
position: absolute;  
position: absolute;  
top: 0;  
top: 0;  
left: 50%;  
left: 50%;  
width: {{#expr: abs(100 * {{{value|0}}})}}%;  
background: #3a8d3a;
transform: translateX({{{value|0}}} * 50%);
border-radius: 5px;
border-radius: 5px;">
width: {{#expr: abs(50 * {{{value|0}}})}}%;
transform: translateX({{{value|0}}} * 50%);">
</div>
</div>
</div>
</div>
</includeonly>
</includeonly>

Revision as of 04:26, 15 December 2024

Usage:

{{Reputation_Table/Item|value=0.1}}