P0: x-cloak aktiv + Emojis durch Inline-SVG-Icons ersetzt

- base.html: [x-cloak]-CSS gegen Alpine-Flackern
- Neues zentrales Icon-Makro-Template (icons.html, Heroicons-Stil,
  currentColor, aria-hidden)
- Logo-Würfelbecher, Sync-Pfeile, Sortier-Chevrons, Warn-/Check-Icons,
  dedup-Karten (Gebäude/Tag/Buch/Dokument), Cover-Platzhalter als SVG
- Cover-Platzhalter: 'Kein Cover'-Text in Großansicht, Mindestgröße
  48x68 px in der Kartenansicht
This commit is contained in:
Flo Hartmann
2026-08-26 08:33:37 +00:00
parent 929cea1887
commit e1ef7ba926
13 changed files with 181 additions and 49 deletions

View File

@@ -7,11 +7,14 @@
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.9/dist/cdn.min.js"></script>
<style>[x-cloak] { display: none !important; }</style>
</head>
<body class="bg-slate-100 text-slate-800 min-h-screen flex flex-col">
<header class="bg-white border-b border-slate-200" x-data="{ menue: false }">
<nav class="max-w-6xl mx-auto px-4 py-2 md:py-3 flex items-center gap-5" aria-label="Hauptnavigation">
<a href="/" class="font-bold text-emerald-700 whitespace-nowrap">&#127923; {{ app_name }}</a>
<a href="/" class="font-bold text-emerald-700 whitespace-nowrap inline-flex items-center gap-1.5">
{% from "icons.html" import icon_wuerfelbecher %}{{ icon_wuerfelbecher("h-5 w-5") }} {{ app_name }}
</a>
<!-- Desktop: horizontale Navigationsleiste -->
<span class="hidden md:flex items-center gap-5 flex-1">
{% for eintrag in plugin_nav %}
@@ -35,7 +38,8 @@
{% if user %}
<button type="button" @click="offen = !offen"
class="text-sm font-medium px-2 py-1 rounded hover:bg-slate-100 inline-flex items-center min-h-[44px] md:min-h-0">
{{ user.display_name }} &#9662;
{{ user.display_name }}
{% from "icons.html" import icon_chevron_unten %}{{ icon_chevron_unten("h-3.5 w-3.5") }}
</button>
<div x-show="offen" x-cloak @click.outside="offen = false"
class="absolute right-0 mt-2 w-56 bg-white border border-slate-200 rounded-lg shadow-lg p-3 text-sm z-10">

View File

@@ -0,0 +1,101 @@
{# Zentrale Inline-SVG-Icons (Heroicons-Stil, Outline).
Alle Icons sind dekorativ: aria-hidden + focusable=false, Farbe über
currentColor. Aufruf: {% from "icons.html" import icon_refresh %}
{{ icon_refresh("h-4 w-4") }} #}
{% macro _svg(klasse, pfad) -%}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.8" stroke="currentColor" class="{{ klasse }}"
aria-hidden="true" focusable="false">
<path stroke-linecap="round" stroke-linejoin="round" d="{{ pfad }}"/>
</svg>
{%- endmacro %}
{% macro icon_wuerfelbecher(klasse="h-5 w-5") -%}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.8" stroke="currentColor" class="{{ klasse }}"
aria-hidden="true" focusable="false">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.5 3.5h11l-1.6 13.2a2.4 2.4 0 0 1-2.4 2.2h-3a2.4 2.4 0 0 1-2.4-2.2L6.5 3.5z"/>
<path stroke-linecap="round" stroke-linejoin="round" d="M6 7.5h12"/>
<circle cx="10.2" cy="12" r="0.4" fill="currentColor"/>
<circle cx="13.8" cy="12" r="0.4" fill="currentColor"/>
<circle cx="12" cy="14.8" r="0.4" fill="currentColor"/>
</svg>
{%- endmacro %}
{% macro icon_wuerfel(klasse="h-6 w-6") -%}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.8" stroke="currentColor" class="{{ klasse }}"
aria-hidden="true" focusable="false">
<rect x="3.5" y="3.5" width="17" height="17" rx="3.5"/>
<circle cx="8.4" cy="8.4" r="0.5" fill="currentColor"/>
<circle cx="15.6" cy="8.4" r="0.5" fill="currentColor"/>
<circle cx="12" cy="12" r="0.5" fill="currentColor"/>
<circle cx="8.4" cy="15.6" r="0.5" fill="currentColor"/>
<circle cx="15.6" cy="15.6" r="0.5" fill="currentColor"/>
</svg>
{%- endmacro %}
{% macro icon_sync(klasse="h-4 w-4") -%}
{{ _svg(klasse, "M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99") }}
{%- endmacro %}
{% macro icon_pfeil_rechts(klasse="h-4 w-4") -%}
{{ _svg(klasse, "M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3") }}
{%- endmacro %}
{% macro icon_warnung(klasse="h-4 w-4") -%}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.8" stroke="currentColor" class="{{ klasse }}"
aria-hidden="true" focusable="false">
<path stroke-linecap="round" stroke-linejoin="round"
d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"/>
</svg>
{%- endmacro %}
{% macro icon_check(klasse="h-4 w-4") -%}
{{ _svg(klasse, "M4.5 12.75l6 6 9-13.5") }}
{%- endmacro %}
{% macro icon_gebaeude(klasse="h-5 w-5") -%}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.8" stroke="currentColor" class="{{ klasse }}"
aria-hidden="true" focusable="false">
<path stroke-linecap="round" stroke-linejoin="round"
d="M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z"/>
</svg>
{%- endmacro %}
{% macro icon_tag(klasse="h-5 w-5") -%}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.8" stroke="currentColor" class="{{ klasse }}"
aria-hidden="true" focusable="false">
<path stroke-linecap="round" stroke-linejoin="round"
d="M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"/>
<path stroke-linecap="round" stroke-linejoin="round" d="M6 6h.008v.008H6V6z"/>
</svg>
{%- endmacro %}
{% macro icon_buch(klasse="h-5 w-5") -%}
{{ _svg(klasse, "M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25") }}
{%- endmacro %}
{% macro icon_dokument(klasse="h-5 w-5") -%}
{{ _svg(klasse, "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z") }}
{%- endmacro %}
{% macro icon_chevron_unten(klasse="h-3.5 w-3.5") -%}
{{ _svg(klasse, "M19.5 8.25l-7.5 7.5-7.5-7.5") }}
{%- endmacro %}
{% macro icon_chevron_oben(klasse="h-3.5 w-3.5") -%}
{{ _svg(klasse, "M4.5 15.75l7.5-7.5 7.5 7.5") }}
{%- endmacro %}
{% macro icon_chevron_links(klasse="h-4 w-4") -%}
{{ _svg(klasse, "M15.75 19.5L8.25 12l7.5-7.5") }}
{%- endmacro %}
{% macro icon_chevron_rechts(klasse="h-4 w-4") -%}
{{ _svg(klasse, "M8.25 4.5l7.5 7.5-7.5 7.5") }}
{%- endmacro %}

View File

@@ -8,7 +8,7 @@
</head>
<body class="bg-slate-100 text-slate-800 min-h-screen flex items-center justify-center px-4">
<div class="bg-white shadow-md rounded-xl p-8 w-full max-w-sm">
<h1 class="text-xl font-bold mb-1">&#127923; {{ app_name }}</h1>
<h1 class="text-xl font-bold mb-1 flex items-center gap-2">{% from "icons.html" import icon_wuerfelbecher %}{{ icon_wuerfelbecher("h-6 w-6 text-emerald-700") }} {{ app_name }}</h1>
<p class="text-sm text-slate-500 mb-6">Bitte anmelden.</p>
{% if fehler %}
<div class="mb-4 rounded-lg border border-red-300 bg-red-50 text-red-700 text-sm px-3 py-2" role="alert">