Icon2 – Template

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix one span too much)
(Add size argument)
Line 1: Line 1:
<includeonly>{{#if:{{{1|}}}{{{2|}}}
<includeonly>{{#if:{{{1|}}}{{{2|}}}
| {{LinkWrap|1=<span class="icon2 {{#if:{{{big|}}}|icon2-big}}"{{#ifexpr:{{#len:{{{width|}}}}} and {{#len:{{{big|}}}}}|<nowiki/> style="width: {{#expr:{{{width}}} * 64 round 2}}px"}} alt="{{ucFirst:{{Trim|{{{1|}}} {{{2|}}}}}}}" title="{{ucFirst:{{Trim|{{{1|}}} {{{2|}}}}}}}"><span class="background"><span class="letter-1"{{#if:{{{3|}}}|<nowiki/> style="color: {{{3}}}"}}>{{#ifexpr:{{#len:{{{line1|}}}}} and {{#len:{{{big|}}}}} > 0
| {{LinkWrap|1=<span class="icon2 {{#if:{{{big|}}}|icon2-big}}" style="{{#if:{{{size|}}}|{{#if:{{{big|}}}||font-size: {{#expr:{{{size}}}*0.725}}em; height: {{#expr:{{{size}}}*32}}px; width: {{#expr:{{{size}}}*32}}px;}}}}{{#ifexpr:{{#len:{{{width|}}}}} and {{#len:{{{big|}}}}}|<nowiki/> "width: {{#expr:{{{width}}} * 64 round 2}}px}}" alt="{{ucFirst:{{Trim|{{{1|}}} {{{2|}}}}}}}" title="{{ucFirst:{{Trim|{{{1|}}} {{{2|}}}}}}}"><span class="background"><span class="letter-1"{{#if:{{{3|}}}|<nowiki/> style="color: {{{3}}}"}}>{{#ifexpr:{{#len:{{{line1|}}}}} and {{#len:{{{big|}}}}} > 0
| {{uc:{{{1|}}}}}</span>
| {{uc:{{{1|}}}}}</span>
| {{#sub:{{uc:{{{1|}}}}}|0|1}}</span>{{#if:{{{big|}}}|{{#sub:{{uc:{{{1|}}}}}|1}}}}
| {{#sub:{{uc:{{{1|}}}}}|0|1}}</span>{{#if:{{{big|}}}|{{#sub:{{uc:{{{1|}}}}}|1}}}}
Line 16: Line 16:
* firstLetterColor: (Optional, default <tt>blue</tt>) CSS color
* firstLetterColor: (Optional, default <tt>blue</tt>) CSS color
* link: (Optional, default empty) icon link
* link: (Optional, default empty) icon link
* size: (Optional, default 1) size factor
* big: (Optional, default empty) if filled, shows the wide version of this icon (with full text) and unlocks the following parameters.
* big: (Optional, default empty) if filled, shows the wide version of this icon (with full text) and unlocks the following parameters.
* width: (Optional, default 1) width factor
* width: (Optional, default 1) width factor
Line 49: Line 50:
| <tt><nowiki>{{Icon2|server|execution|green}}</nowiki></tt>
| <tt><nowiki>{{Icon2|server|execution|green}}</nowiki></tt>
| {{Icon2|server|execution|green}}
| {{Icon2|server|execution|green}}
|-
| <tt><nowiki>{{Icon2|server|execution|green|size=2}}</nowiki></tt>
| {{Icon2|server|execution|green|size=2}}
|-
|-
! colspan="2" | the following presentations need the ''big'' argument
! colspan="2" | the following presentations need the ''big'' argument
Line 54: Line 58:
| <tt><nowiki>{{Icon2|global|argument|darkorange|big=y}}</nowiki></tt>
| <tt><nowiki>{{Icon2|global|argument|darkorange|big=y}}</nowiki></tt>
| {{Icon2|global|argument|darkorange|big=y}}
| {{Icon2|global|argument|darkorange|big=y}}
|-
| <tt><nowiki>{{Icon2|global|argument|darkorange|big=y|size=3}}</nowiki></tt>
| {{Icon2|global|argument|darkorange|big=y|size=3}}
|-
|-
| <tt><nowiki>{{Icon2|N/A|effect|grey|big=y|line1=y}}</nowiki></tt>
| <tt><nowiki>{{Icon2|N/A|effect|grey|big=y|line1=y}}</nowiki></tt>

Revision as of 02:48, 1 March 2021

Template Icon2 - should appear inline LALocal when in a paragraph.

Usage

{{Icon2|firstWord|secondWord|secondLetterColor|link=|big=|width=|line1=|line2=}}

  • firstWord: first letter word, e.g "argument"
  • secondWord: second letter word, e.g "local"
  • firstLetterColor: (Optional, default blue) CSS color
  • link: (Optional, default empty) icon link
  • size: (Optional, default 1) size factor
  • big: (Optional, default empty) if filled, shows the wide version of this icon (with full text) and unlocks the following parameters.
  • width: (Optional, default 1) width factor
  • line1: (Optional, default empty) if filled, colours and resize the whole first line
  • line2: (Optional, default empty) if filled, colours and resize the whole second line
Examples
Code Result
{{Icon2}} -no arguments provided-
{{Icon2|local|argument|blue}} LALocal
{{Icon2|N/A|argument|grey}} NAN/A
{{Icon2|global|argument|darkorange}} GAGlobal
{{Icon2|local|effect|blue}} LELocal
{{Icon2|N/A|effect|grey}} NEN/A
{{Icon2|global|effect|darkorange}} GEGlobal
{{Icon2|server|execution|green}} SEServer
{{Icon2|server|execution|green|size=2}} SEServer
the following presentations need the big argument
{{Icon2|global|argument|darkorange|big=y}} GLOBAL
ARGUMENT
{{Icon2|global|argument|darkorange|big=y|size=3}} GLOBAL
ARGUMENT
{{Icon2|N/A|effect|grey|big=y|line1=y}} N/A
EFFECT
{{Icon2|smol|box|red|big=y|width=0.5}} SMOL
BOX
{{Icon2|loc|arg|big=y|width=0.5}} LOC
ARG
{{Icon2|loc|arg|big=y|width=0.75}} LOC
ARG
{{Icon2|loc|arg|big=y|width=0.75|line1=y}} LOC
ARG
{{Icon2|loc|arg|big=y|width=0.75|line2=y}} LOC
ARG
{{Icon2|loc|arg|big=y|width=0.75|line1=y|line2=y}} LOC
ARG
{{Icon2|server|execution|green|big=y|link=Multiplayer Scripting}} SERVER
EXECUTION
{{Icon2|server|execution|green|big=y|width=1.5|link=Multiplayer Scripting}} SERVER
EXECUTION