Template:Traitbar: Difference between revisions

From Songs of Syx Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<div class="traitbar" style="width:79px; height:12px; background-color: {{{4}}}; border: 1px solid #24120b;><div style="width:{{{1}}}; height:8px; background-color: {{{2}}}; border: 2px solid {{{3}}}; border-left: 1px solid {{{3}}} !important; border-right: 1px solid {{{3}}} !important;"></div></div><noinclude>
<div class="traitbar" style="width:79px; height:12px; background-color: {{{4}}}; border: 1px solid #24120b;><div style="width:{{{1}}}; height:8px; background-color: {{{2}}}; border: 2px solid {{{3}}}; border-left: 1px solid {{{3}}} !important; border-right: 1px solid {{{3}}} !important;"></div></div><noinclude>{{traitbar/doc}}[[Category:Templates]]</noinclude>
This is a trait bar. It can be edited to look like something of a static loading bar. These are meant to mimic the trait bars seen in the game. They can be customized in terms of how much of the bar is filled. Some bars are green, some are red. The syntax of the template is as follows:<br /> <code><nowiki>{{traitbar|width|inner color|border color|background color}}</nowiki></code><br />
The width part must be typed as a number with "px" or "%" at the end of it, with no spaces. The colors can be written as color names or as #RGB format HTML color codes. If a trait bar is empty, [[:Template:Traitbarempty|Template:Traitbarempty]] should be used instead, which is written as <code><nowiki>{{traitbarempty}}.</nowiki></code><br /><br />
These colors should always be the proper green or red, to match the game. The exact colors are as follows:<br />
{{color|'''Green:'''|#9ae89a}} ''Bar color'' - #17a018; ''Border color'' - #046005; ''Background'' - #23110b<br />
{{color|'''Red:'''|#e89a9a}} ''Bar color'' - #920000; ''Border color'' - #610000; ''Background'' - #23030b<br />
'''''Note: The background can be left blank, but this will default it to the background of a green bar.'''''<br /><br />
For example, <code><nowiki>{{traitbar|65%|#8888ff|#6666cc}}</nowiki></code>
Creates the following: {{traitbar|65%|#8888ff|#6666cc}}
[[Category:Templates]]
</noinclude>

Revision as of 00:46, 22 November 2021

Template Documentation

Description

This template is used on Species pages, in the "additional traits" sections. These are trait bars that perfectly match those seen in the game. The bars inside them can be either red or green. There is another template known as "traitbarempty" where - as the name would imply - is an empty trait bar, that also matches what's in the game. Due to the complexity of this template, plenty of care and testing should be used for publishing any pages with these.

The 'background color' part is generally unused, but remains in the template just in case any changes are in made in the game. It is usually a good idea to just leave the background color blank, which causes it to use a default color instead (determined by the CSS).

These colors should always be the proper green or red, to match the game. The exact colors are as follows:
Green: Bar color - #17a018; Border color - #046005; Background - #23110b
Red: Bar color - #920000; Border color - #610000; Background - #23030b

Syntax

{{traitbar|width|inner color|border color|background color}} - The width can be both pixels or a percentage.

Examples
Typing {{traitbar|65%|#8888ff|#6666cc}} creates the following:
Second, typing {{traitbar|24px|#e3cf24|#c4972e}} creates the following: