Editing Template:ItemBox

Jump to navigation Jump to search
Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
<templatestyles src="Template:ItemBox/styles.css" /><includeonly>
<templatestyles src="Template:ItemBox/styles.css"/><includeonly><!--
 
-->{{#vardefine:item_key_or_en|{{{item_name|{{{1}}}}}}}}<!--
{{#vardefine:itemName|{{{itemName|{{{1}}}}}}}}<!--
-->{{#vardefine:tier|{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|Tier}}}}<!--
 
--><div class="HeroCard2" style="transition:0.1s transform ease-in-out;display:inline-block; margin-left:5px; border-radius:9px;">
    Display name: Lang string for the codename, else the raw name, then override.
{|- style="font-family:'Retail Demo Regular',serif; text-align:center; border-collapse:collapse; width:100px !important; position:relative;"
-->{{#vardefine:displayName|{{#invoke:Lang|get_string|{{#invoke:ItemData|get_codename|{{#var:itemName}}}}}}}}<!--
|<span class="item-link-wrapper" data-item-name="{{{item_name|{{{1}}}}}}"><div style="position:absolute; z-index:0; transform-origin: top; transform: scale(1, 1.1);">[[File:{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|Slot}} Card T{{#var:tier}}.png|100px|link={{#if:{{{link|}}}|{{{link}}}|{{{item_loc|{{{item_name|{{{1}}}}}}}}}}}]]</div></span><!--
-->{{#vardefine:displayName|{{#if:{{#var:displayName}}|{{#var:displayName}}|{{#var:itemName}}}}}}<!--
--><div style="position:relative; pointer-events:none;"><!--
-->{{#vardefine:displayName|{{{overrideDisplayName|{{#var:displayName}}}}}}}<!--
--><div class="paper-texture tex-1" style="position:absolute; z-index:5; mix-blend-mode:multiply; opacity:0.9;">[[File:Card PaperTexture 1.png|100px|link=]]</div><!--
 
--><div class="paper-texture tex-2" style="position:absolute; z-index:5; mix-blend-mode:multiply; opacity:0.9;">[[File:Card PaperTexture 2.png|100px|link=]]</div><!--
    Measured name size (cqw) and stable per-item texture variety.
--><div class="paper-texture tex-3" style="position:absolute; z-index:5; mix-blend-mode:multiply; opacity:0.9;">[[File:Card PaperTexture 3.png|100px|link=]]</div><!--
-->{{#vardefine:fontSize|{{#invoke:ItemBox|getFontSize|{{#var:displayName}}}}}}<!--
--><div class="paper-wear wear-1" style="position:absolute; z-index:6; mix-blend-mode:overlay; opacity:1; filter: sepia(70%)">[[File:Card PaperWear 1.png|100px|link=]]</div><!--
-->{{#vardefine:variants|{{#invoke:ItemBox|variants|{{#var:itemName}}}}}}<!--
--><div class="paper-wear wear-2" style="position:absolute; z-index:6; mix-blend-mode:overlay; opacity:0.8; filter: sepia(70%)">[[File:Card PaperWear 2.png|100px|link=]]</div><!--
 
--><div class="paper-wear wear-3" style="position:absolute; z-index:6; mix-blend-mode:overlay; opacity:1; filter: sepia(70%)">[[File:Card PaperWear 3.png|100px|link=]]</div><!--
    Modifier classes: slot (Weapon/Armor/Tech from data, or Weapon/Vitality/Spirit override -> weapon/vitality/spirit), tier, tags.
--><div class="paper-wear wear-4" style="position:absolute; z-index:6; mix-blend-mode:overlay; opacity:1; filter: sepia(70%)">[[File:Card PaperWear 4.png|100px|link=]]</div></div>
-->{{#vardefine:slot|{{#switch:{{{overrideSlot|{{#invoke:ItemData|get_prop|{{#var:itemName}}|Slot}}}}}|Weapon=itembox-weapon|Armor|Vitality=itembox-vitality|Tech|Spirit=itembox-spirit}}}}<!--
|- style="text-align:center; position:relative; pointer-events:none;"
-->{{#vardefine:tier|itembox-tier-{{{overrideTier|{{#invoke:ItemData|get_prop|{{#var:itemName}}|Tier}}}}}}}<!--
| <span class="item-card-icon" style="transition:0.1s transform ease-in-out; position:relative; bottom:-1px;">[[File:{{{item_name|{{{1}}}}}}.png|96px|link=]]</span>{{#if:{{{ignore|}}}||{{#ifeq: {{#invoke:ItemData|is_active|{{{item_name|{{{1}}}}}}}}|true|<div style="position:relative; display:flex; justify-content:center; align-items:center; z-index:6;"><div style="background-color:#161A13; color:#FFFFF5; border-radius:3px; padding:2px 2px; font-size:12px; margin:0; width:48px; height:16px; position:absolute; bottom:-9px; line-height:15px; letter-spacing:-0.5px; font-family:'Retail Demo Regular', serif;">'''ACTIVE'''</div></div>}}}}
-->{{#vardefine:showTierTag|{{#ifeq:{{{showTierTag|}}}|true|itembox-show-tier}}}}<!--
|- style="height:55px; font-size:14px; font-family:'Retail Demo Regular'; line-height:18px; position:relative; z-index:1; pointer-events:none; {{#ifexpr:{{#var:tier}} > 3|{{#switch: {{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|Slot}}
-->{{#vardefine:isActive|{{{overrideIsActive|{{#invoke:ItemData|is_active|{{#var:itemName}}}}}}}}}<!--
| Weapon = color: #e2c5a1 !important;
-->{{#vardefine:isActive|{{#ifeq:{{#var:isActive}}|true|itembox-active}}}}<!--
| Armor = color: #b8dcc4 !important;
-->{{#vardefine:isImbue|{{{overrideIsImbue|{{#invoke:ItemData|get_prop|{{#var:itemName}}|IsImbue}}}}}}}<!--
| Tech = color: #ccbfda !important;
-->{{#vardefine:isImbue|{{#ifeq:{{#var:isImbue}}|true|itembox-imbue}}}}<!--
| color: #000000;}}|color: #11140e; !important}}"
 
! style="padding: 0 4px;" |{{{item_loc|{{{item_name|{{{1}}}}}}}}}
    lowGraphics=true is for callers that place dozens of cards on one page (the
|}</div></includeonly><noinclude>{{Documentation}}</noinclude>
    card navboxes). It swaps the paper texture from the normal-mode multiply,
    which blends two images and so is re-rasterised every scrolled frame, to a
    transparent-paper overlay that is a single cacheable image. On the profiled
    navbox this took the render thread's OpenGL work from ~230 ms/s to ~10 and
    roughly doubled the frame rate. The wear and icon masks are clips of a
    single image, not blends, so they cache once rasterised and stay at full
    detail. The overlay itself is defined in [[Template:ItemBox/styles.css]] and
    keyed off the same per-item texture-vN class, so a card keeps its paper
    across both modes.
-->{{#vardefine:lowGraphics|{{#ifeq:{{{lowGraphics|}}}|true|itembox-lowgfx}}}}<!--
 
    Links.
-->{{#vardefine:linkTooltip|{{{overrideLinkTooltip|{{#var:itemName}}}}}}}<!--
-->{{#vardefine:linkImage|{{{overrideLinkImage|{{#var:itemName}}}}}}}<!--
-->{{#vardefine:linkClick|{{{overrideLinkClick|{{#var:itemName}}{{If lang}}}}}}}<!--
 
--><div class="itembox {{#var:showTierTag}} {{#var:tier}} {{#var:slot}} {{#var:isActive}} {{#var:isImbue}} {{#var:variants}} {{#var:lowGraphics}}" style="font-size:{{#expr: 10 * {{#if:{{{size|}}}|{{{size}}}|1}} }}px;">
<div class="itembox-background">
<div class="itembox-card">
<div class="itembox-icon-area">
<div class="itembox-icon">[[File:{{#var:linkImage}}.png|160px|link=]]</div>
<div class="itembox-tier-badge">
<div class="itembox-tier-badge-shadow"></div>
<div class="itembox-tier-badge-fill"></div>
<div class="itembox-tier-badge-number"></div>
</div>
<div class="itembox-imbue-tag">{{#invoke:Lang|get_string|item_info_imbue}}</div>
</div>
<!-- container-type is inline because TemplateStyles strips it; the name's cqw size measures against this box. -->
<div class="itembox-name-area" style="container-type: inline-size;">
<p class="itembox-name" style="font-size:{{#var:fontSize}};text-wrap:balance;">{{#var:displayName}}</p>
</div>
<div class="itembox-wear"></div>
<div class="itembox-texture"></div>
<div class="itembox-bevel"></div>
<div class="itembox-active-tag">{{#invoke:Lang|get_string|item_info_active}}</div>
<div class="itembox-outline"></div>
</div>
</div>
<div class="item-link-wrapper" data-item-name="{{#var:linkTooltip}}">[[{{#var:linkClick}}|<span></span>]]</div>
</div></includeonly><noinclude>{{Documentation}}</noinclude>
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template