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| | {{Main Page/Card|icon = |link = |text = }} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* {{F|icon}} – Icon for the card {{Color|Old|excluding}} the file extension. Shorthand for images with the {{F|Icon}} suffix. | |||
* {{F|image}} – Image for the card {{Color|Old|excluding}} the file extension. | * {{F|image}} – Image for the card {{Color|Old|excluding}} the file extension. | ||
* {{F|ext}} – Extension of the image. Default: {{F|png}}. | * {{F|ext}} – Extension of the image. Default: {{F|png}}. | ||
* {{F|link}} – Link of the card. | * {{F|link}} – Link of the card. | ||
* {{F|text}} – Text displayed on the | * {{F|text}} – Text displayed on the card. Default: {{F|link|v=1}}. | ||
* {{F|invert}} – Set to apply a filter to the image for either day/light or night/dark mode. Available values: | |||
** {{F|Day}} – Invert the image in day/light mode. Will invert light-colored icons to gray in day/light mode. | |||
** {{F|Night}} – 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| | {{Main Page/Card|icon = Kabuto Beetle|link = Insect|text = Insects}} | ||
{{Main Page/Card| | {{Main Page/Card|icon = Sanke Koi|link = Fish}} | ||
{{Main Page/Card|image = | {{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" | ||
}, | }, | ||
"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" | ||