{# Shared bits. Rank colours match the map markers in assets/f/js/map.js. #}
{% macro rank_icon(rank) -%}
{%- if rank == "obsessed" %}fa-fire{% elif rank == "always" %}fa-heart{% elif rank == "positive" %}fa-thumbs-up{% elif rank == "neutral" %}fa-minus{% elif rank == "never" %}fa-ban{% else %}fa-question{% endif -%}
{%- endmacro %}
{# Full class names, never built by concatenation: Tailwind only keeps classes
it can find spelled out in templates, so "btn-" ~ color would be purged. #}
{% macro rank_btn(rank) -%}
{%- if rank == "obsessed" %}btn-warning{% elif rank == "always" %}btn-success{% elif rank == "positive" %}btn-accent{% elif rank == "neutral" %}btn-neutral{% elif rank == "never" %}btn-error{% else %}btn-ghost{% endif -%}
{%- endmacro %}
{% macro rank_badge_class(rank) -%}
{%- if rank == "obsessed" %}badge-warning{% elif rank == "always" %}badge-success{% elif rank == "positive" %}badge-accent{% elif rank == "neutral" %}badge-neutral{% elif rank == "never" %}badge-error{% else %}badge-ghost{% endif -%}
{%- endmacro %}
{% macro rank_badge(rank, since=none) -%}
{%- if rank -%}
<span class="badge {{ rank_badge_class(rank) }} gap-1"><i class="fas {{ rank_icon(rank) }}"></i> <span class="capitalize">{{ rank }}</span>{% if since %} since {{ since }}{% endif %}</span>
{%- else -%}
<span class="badge badge-ghost gap-1 opacity-70">unranked</span>
{%- endif -%}
{%- endmacro %}
{% macro map_legend() -%}
<p class="flex flex-wrap gap-3 text-xs opacity-80">
<span><span class="inline-block size-2.5 rounded-full" style="background:#ea580c"></span> obsessed</span>
<span><span class="inline-block size-2.5 rounded-full" style="background:#16a34a"></span> always</span>
<span><span class="inline-block size-2.5 rounded-full" style="background:#84cc16"></span> positive</span>
<span><span class="inline-block size-2.5 rounded-full" style="background:#a8a29e"></span> neutral</span>
<span><span class="inline-block size-2.5 rounded-full" style="background:#dc2626"></span> never</span>
<span><span class="inline-block size-2.5 rounded-full" style="background:#3b82f6"></span> not ranked by you</span>
</p>
{%- endmacro %}
neiam
/fieri-forever
the flavortown lunch engine
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
2.1 KiB · text
History
504ebaf