-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update snapshots and fix some minor formatting issues
- Loading branch information
1 parent
76c7d10
commit c62fb88
Showing
6 changed files
with
5,050 additions
and
3,526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,58 @@ | ||
{% macro render_icon(item_or_texture, name="") -%} | ||
{% if item_or_texture.gaslighting is defined %} | ||
{{ render_item(item_or_texture) }} | ||
{% else %} | ||
{{ | ||
render_texture( | ||
name=name, | ||
texture=item_or_texture, | ||
class_names=[], | ||
) | ||
}} | ||
{% endif %} | ||
{{- render_item(item_or_texture) -}} | ||
{% else %} | ||
{{- render_texture(name, item_or_texture) -}} | ||
{% endif %} | ||
{%- endmacro %} | ||
|
||
{% macro render_texture(name, texture, class_names=[], lazy=true) -%} | ||
{% if texture.meta is defined %} | ||
{% if texture.meta is defined -%} | ||
<div | ||
role="img" | ||
title="{{ name }}" | ||
aria-label="Animated image of {{ name }}" | ||
class="{{ (class_names + ['texture', 'animated-sync', texture.class_name])|join(' ') }}" | ||
></div> | ||
{% else %} | ||
{%- else -%} | ||
<img | ||
title="{{ name }}" | ||
alt="Image of {{ name }}" | ||
src="{{ texture.url }}" | ||
{{ 'loading="lazy"'|safe if lazy }} | ||
class="{{ (class_names + ['texture'])|join(' ') }}" | ||
> | ||
{% endif %} | ||
{%- endif %} | ||
{%- endmacro %} | ||
|
||
{# display a single item, with a badge if the count is greater than 1 #} | ||
{% macro render_item(item, is_first=true, count=1) -%} | ||
{% if item.gaslighting %} | ||
<div class="texture item-texture multi-textures gaslight-textures {{ 'multi-texture-active' if is_first }}"> | ||
{% macro render_item(item, is_first=none, count=1) -%} | ||
{% if item.gaslighting -%} | ||
<div class="texture item-texture multi-textures gaslight-textures {{ 'multi-texture-active' if is_first is true }}"> | ||
{% for texture in item.textures %} | ||
{{ | ||
render_texture( | ||
name=item.name, | ||
texture=texture, | ||
class_names=[ | ||
"item-texture", | ||
"multi-texture-active" if is_first, | ||
"multi-texture-active" if loop.first, | ||
], | ||
) | ||
}} | ||
{% endfor %} | ||
</div> | ||
{% else %} | ||
{{ | ||
render_texture( | ||
name=item.name, | ||
texture=item.texture, | ||
class_names=[ | ||
"item-texture", | ||
"multi-texture-active" if is_first, | ||
], | ||
) | ||
}} | ||
{% endif %} | ||
{% if count > 1 %} | ||
{%- else -%} | ||
{{ render_texture( | ||
name=item.name, | ||
texture=item.texture, | ||
class_names=[ | ||
"item-texture", | ||
"multi-texture-active" if is_first is true, | ||
], | ||
) }} | ||
{%- endif -%} | ||
{% if count > 1 -%} | ||
<div class="badge">{{ count }}</div> | ||
{% endif %} | ||
{%- endif %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.