1.4 KiB · text History da3a685
{# A compact topic square (subcategory columns, home tiles). `href` opens
   the reader; when `reader_swap` the swap is limited to #reader. #}
<a href="{{ href }}"
   {% if reader_swap %}hx-get="{{ href }}" hx-target="#reader" hx-select="#reader" hx-swap="outerHTML" hx-push-url="true"{% endif %}
   id="square-{{ t.id }}" data-topic="{{ t.id }}"
   title="{{ t.title }} · {{ t.replies }} replies · {{ t.bumped_at }}"
   aria-label="Read {{ t.title }}"
   class="group/tile relative flex aspect-square flex-col justify-between overflow-hidden rounded-field border border-base-300 bg-base-100 p-1.5 shadow-sm transition-all duration-150 hover:-translate-y-0.5 hover:border-primary/60 hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary">
  <span class="absolute inset-x-0 top-0 h-0.5" style="background: {{ t.cat_widget_bg }}" aria-hidden="true"></span>
  <span class="line-clamp-4 text-[0.65rem] font-medium leading-tight">{% if t.is_pinned %}<i class="fas fa-thumbtack text-accent mr-0.5"></i>{% endif %}{{ t.title }}</span>
  <span class="flex items-center justify-between font-mono text-[0.6rem] opacity-60">
    <span>{{ t.replies }}<i class="fas fa-reply ml-0.5" aria-hidden="true"></i></span>
    {% if t.is_new or t.unread > 0 %}<span class="size-2 rounded-full bg-primary" title="{% if t.is_new %}new{% else %}{{ t.unread }} unread{% endif %}"></span>{% endif %}
  </span>
</a>