Template:Responsive Character Infobox: Difference between revisions

From Holocron - Star Wars Combine
Jump to navigation Jump to search
Alani Myrtel (talk | contribs)
No edit summary
Alani Myrtel (talk | contribs)
No edit summary
Line 1: Line 1:
<table rules="" style="background-color: #101010; width: 100%; max-width: 100%; font-size: 11px; border-collapse: collapse; border: 1px solid black;" border="0">
<includeonly><table class="resp-character-infobox" style="background-color: {{#if:{{{background-color|}}}|{{{background-color}}}|#001f33}}; width: 100%; max-width: 100%; font-size: 11px; border-collapse: collapse; border: 1px solid {{#if:{{{border-color|}}}|{{{border-color}}}|grey}};">
<tr>
<tr>
<td width="100%" colspan="2" style="background-color: #202020; font-size: 16px; text-align: center; font-weight: bold; color: white;">{{{name}}}</td>
<td width="100%" colspan="2" style="background-color: {{#if:{{{accent-color|}}}|{{{accent-color}}}|#21314c}}; font-size: 16px; text-align: center; ont-weight: bold; color: white;">{{{name}}}</td>
</tr>
</tr>
<tr>
<tr>
Line 7: Line 7:
</tr>
</tr>
<tr>
<tr>
<td width="100%" colspan="2" style="background-color: #202020; font-weight: bold; color: white; padding-left: .25em;">Biographical Information</td>
<td width="100%" colspan="2" style="background-color: {{#if:{{{accent-color|}}}|{{{accent-color}}}|#21314c}}; font-weight: bold; color: white; padding-left: .25em;">Biographical Information</td>
</tr>
</tr>
<tr>
<tr>
Line 75: Line 75:
</tr>}}
</tr>}}
<tr>
<tr>
<td width="100%" colspan="2" style="background-color: #202020; font-weight: bold; color: white; padding-left: .25em;">Physical Description</td>
<td width="100%" colspan="2" style="background-color: {{#if:{{{accent-color|}}}|{{{accent-color}}}|#21314c}}; font-weight: bold; color: white; padding-left: .25em;">Physical Description</td>
</tr>
</tr>
<tr>
<tr>
Line 102: Line 102:
</tr>}}
</tr>}}
<tr>
<tr>
<td width="100%" colspan="2" style="background-color: #202020; font-weight: bold; color: white; padding-left: .25em;">Political Information</td>
<td width="100%" colspan="2" style="background-color: {{#if:{{{accent-color|}}}|{{{accent-color}}}|#21314c}}; font-weight: bold; color: white; padding-left: .25em;">Political Information</td>
</tr>
</tr>
<tr>
<tr>
Line 136: Line 136:
</tr>
</tr>
<tr>
<tr>
<!-- filler row --><td width="100%" colspan="2" style="background-color: #202020; font-size: 8px;">&nbsp;</td>
<!-- filler row --><td width="100%" colspan="2" style="background-color: {{#if:{{{accent-color|}}}|{{{accent-color}}}|#21314c}}; font-size: 6px;">&nbsp;</td>
</tr>
</tr>
</table><noinclude>
</table></includeonly><noinclude>
=Usage=
=Usage=


This template is a direct fork from [[Template:Infobox Character]] as of 2023-08-03 (YYYY-MM-DD).<br>
This template is an customization of [[Template:Infobox Character]], aimed to provide a responsive counterpart to the original infobox.
For the usage information, see [[Template:Infobox Character|the original template]].
This infobox is meant to be used with the [[Template:Responsive Character Page|Responsive Character Page template]], but can also be used in standalone tables, flexboxes, or grids. Just be aware that this template takes on 100% of the width of the box you put it in!


This template is to be used inside a table, grid, or flexbox.
Custom colors can be provided either in their HTML names (e.g. 'red'), in HEX-notation (e.g. '#FF0000'), via the <code>rgb(r, g, b)</code> function, or via the <code>rgba(r, g, b, a)</code> function.
 
<pre>
{{Template:Responsive Character Infobox
| background-color = optional, this defaults to '#001f33'. This is the color seen behind the data rows.
| border-color = optional, this defaults to 'grey'. This is the color of the surrounding border of the infobox.
| accent-color = optional, this defaults to '#21314c'. This is the color seen behind the header rows.
| name = required
| image = required
| race = required
| homeworld = optional
| clan = optional
| house = optional
| mother = optional
| father = optional
| marital status = optional
| spouse = optional
| partner = optional
| siblings = optional
| children = optional
| born = optional
| died = optional
| languages = optional
| religion = optional
| quote = optional
| gender = required
| height = optional
| weight = optional
| coloring = optional
| hair color = optional
| eye color = optional
| affiliation = required
| title = optional
| rank = optional
| positions = optional
| prior affiliation = optional
| awards = optional
| signature = optional. This field is for signature images. The image should ideally be no wider than 220 pixels.
}}
</pre>
 
=Examples=
===Default===
{{Template:Responsive Character Page
| background-color = none
| character-infobox-width = 375px
| character-infobox =
{{Template:Responsive Character Infobox}}
| main-content =
<pre><nowiki>{{Template:Responsive Character Infobox}}</nowiki></pre>
}}
 
===Custom colors A===
{{Template:Responsive Character Page
| background-color = none
| character-infobox-width = 375px
| character-infobox =
{{Template:Responsive Character Infobox
| background-color = #101010
| border-color = #000000
| accent-color = #202020
}}
| main-content =
<pre><nowiki>
{{Template:Responsive Character Infobox
| background-color = #101010
| border-color = #000000
| accent-color = #202020
}}
</nowiki></pre>
}}
 
===Custom colors B===
{{Template:Responsive Character Page
| background-color = none
| character-infobox-width = 375px
| character-infobox =
{{Template:Responsive Character Infobox
| background-color = limegreen
| border-color = red
| accent-color = magenta
}}
| main-content =
<p style="font-weight: bold; color: red;">By the Force, please do not use these colors.</p>
<pre><nowiki>
{{Template:Responsive Character Infobox
| background-color = limegreen
| border-color = red
| accent-color = magenta
}}
</nowiki></pre>
}}


[[Category:Infobox templates]]
[[Category:Infobox templates]]
[[Category:Responsive Templates]]</noinclude>
[[Category:Responsive Templates]]</noinclude>

Revision as of 20:13, 12 August 2023

Usage

This template is an customization of Template:Infobox Character, aimed to provide a responsive counterpart to the original infobox. This infobox is meant to be used with the Responsive Character Page template, but can also be used in standalone tables, flexboxes, or grids. Just be aware that this template takes on 100% of the width of the box you put it in!

Custom colors can be provided either in their HTML names (e.g. 'red'), in HEX-notation (e.g. '#FF0000'), via the rgb(r, g, b) function, or via the rgba(r, g, b, a) function.

{{Template:Responsive Character Infobox
| background-color = optional, this defaults to '#001f33'. This is the color seen behind the data rows.
| border-color = optional, this defaults to 'grey'. This is the color of the surrounding border of the infobox.
| accent-color = optional, this defaults to '#21314c'. This is the color seen behind the header rows.
| name = required
| image = required
| race = required
| homeworld = optional
| clan = optional
| house = optional
| mother = optional
| father = optional
| marital status = optional
| spouse = optional
| partner = optional
| siblings = optional
| children = optional
| born = optional
| died = optional
| languages = optional
| religion = optional
| quote = optional
| gender = required
| height = optional
| weight = optional
| coloring = optional
| hair color = optional
| eye color = optional
| affiliation = required
| title = optional
| rank = optional
| positions = optional
| prior affiliation = optional
| awards = optional
| signature = optional. This field is for signature images. The image should ideally be no wider than 220 pixels. 
}}

Examples

Default

{{{name}}}
{{{image}}}
Biographical Information
Race {{{race}}}
Physical Description
Gender {{{gender}}}
Political Information
Affiliation {{{affiliation}}}
 
 
{{Template:Responsive Character Infobox}}


Custom colors A

{{{name}}}
{{{image}}}
Biographical Information
Race {{{race}}}
Physical Description
Gender {{{gender}}}
Political Information
Affiliation {{{affiliation}}}
 
 
{{Template:Responsive Character Infobox
| background-color = #101010
| border-color = #000000
| accent-color = #202020
}}


Custom colors B

{{{name}}}
{{{image}}}
Biographical Information
Race {{{race}}}
Physical Description
Gender {{{gender}}}
Political Information
Affiliation {{{affiliation}}}
 
 

By the Force, please do not use these colors.

{{Template:Responsive Character Infobox
| background-color = limegreen
| border-color = red
| accent-color = magenta
}}