Template:Hero card2: Difference between revisionsGive feedback
m Reduced intensity of box shadow |
hero card redesign |
||
| (35 intermediate revisions by 11 users not shown) | |||
| Line 1: | Line 1: | ||
< | <templatestyles src="Template:Hero card2/styles.css" /><includeonly><!-- | ||
vars: | |||
heroName (1) / default Abrams | |||
</div> | cardSize | ||
</div> | textSize | ||
</ | isHeroLabs | ||
overrideDisplayName | |||
overrideLinkTooltip | |||
overrideLinkImage | |||
overrideLinkClick | |||
-->{{#vardefine:heroName|{{{heroName|{{{1|Abrams}}}|}}}}}<!-- | |||
-->{{#vardefine:cardSize|{{{cardSize|130}}}}}<!-- | |||
-->{{#vardefine:imageSize|{{#expr: ({{#var:cardSize}} * 0.923) round 0 }}}}<!-- | |||
-->{{#vardefine:textSize|{{{textSize|24}}}}}<!-- | |||
-->{{#vardefine:isHeroLabs|{{#ifeq:{{{isHeroLabs|false}}}|true|HeroLabs}}}}<!-- | |||
-->{{#vardefine:displayName|{{#invoke:Lang|get_string|{{#invoke:HeroData|get_hero_key|{{#var:heroName}}}}}}}}<!-- | |||
-->{{#vardefine:displayName|{{#if:{{#var:displayName}}|{{#var:displayName}}|{{#var:heroName}}}}}}<!-- | |||
-->{{#vardefine:displayName|{{{overrideDisplayName|{{#var:displayName}}}}}}}<!-- | |||
-->{{#vardefine:linkTooltip|{{{overrideLinkTooltip|{{#var:heroName}}}}}}}<!-- | |||
-->{{#vardefine:linkImage|{{{overrideLinkImage|{{#var:heroName}}}}}}}<!-- | |||
-->{{#vardefine:linkClick|{{{overrideLinkClick|{{#var:heroName}}{{If lang}}}}}}}<!-- | |||
--> | |||
<div class="HeroCard {{#var:isHeroLabs}}" style="width:{{#var:cardSize}}px;"> | |||
<div class="CardBacker"></div> | |||
<div class="HeroImage">[[File:{{#var:linkImage}}_vertical.png|{{#var:imageSize}}px|link=]]</div> | |||
<div class="HeroLabsSticker"></div> | |||
<div class="CardShape"></div> | |||
<div class="GradiantOverlay"></div> | |||
<p class="HeroLabsText">{{#invoke:Lang|get_string|MyRosterHeroLabsHero|fallback_str=en}}</p> | |||
<p class="HeroName" style="--text-size:{{#var:textSize}}px;">{{#var:displayName}}</p> | |||
<div class="hero-link-wrapper" data-hero-name="{{#var:linkTooltip}}">[[{{#var:linkClick}}|<span></span>]]</div> | |||
</div></includeonly><noinclude>{{Documentation}}</noinclude> | |||
Latest revision as of 15:15, 22 May 2026
Usage
[edit source]This template is used in Template:Hero Navbox. It is called by Module:HeroData/nav.
Examples
[edit source]{{Hero card2|Lash}}
{{Hero card2|Lash|overrideDisplayName=Jacob}}
{{Hero card2|Lash|overrideLinkTooltip=Abrams}}
{{Hero card2|Lash|overrideLinkImage=Abrams}}
{{Hero card2|Lash|overrideLinkClick=Abrams}}
{{Hero card2|Lash|cardSize=88}}
{{Hero card2|Lash|textSize=13}}
{{Hero card2|Lash|isHeroLabs=true}}
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Hero Name | heroName 1 | English name of the hero. If no overrides are used then the input value is used to: Set the name on the card (localization gets applied when appropriate), Set the image (heroName._vertical.png), Set the tooltip (localization gets applied when appropriate) and Set where the card links to when clicked (localized subpage get applied when appropriate)
| String | required |
| Card Size | cardSize | Size of the hero card. Dont put 'px' at the end
| Number | optional |
| Text Size | textSize | Size of the text on the card. Dont put 'px' at the end.
| Number | optional |
| Is Hero Labs | isHeroLabs | Shows a hero labs sticker on the card and hero labs text, if enabled.
| Boolean | optional |
| Override Display Name | overrideDisplayName | Overrides the name that is displayed on the card.
| String | optional |
| Override Link Tooltip | overrideLinkTooltip | Overrides the link from where the tooltip gets its info. Don't include localization subpage, the tooltip adds it automatically when appropriate.
| String | optional |
| Override Link Image | overrideLinkImage | Overrides the link from where the hero card gets the image. '_vertical.png' is suffixed to the override string.
| String | optional |
| Override Link Click | overrideLinkClick | Overrides where the hero card links to when clicked on. Localization subpage is NOT added automatically to the override string.
| String | optional |

