Create Nunjucks macros for virtual pets

This commit is contained in:
Helen Chong 2024-08-10 01:17:44 +08:00
parent 58c8206afa
commit f2ef03e57e
1 changed files with 11 additions and 9 deletions

View File

@ -1,15 +1,17 @@
{%- macro virtualPet(url, img, alt, tooltip=alt) -%}
<li data-tooltip>
<a href="{{ url }}" data-tooltip-trigger title="{{ tooltip }}">
<img src="{{ img }}" alt="{{ alt }}" loading="lazy">
</a>
</li>
{%- endmacro -%}
<section class="content__section"> <section class="content__section">
<h2>Virtual Pets</h2> <h2>Virtual Pets</h2>
<p>Feel free to check out my virtual pets and feed them!</p> <p>Feel free to check out my virtual pets and feed them!</p>
<ul class="web-graphics adoptables"> <ul class="web-graphics adoptables">
<li data-tooltip> {{ virtualPet("https://tamanotchi.world/13150c", "https://tamanotchi.world/i2/13150", "Pix, my tamaNOTchi") }}
<a href="https://tamanotchi.world/13150c" data-tooltip-trigger title="Pix, my tamaNOTchi"><img src="https://tamanotchi.world/i2/13150" alt="Pix, my tamaNOTchi" loading="lazy"></a> {{ virtualPet("https://tamanotchi.world/14391c", "https://tamanotchi.world/i2/14391", "Neko, my tamaNOTchi") }}
</li> {{ virtualPet("https://wobble.town/visit/2042", "https://wobble.town/visit/2042/wobble.gif", "Shelly, my Wobble") }}
<li data-tooltip>
<a href="https://tamanotchi.world/14391c" data-tooltip-trigger title="Neko, my tamaNOTchi"><img src="https://tamanotchi.world/i2/14391" alt="Neko, my tamaNOTchi" loading="lazy"></a>
</li>
<li data-tooltip>
<a href="https://wobble.town/visit/2042" data-tooltip-trigger title="Shelly, my Wobble"><img src="https://wobble.town/visit/2042/wobble.gif" alt="Shelly, my Wobble" loading="lazy"></a>
</li>
</ul> </ul>
</section> </section>