Difference between revisions of "Template:GridBlank"

From TerraFirmaCraft Wiki
Jump to: navigation, search
m (Protected "Template:GridBlank": This template is used by too many other templates to be changed. ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(Attempting to add animation to blank)
 
Line 1: Line 1:
<div class="grid-blank" style="vertical-align: {{#if: {{{2|}}} | {{{2}}} | bottom }}; background: none;" title="{{{title|}}}">{{#if: {{{1|}}} | [[File:Grid {{{1}}}.png|link={{{link|{{{1|}}}}}}]]}}</div><noinclude>
+
<span class="grid blank" {{ #if: {{{align|}}} | style="vertical-align: {{{align}}}" }}><span>{{
{{Grid/doc}}
+
  #if: {{{default|}}} | <span class="default-image">[[File:Grid {{{default}}}.png|alt=|link=]]</span>
[[Category:Image templates|G]]</noinclude>
+
}}{{#if: {{#pos: {{{1}}} | ; }} | <span class="animated" data-imgs="{{{1}}}" {{#if: {{{mod|}}} | data-mod="{{{mod}}}" }}> }}{{
 +
#vardefine: f | {{#explode: {{{1|}}} | ; }}
 +
}}{{
 +
#vardefine: mod | {{#if: {{#pos: {{#var: f}} | : }} | {{#explode: {{#var: f}} | : }} }}
 +
}}{{
 +
#vardefine: mod | {{
 +
  #switch: {{lc: {{#var: mod }} }}
 +
  | v | vanilla =
 +
  | {{#if: {{#var: mod }} | {{#var: mod }} | {{{mod|}}} }}
 +
  }}
 +
}}{{
 +
#vardefine: name | {{#explode: {{#if: {{#pos: {{#var: f }} | : }} | {{#explode: {{#var: f }} | : | 1 }} | {{#var: f }} }} | , }}
 +
}}{{
 +
#vardefine: img | {{#if: {{#var: mod }} | {{#var: name }} ({{#var: mod }}) | {{#var: name }} }}
 +
}}{{
 +
#vardefine: num | {{#explode: {{#var: f }} | , | 1 }}
 +
}}{{
 +
#vardefine: link | {{
 +
  #if: {{{title|}}}
 +
  |
 +
  | {{
 +
    #if: {{{link|}}}
 +
    | {{
 +
      #ifeq: {{lc: {{{link|}}} }}
 +
      | none |
 +
      | {{{link}}}
 +
      }}
 +
    | {{
 +
      #ifeq: {{#var: name }} | {{SUBPAGENAME}}
 +
      |
 +
      | {{
 +
        #if: {{#var: mod }}
 +
        | Mods/{{#var: mod }}/{{#var: name }}
 +
        | {{#var: img }}
 +
        }}
 +
      }}
 +
    }}
 +
  }}
 +
}}{{
 +
#vardefine: title | {{
 +
  #if: {{#var: name }} | {{
 +
    #if: {{{title|}}}
 +
    | {{
 +
      #ifeq: {{lc: {{{title}}} }}
 +
      | none |
 +
      | title="{{{title}}}"
 +
      }}
 +
    | {{
 +
      #if: {{{link|}}}
 +
      | {{
 +
        #ifeq: {{lc: {{{link}}} }}
 +
        | none | title="{{#var: img }}"
 +
        }}
 +
      | {{
 +
        #ifeq: {{#var: name }} | {{SUBPAGENAME}}
 +
        | title="{{#var: img }}"
 +
        }}
 +
      }}
 +
    }}
 +
  }}
 +
}}<span class="image {{#if: {{#pos: {{{1}}} | ; }} | active }} {{{imgclass|}}}" {{#var: title }}>{{
 +
#if: {{#var: name }}
 +
| [[File:Grid {{#var: img }}.png|alt={{
 +
  #if: {{{title|}}}
 +
  | {{
 +
    #ifeq: {{lc: {{{title}}} }} | none
 +
    | {{#var: img }}
 +
    | {{{title}}}
 +
    }}
 +
  | {{#var: img }}
 +
  }}|link={{#var: link }}]]{{
 +
  #iferror: {{ #expr: +{{#var: num }} }}
 +
  |
 +
  | {{
 +
    #ifexpr: {{#var: num }} > 1 and {{#var: num }} < 1000
 +
    | <span class="number" {{#var: title }}>{{
 +
      #if: {{#var: link }}
 +
      | [[{{#var: link }}|{{#var: num }}]]
 +
      | {{#var: num }}
 +
      }}</span>
 +
    }}
 +
  }}
 +
|
 +
}}{{
 +
#if: {{#pos: {{{1}}} | ; }} </span>| </span> }}</span></span>
 +
<noinclude>[[Category:Image templates|G]]</noinclude>

Latest revision as of 00:54, 25 January 2016