Template:Main Page/Card: Difference between revisions

mNo edit summary
Added "icon" and "invert" parameters
 
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--><div class="mp-card"><!--
--><div class="mp-card"><!--
   --><div class="mp-card-image">[[File:{{{image|}}}.{{{ext|png}}}|60x60px|alt=|link={{{link|}}}]]</div><!--
   --><div class="mp-card-image"><!--
    -->[[File:{{{image|{{{icon|Unknown}}} Icon}}}.{{{ext|png}}}|60x60px|alt={{{text|{{{link|}}}}}}|link={{{link|}}}<!--
  -->|class={{#switch:{{lc:{{{invert|}}}}}<!--
          -->|day|light=day-invert-image<!--
  -->|night|dark=night-invert-image<!--
  -->|#default=<!--
  -->}}<!--
-->]]<!--
  --></div><!--
   --><div class="mp-card-text">[[{{{link|}}}|{{{text|{{{link|}}}}}}]]</div><!--
   --><div class="mp-card-text">[[{{{link|}}}|{{{text|{{{link|}}}}}}]]</div><!--
--></div></includeonly><noinclude>{{Documentation|type=Main Page|content=
--></div></includeonly><noinclude>{{Documentation|type=Main Page|content=
Line 9: Line 17:
==Syntax==
==Syntax==
<syntaxhighlight lang="wikitext" copy>
<syntaxhighlight lang="wikitext" copy>
{{Main Page/Card|image = |link = |text = }}
{{Main Page/Card|icon = |link = |text = }}
</syntaxhighlight>
</syntaxhighlight>
* {{F|icon}} &ndash; Icon for the card {{Color|Old|excluding}} the file extension. Shorthand for images with the {{F|Icon}} suffix.
* {{F|image}} &ndash; Image for the card {{Color|Old|excluding}} the file extension.
* {{F|image}} &ndash; Image for the card {{Color|Old|excluding}} the file extension.
* {{F|ext}} &ndash; Extension of the image. Default: {{F|png}}.
* {{F|ext}} &ndash; Extension of the image. Default: {{F|png}}.
* {{F|link}} &ndash; Link of the card.
* {{F|link}} &ndash; Link of the card.
* {{F|text}} &ndash; Text displayed on the highlight card. Default: {{F|link|v=1}}.
* {{F|text}} &ndash; Text displayed on the card. Default: {{F|link|v=1}}.
* {{F|invert}} &ndash; Set to apply a filter to the image for either day/light or night/dark mode. Available values:
** {{F|Day}} &ndash; Invert the image in day/light mode. Will invert light-colored icons to gray in day/light mode.
** {{F|Night}} &ndash; Invert the image in night/dark mode. Will invert dark-colored icons to white in night/dark mode.


==Example==
==Example==
{{Example|<nowiki>
{{Example|<nowiki>
<div class="mp-navigation-wrapper mp-card-navigation">
<div class="mp-navigation-wrapper mp-card-navigation">
{{Main Page/Card|image = Kabuto Beetle Icon|link = Insect|text = Insects}}
{{Main Page/Card|icon = Kabuto Beetle|link = Insect|text = Insects}}
{{Main Page/Card|image = Sanke Koi Icon|link = Fish}}
{{Main Page/Card|icon = Sanke Koi|link = Fish}}
{{Main Page/Card|image = Bean-Shaped Fist Crab Icon|link = Shore-Dweller|text = Shore-Dwellers}}
{{Main Page/Card|icon = Hexia|link = Galaxy|text = Galaxies|invert = Day}}
{{Main Page/Card|image = CSS Logo|ext = svg|link = :File:CSS Logo.svg|text = CSS|invert = Night}}
</div>
</div>
</nowiki>}}
</nowiki>}}
Line 29: Line 42:
{
{
"params": {
"params": {
"icon": {
"label": "Icon",
"description": "Icon for the card excluding the file extension. Shorthand for files with the {{F|Icon}} suffix.",
"example": "Kabuto Beetle",
"type": "wiki-file-name",
"suggested": true
},
"image": {
"image": {
"label": "Image",
"label": "Image",
"description": "Image for the card excluding the file extension.",
"description": "Image for the card excluding the file extension.",
"example": "Kabuto Beetle Icon",
"example": "Kabuto Beetle Icon",
"type": "wiki-file-name",
"type": "wiki-file-name"
"required": true
},
},
"ext": {
"ext": {
Line 55: Line 74:
"type": "string",
"type": "string",
"default": "<link>"
"default": "<link>"
},
"invert": {
"label": "Invert",
"description": "Set to apply a filter to the image for either day/light or night/dark mode.",
"example": "Day, Night",
"type": "string"
}
}
},
},
"description": "Template that creates cards for the Main Page.",
"description": "Template that creates cards for the Main Page.",
"paramOrder": [
"paramOrder": [
"icon",
"image",
"image",
"ext",
"ext",
"link",
"link",
"text"
"text",
"invert"
],
],
"format": "inline"
"format": "inline"