Difference between revisions of "Template:UB Gender"

From Nookipedia, the Animal Crossing wiki
(Adjusting colors for Undisclosed, adding ability to specify custom gender and colors)
(removing template's reliance on the Variables extension)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#vardefine:color1|{{#if:{{{color1|}}}|{{{color1|}}}|{{#switch: {{{1|Undisclosed}}}
 
|Undisclosed=#8580a2
 
|Male=#4169e1
 
|Female=#db7093}}}}}}
 
 
{{userbox
 
{{userbox
| border-c = {{#var:color1}}
+
| border-c = {{#if:{{{color1|}}}|{{{color1|}}}|{{#switch: {{lc:{{{1|}}}}}|female=#db7093|male=#4169e1|#default=#8580a2}}}}
| id      = {{{2|{{#switch: {{{1|Undisclosed}}}
+
| id      = {{{2|{{#switch:{{lc:{{{1|}}}}}
|Undisclosed=[[File:Rover NL.png{{!}}24px]]
+
|female=[[File:Player {{{num|6}}} NH.png{{!}}x40px]]
|Male=[[File:BoyBCC NL.png{{!}}30px]]
+
|male=[[File:Player {{{num|1}}} NH.png{{!}}x40px]]
|Female=[[File:NLGirl1.png{{!}}24px]]}}}}}
+
|#default={{#if:{{{num|}}}|[[File:Player {{{num|1}}} NH.png{{!}}x40px]]|[[File:Rover Series Art 2D.png{{!}}x42px]]}}}}}}}
| id-c    = {{#var:color1}}
+
| id-c    = {{#if:{{{color1|}}}|{{{color1|}}}|{{#switch: {{lc:{{{1|}}}}}|female=#db7093|male=#4169e1|#default=#8580a2}}}}
| info    = This user's gender is {{#switch: {{{1|Undisclosed}}}
+
| info    = This user's gender is {{#switch:{{lc:{{{1|}}}}}|male=male|female=female|#default={{{1|undisclosed}}}}}.
|Undisclosed=undisclosed
+
| info-c  = {{#if:{{{color2|}}}|{{{color2|}}}|{{#switch: {{lc:{{{1|}}}}}|female=#ffb6c1|male=#6495ed|#default=#bfb7e8}}}}
|Male=male
 
|Female=female
 
|#default={{{1|}}}}}.
 
| info-c  = {{#if:{{{color2|}}}|{{{color2|}}}|{{#switch: {{{1|Undisclosed}}}
 
|Undisclosed=#bfb7e8
 
|Male=#6495ed
 
|Female=#ffb6c1}}}}
 
 
}}<noinclude>
 
}}<noinclude>
{{clear}}{{Documentation}}
+
{{clear}}<br>{{Documentation}}
 
[[Category:Userboxes]]</noinclude>
 
[[Category:Userboxes]]</noinclude>

Latest revision as of 13:00, November 1, 2022

Rover Series Art 2D.png This user's gender is undisclosed.


Template documentation (view)


Usage

Base

{{UB Gender|<Gender>}}

Customization

This userbox accepts and displays any gender value entered. It will display pre-defined colors for the following inputs:

  • Female
  • Male

The border and image background color can be customized using the color1 parameter. (example: color1=#bfb7e8)

The text background color can be customized using the color2 parameter. (example: color2=#8580a2)

Additionally, the image displayed in this userbox may be customized:

  • By assigning the num parameter a value from 1 to 10 to cycle through New Horizons player images.
  • By entering a custom image code as the second input. (example: {{UB Gender|Genderless|[[File:Player 1 NH.png|20px]]}})

Examples

Rover Series Art 2D.png This user's gender is undisclosed.
{{UB Gender|undisclosed}}
Player 6 NH.png This user's gender is female.
{{UB Gender|female}}
Player 1 NH.png This user's gender is male.
{{UB Gender|male}}
Player 10 NH.png This user's gender is non-binary.
{{UB Gender|non-binary|num=10|color1=#7e21c9|color2=#fff94c}}