Neues Erscheinungsbild: ruhig und erwachsen statt verspielt
Angelehnt an die Gestaltung der Ledder Werkstätten: - Farbpaar aus dunkler Hauptfarbe und Akzent (Standard Indigo/Pflaume), alle weiteren Töne daraus abgeleitet; weißer Grund, Lavendel-Flächen - Montserrat (selbst gehostet) statt Atkinson/Bricolage - Startseite: randloses Titelbild mit Akzentkreis, umlaufendem Text und Hinweis-Fahne; Platzhalter in der Markenfarbe statt Illustration - Bereiche als ruhige Pillen statt bunter Kacheln, Termine als Farbblock - Gesperrte Kleinzeilen mit Punktlinie, Punkt-Trenner in der Navigation - Redaktion: Akzentfarbe und Kreistext in den Einstellungen, Farbauswahl bei Kacheln/Seiten entfällt - Demo-Titelbilder als ruhige Farbflächen Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6f706dfa49
commit
562fa56228
44 changed files with 563 additions and 517 deletions
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<div class="max-w-md mx-auto text-center py-16 flex flex-col items-center gap-4">
|
||||
<div class="grid place-items-center size-20 rounded-3xl bg-brand-soft text-brand"><CircleHelp class="size-10" /></div>
|
||||
<h1 class="font-display text-3xl font-extrabold">{page.status === 404 ? 'Nicht gefunden' : 'Hoppla!'}</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink">{page.status === 404 ? 'Nicht gefunden' : 'Hoppla!'}</h1>
|
||||
<p class="text-ink-2">{page.error?.message ?? 'Da ist etwas schiefgelaufen.'}</p>
|
||||
<a href="/" class="btn btn-primary mt-2">Zur Startseite</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
const nav = [
|
||||
{ href: '/', label: 'Start', icon: House },
|
||||
{ href: '/meldungen', label: 'Meldungen', icon: Newspaper },
|
||||
{ href: '/meldungen', label: 'Aktuelles', icon: Newspaper },
|
||||
{ href: '/termine', label: 'Termine', icon: CalendarDays },
|
||||
{ href: '/merkliste', label: 'Merkliste', icon: Bookmark }
|
||||
];
|
||||
|
|
@ -37,85 +37,85 @@
|
|||
</a>
|
||||
|
||||
<div class="min-h-dvh flex flex-col">
|
||||
<header class="sticky top-0 z-30 safe-top bg-bg/80 backdrop-blur-xl border-b border-line/60">
|
||||
<div class="mx-auto max-w-5xl px-4 h-16 flex items-center gap-3">
|
||||
<header class="sticky top-0 z-30 safe-top bg-bg/95 backdrop-blur-md border-b border-line">
|
||||
<div class="mx-auto max-w-6xl px-4 h-16 lg:h-20 flex items-center gap-2">
|
||||
<a href="/" class="flex items-center gap-3 min-w-0 mr-auto" aria-label="{data.brand.appName} – Startseite">
|
||||
{#if data.brand.logo}
|
||||
<img src={data.brand.logo.thumb} alt="" class="h-10 w-auto max-w-32 object-contain" />
|
||||
<img src={data.brand.logo.thumb} alt="" class="h-10 lg:h-12 w-auto max-w-40 object-contain" />
|
||||
{:else}
|
||||
<span class="grid place-items-center size-10 rounded-xl bg-brand text-white font-display font-bold text-lg shadow-card">
|
||||
<span class="grid place-items-center size-10 rounded-full bg-brand text-on-brand font-bold text-lg">
|
||||
{data.brand.appName.slice(0, 1)}
|
||||
</span>
|
||||
{/if}
|
||||
<span class="min-w-0 leading-tight">
|
||||
<span class="block font-display font-bold text-[1.05rem] truncate">{data.brand.appName}</span>
|
||||
<span class="block font-bold text-[1.05rem] text-brand-ink truncate">{data.brand.appName}</span>
|
||||
<span class="block text-xs text-ink-3 truncate">{data.brand.orgName}</span>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="hidden lg:flex items-center gap-1" aria-label="Hauptnavigation">
|
||||
{#each nav as item (item.href)}
|
||||
<nav class="hidden lg:flex items-center mr-4" aria-label="Hauptnavigation">
|
||||
{#each nav as item, i (item.href)}
|
||||
{#if i > 0}<span aria-hidden="true" class="size-1.5 rounded-full bg-accent mx-3"></span>{/if}
|
||||
<a
|
||||
href={item.href}
|
||||
class="btn btn-sm {isActive(item.href) ? 'btn-soft' : 'btn-ghost'}"
|
||||
class="relative py-2 font-bold text-[0.95rem] {isActive(item.href) ? 'text-brand-ink' : 'text-ink-2 hover:text-brand-ink'}"
|
||||
aria-current={isActive(item.href) ? 'page' : undefined}
|
||||
>
|
||||
{item.label}
|
||||
{#if isActive(item.href)}<span class="absolute inset-x-0 -bottom-0.5 h-0.5 rounded-full bg-accent"></span>{/if}
|
||||
</a>
|
||||
{/each}
|
||||
</nav>
|
||||
|
||||
<a href="/suche" class="btn btn-ghost btn-icon" aria-label="Suche">
|
||||
<Search class="size-6" />
|
||||
<a href="/suche" class="btn btn-ghost btn-icon text-brand-ink" aria-label="Suche">
|
||||
<Search class="size-6" strokeWidth={2.25} />
|
||||
</a>
|
||||
<button class="btn btn-ghost btn-icon" aria-label="Menü öffnen" aria-expanded={menuOpen} onclick={() => (menuOpen = true)}>
|
||||
<Menu class="size-6" />
|
||||
<button class="btn btn-ghost btn-icon text-brand-ink" aria-label="Menü öffnen" aria-expanded={menuOpen} onclick={() => (menuOpen = true)}>
|
||||
<Menu class="size-7" strokeWidth={2.25} />
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="inhalt" class="flex-1 w-full mx-auto max-w-5xl px-4 pt-5 pb-32 lg:pb-16">
|
||||
<main id="inhalt" class="flex-1 w-full mx-auto max-w-6xl px-4 pt-6 pb-32 lg:pb-20">
|
||||
{@render children()}
|
||||
</main>
|
||||
|
||||
<footer class="hidden lg:block border-t border-line py-8 text-sm text-ink-3">
|
||||
<div class="mx-auto max-w-5xl px-4 flex flex-wrap gap-x-6 gap-y-2">
|
||||
<span>© {new Date().getFullYear()} {data.brand.orgName}</span>
|
||||
<a href="/kontakt" class="hover:text-ink">Kontakt</a>
|
||||
<a href="/impressum" class="hover:text-ink">Impressum</a>
|
||||
<a href="/datenschutz" class="hover:text-ink">Datenschutz</a>
|
||||
<a href="/admin" class="ml-auto hover:text-ink">Redaktion</a>
|
||||
<footer class="hidden lg:block bg-brand text-on-brand/80 py-10 text-sm">
|
||||
<div class="mx-auto max-w-6xl px-4 flex flex-wrap items-center gap-x-6 gap-y-2">
|
||||
<span class="font-bold text-on-brand">© {new Date().getFullYear()} {data.brand.orgName}</span>
|
||||
<a href="/kontakt" class="hover:text-on-brand">Kontakt</a>
|
||||
<a href="/impressum" class="hover:text-on-brand">Impressum</a>
|
||||
<a href="/datenschutz" class="hover:text-on-brand">Datenschutz</a>
|
||||
<a href="/admin" class="ml-auto hover:text-on-brand">Redaktion</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<!-- Untere Navigationsleiste (Handy) -->
|
||||
<nav
|
||||
class="lg:hidden fixed bottom-0 inset-x-0 z-30 safe-bottom bg-surface/90 backdrop-blur-xl border-t border-line/70"
|
||||
class="lg:hidden fixed bottom-0 inset-x-0 z-30 safe-bottom bg-surface/95 backdrop-blur-md border-t border-line"
|
||||
aria-label="Hauptnavigation"
|
||||
>
|
||||
<div class="mx-auto max-w-lg grid grid-cols-5 px-2">
|
||||
<div class="mx-auto max-w-lg grid grid-cols-5 px-1">
|
||||
{#each nav as item (item.href)}
|
||||
{@const active = isActive(item.href)}
|
||||
<a
|
||||
href={item.href}
|
||||
class="group flex flex-col items-center gap-0.5 pt-2 pb-2.5 text-[0.72rem] font-semibold {active ? 'text-brand-ink' : 'text-ink-3'}"
|
||||
class="flex flex-col items-center gap-1 pt-2.5 pb-2.5 text-[0.7rem] font-bold {active ? 'text-brand-ink' : 'text-ink-3'}"
|
||||
aria-current={active ? 'page' : undefined}
|
||||
>
|
||||
<span class="grid place-items-center h-8 w-14 rounded-full transition-colors {active ? 'bg-brand-soft' : 'group-hover:bg-surface-2'}">
|
||||
<item.icon class="size-[1.35rem]" strokeWidth={active ? 2.4 : 2} />
|
||||
</span>
|
||||
<item.icon class="size-6" strokeWidth={active ? 2.4 : 2} />
|
||||
{item.label}
|
||||
<span aria-hidden="true" class="size-1.5 rounded-full {active ? 'bg-accent' : 'bg-transparent'}"></span>
|
||||
</a>
|
||||
{/each}
|
||||
<button
|
||||
class="group flex flex-col items-center gap-0.5 pt-2 pb-2.5 text-[0.72rem] font-semibold text-ink-3"
|
||||
class="flex flex-col items-center gap-1 pt-2.5 pb-2.5 text-[0.7rem] font-bold text-ink-3"
|
||||
onclick={() => (menuOpen = true)}
|
||||
>
|
||||
<span class="grid place-items-center h-8 w-14 rounded-full group-hover:bg-surface-2">
|
||||
<Menu class="size-[1.35rem]" />
|
||||
</span>
|
||||
<Menu class="size-6" />
|
||||
Mehr
|
||||
<span aria-hidden="true" class="size-1.5"></span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -1,24 +1,38 @@
|
|||
import { asc } from 'drizzle-orm';
|
||||
import { and, asc, desc, eq, lte } from 'drizzle-orm';
|
||||
import { db } from '$lib/server/db';
|
||||
import { tiles } from '$lib/server/db/schema';
|
||||
import { posts, tiles } from '$lib/server/db/schema';
|
||||
import { getMedia, listPosts, upcomingEvents } from '$lib/server/content';
|
||||
import { getSettings } from '$lib/server/settings';
|
||||
import { addDays, today } from '$lib/dates';
|
||||
import { addDays, eventWhen, formatLong, today } from '$lib/dates';
|
||||
|
||||
/** Hinweis-Fahne auf dem Titelbild: anstehende Schließzeit hat Vorrang, sonst die angeheftete Meldung. */
|
||||
function highlight() {
|
||||
const t = today();
|
||||
const closure = upcomingEvents({ from: t, kind: 'closure', limit: 1 }).find((c) => c.startDate <= addDays(t, 14));
|
||||
if (closure) {
|
||||
const multi = closure.endDate && closure.endDate !== closure.startDate;
|
||||
return { eyebrow: 'Geschlossen', title: closure.title, text: multi ? eventWhen(closure) : formatLong(closure.startDate), href: '/termine?zeige=schliesszeiten' };
|
||||
}
|
||||
const pinned = db
|
||||
.select({ slug: posts.slug, title: posts.title, teaser: posts.teaser })
|
||||
.from(posts)
|
||||
.where(and(eq(posts.pinned, true), eq(posts.published, true), lte(posts.publishedAt, new Date())))
|
||||
.orderBy(desc(posts.publishedAt))
|
||||
.get();
|
||||
return pinned ? { eyebrow: 'Aktuell', title: pinned.title, text: pinned.teaser, href: `/meldungen/${pinned.slug}` } : null;
|
||||
}
|
||||
|
||||
export const load = () => {
|
||||
const s = getSettings();
|
||||
const t = today();
|
||||
return {
|
||||
greeting: s.greeting,
|
||||
intro: s.intro,
|
||||
heroEnabled: s.heroEnabled,
|
||||
// Ohne eigenes Bild wird der Platzhalter /hero-placeholder.svg gezeigt
|
||||
hero: getMedia(s.heroImageId),
|
||||
heroTagline: s.heroTagline,
|
||||
highlight: highlight(),
|
||||
tiles: db.select().from(tiles).orderBy(asc(tiles.sortOrder), asc(tiles.id)).all(),
|
||||
posts: listPosts({ limit: s.homeNewsCount }).items,
|
||||
events: upcomingEvents({ limit: s.homeEventsCount, kind: 'event' }),
|
||||
// Aktuelle Schließzeit (heute oder in den nächsten 14 Tagen) als Hinweis
|
||||
closures: upcomingEvents({ from: t, kind: 'closure', limit: 1 }).filter((c) => c.startDate <= addDays(t, 14))
|
||||
events: upcomingEvents({ limit: s.homeEventsCount })
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,116 +1,112 @@
|
|||
<script lang="ts">
|
||||
import ArrowRight from '@lucide/svelte/icons/arrow-right';
|
||||
import Search from '@lucide/svelte/icons/search';
|
||||
import DoorClosed from '@lucide/svelte/icons/door-closed';
|
||||
import CalendarPlus from '@lucide/svelte/icons/calendar-plus';
|
||||
import HomeHero from '$lib/components/HomeHero.svelte';
|
||||
import Tile from '$lib/components/Tile.svelte';
|
||||
import PostCard from '$lib/components/PostCard.svelte';
|
||||
import EventRow from '$lib/components/EventRow.svelte';
|
||||
import { formatLong, eventWhen, TZ } from '$lib/dates';
|
||||
import { dayOfMonth, eventWhen, monthAbbr, weekday } from '$lib/dates';
|
||||
|
||||
let { data } = $props();
|
||||
|
||||
const hour = Number(new Intl.DateTimeFormat('de-DE', { hour: 'numeric', hour12: false, timeZone: TZ }).format(new Date()));
|
||||
const daytime = hour < 11 ? 'Guten Morgen' : hour < 17 ? 'Hallo' : 'Guten Abend';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{data.brand.appName}</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="space-y-10">
|
||||
<!-- Begrüßung -->
|
||||
<section class="overflow-hidden rounded-[1.75rem] bg-brand text-white shadow-float">
|
||||
{#if data.heroEnabled}
|
||||
<div class="relative h-44 sm:h-64 lg:h-80">
|
||||
<img
|
||||
src={data.hero?.url ?? '/hero-placeholder.svg'}
|
||||
alt={data.hero?.alt ?? ''}
|
||||
class="size-full object-cover"
|
||||
fetchpriority="high"
|
||||
/>
|
||||
<!-- weicher Übergang ins Begrüßungsfeld -->
|
||||
<div aria-hidden="true" class="absolute inset-x-0 bottom-0 h-16 bg-gradient-to-b from-transparent to-brand"></div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="relative overflow-hidden px-6 pb-6 {data.heroEnabled ? 'pt-2' : 'pt-7'}">
|
||||
<div aria-hidden="true" class="absolute -right-16 -top-20 size-64 rounded-full bg-white/10"></div>
|
||||
<div aria-hidden="true" class="absolute right-10 -bottom-24 size-48 rounded-full bg-white/[0.07]"></div>
|
||||
<div class="relative">
|
||||
<p class="text-white/80 font-semibold">{daytime}!</p>
|
||||
<h1 class="font-display text-[1.9rem] sm:text-4xl font-extrabold mt-1 max-w-xl">{data.greeting}</h1>
|
||||
{#if data.intro}<p class="mt-3 text-white/85 max-w-xl">{data.intro}</p>{/if}
|
||||
<form action="/suche" class="mt-5 max-w-xl" role="search">
|
||||
<label class="flex items-center gap-2 rounded-2xl bg-white text-ink pl-4 pr-1.5 h-13 shadow-card">
|
||||
<Search class="size-5 text-ink-3 shrink-0" />
|
||||
<span class="sr-only">Suchen</span>
|
||||
<input name="q" type="search" placeholder="Was suchst du?" class="flex-1 min-w-0 bg-transparent outline-none h-full placeholder:text-ink-3" />
|
||||
<button class="btn btn-primary btn-sm">Suchen</button>
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
<div class="space-y-14 lg:space-y-20">
|
||||
{#if data.heroEnabled}
|
||||
<HomeHero image={data.hero} headline={data.greeting} tagline={data.heroTagline} highlight={data.highlight} />
|
||||
{:else}
|
||||
<h1 class="font-bold text-3xl sm:text-4xl text-brand-ink pt-4">{data.greeting}</h1>
|
||||
{/if}
|
||||
|
||||
<!-- Einleitung & Suche -->
|
||||
<section class="grid lg:grid-cols-2 gap-6 lg:gap-16 items-end [&>*]:min-w-0">
|
||||
<div class="space-y-3">
|
||||
<p class="eyebrow eyebrow-rule">{data.brand.orgName}</p>
|
||||
{#if data.intro}<p class="text-lg text-ink-2 max-w-xl">{data.intro}</p>{/if}
|
||||
</div>
|
||||
<form action="/suche" role="search">
|
||||
<label class="flex items-center gap-3 rounded-full bg-surface-2 pl-5 pr-1.5 h-15 focus-within:ring-4 focus-within:ring-brand/15 transition">
|
||||
<Search class="size-5 text-brand-ink shrink-0" strokeWidth={2.4} />
|
||||
<span class="sr-only">Suchen</span>
|
||||
<input name="q" type="search" placeholder="Was suchst du?" class="flex-1 min-w-0 bg-transparent outline-none h-full font-semibold placeholder:text-ink-3 placeholder:font-medium" />
|
||||
<button class="btn btn-primary">Suchen</button>
|
||||
</label>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{#each data.closures as c (c.id)}
|
||||
<a href="/termine" class="tone-amber bg-tone-soft text-tone-ink rounded-2xl p-4 flex items-center gap-4 -mt-4">
|
||||
<span class="grid place-items-center size-11 rounded-xl bg-tone text-white shrink-0"><DoorClosed class="size-5" /></span>
|
||||
<span>
|
||||
<span class="block font-bold">{c.title}</span>
|
||||
<span class="block text-sm">{c.endDate && c.endDate !== c.startDate ? eventWhen(c) : formatLong(c.startDate)}</span>
|
||||
</span>
|
||||
</a>
|
||||
{/each}
|
||||
|
||||
<!-- Kacheln -->
|
||||
<!-- Bereiche -->
|
||||
{#if data.tiles.length}
|
||||
<section aria-labelledby="bereiche">
|
||||
<h2 id="bereiche" class="sr-only">Bereiche</h2>
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3">
|
||||
<section aria-labelledby="bereiche" class="space-y-5">
|
||||
<div class="space-y-2">
|
||||
<p class="eyebrow eyebrow-rule">Bereiche</p>
|
||||
<h2 id="bereiche" class="text-2xl sm:text-3xl text-brand-ink">Was möchtest du wissen?</h2>
|
||||
</div>
|
||||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-2.5">
|
||||
{#each data.tiles as t (t.id)}
|
||||
<Tile href={t.href} label={t.label} icon={t.icon} color={t.color} />
|
||||
<Tile href={t.href} label={t.label} icon={t.icon} />
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<div class="grid lg:grid-cols-5 gap-10 lg:gap-8">
|
||||
<!-- Meldungen -->
|
||||
<section class="lg:col-span-3" aria-labelledby="neu">
|
||||
<div class="flex items-end justify-between mb-4">
|
||||
<h2 id="neu" class="font-display text-2xl font-bold">Neuigkeiten</h2>
|
||||
<a href="/meldungen" class="text-sm font-semibold text-brand-ink inline-flex items-center gap-1 hover:gap-2 transition-all">
|
||||
Alle <ArrowRight class="size-4" />
|
||||
</a>
|
||||
<!-- Neuigkeiten -->
|
||||
<section aria-labelledby="neu" class="space-y-5">
|
||||
<div class="flex items-end justify-between gap-4">
|
||||
<div class="space-y-2">
|
||||
<p class="eyebrow eyebrow-rule">Aktuelles</p>
|
||||
<h2 id="neu" class="text-2xl sm:text-3xl text-brand-ink">Neuigkeiten</h2>
|
||||
</div>
|
||||
{#if data.posts.length}
|
||||
<div class="space-y-3">
|
||||
<PostCard post={data.posts[0]} variant="hero" />
|
||||
{#each data.posts.slice(1) as p (p.id)}
|
||||
<PostCard post={p} />
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<p class="text-ink-3">Noch keine Meldungen.</p>
|
||||
{/if}
|
||||
</section>
|
||||
<a href="/meldungen" class="btn btn-soft btn-sm shrink-0">Alle <ArrowRight class="size-4" /></a>
|
||||
</div>
|
||||
{#if data.posts.length}
|
||||
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-8">
|
||||
{#each data.posts as p (p.id)}
|
||||
<PostCard post={p} />
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
<p class="text-ink-3">Noch keine Meldungen.</p>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<!-- Termine -->
|
||||
<section class="lg:col-span-2" aria-labelledby="termine">
|
||||
<div class="flex items-end justify-between mb-4">
|
||||
<h2 id="termine" class="font-display text-2xl font-bold">Nächste Termine</h2>
|
||||
<a href="/termine" class="text-sm font-semibold text-brand-ink inline-flex items-center gap-1 hover:gap-2 transition-all">
|
||||
Kalender <ArrowRight class="size-4" />
|
||||
</a>
|
||||
<!-- Termine als Farbblock -->
|
||||
<section aria-labelledby="termine" class="relative -mx-4 lg:mx-0 lg:rounded-[1.75rem] overflow-hidden bg-brand text-on-brand">
|
||||
<div aria-hidden="true" class="absolute -right-32 -bottom-40 size-[26rem] rounded-full bg-accent"></div>
|
||||
<div class="relative px-5 py-10 sm:px-8 lg:px-12 lg:py-14 grid lg:grid-cols-[1fr_1.4fr] gap-8 lg:gap-14">
|
||||
<div class="space-y-4">
|
||||
<p class="eyebrow text-on-brand/70">Termine</p>
|
||||
<h2 id="termine" class="text-3xl sm:text-4xl">Was steht an?</h2>
|
||||
<p class="text-on-brand/80 max-w-sm">Veranstaltungen, Versammlungen und Schließzeiten auf einen Blick.</p>
|
||||
<div class="flex flex-wrap gap-2 pt-2">
|
||||
<a href="/termine" class="btn bg-white text-brand hover:bg-white/90">Alle Termine</a>
|
||||
<a href="/termine.ics" class="btn text-on-brand hover:bg-white/10"><CalendarPlus class="size-4" />Kalender abonnieren</a>
|
||||
</div>
|
||||
</div>
|
||||
{#if data.events.length}
|
||||
<div class="space-y-2.5">
|
||||
<ul class="divide-y divide-white/15 border-y border-white/15">
|
||||
{#each data.events as e (e.id)}
|
||||
<EventRow event={e} />
|
||||
<li class="flex items-center gap-5 py-4">
|
||||
<span class="w-14 shrink-0 text-center leading-none" aria-hidden="true">
|
||||
<span class="block text-[0.7rem] font-semibold uppercase tracking-[0.15em] text-on-brand/70">{weekday(e.startDate)}</span>
|
||||
<span class="block text-3xl font-bold my-1">{dayOfMonth(e.startDate)}</span>
|
||||
<span class="block text-xs font-semibold uppercase tracking-wider text-on-brand/70">{monthAbbr(e.startDate)}</span>
|
||||
</span>
|
||||
<span class="min-w-0">
|
||||
{#if e.kind === 'closure'}
|
||||
<span class="inline-block rounded-full bg-accent px-2.5 py-0.5 text-[0.7rem] font-bold uppercase tracking-wider mb-1">Geschlossen</span>
|
||||
{/if}
|
||||
<span class="block font-bold text-lg leading-snug">{e.title}</span>
|
||||
<span class="block text-sm text-on-brand/75">{eventWhen(e)}{e.location ? ` · ${e.location}` : ''}</span>
|
||||
</span>
|
||||
</li>
|
||||
{/each}
|
||||
</div>
|
||||
</ul>
|
||||
{:else}
|
||||
<p class="text-ink-3">Gerade keine Termine geplant.</p>
|
||||
<p class="text-on-brand/80 self-center">Gerade sind keine Termine geplant.</p>
|
||||
{/if}
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@
|
|||
<svelte:head><title>Datenschutz · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<article class="max-w-3xl mx-auto">
|
||||
<h1 class="font-display text-3xl font-extrabold mb-6">Datenschutz</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink mb-6">Datenschutz</h1>
|
||||
<div class="rich">{@html data.html}</div>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<svelte:head><title>Einstellungen · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<div class="max-w-xl mx-auto space-y-6">
|
||||
<h1 class="font-display text-3xl font-extrabold">Einstellungen</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink">Einstellungen</h1>
|
||||
<div class="card p-5">
|
||||
<PrefsControls />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@
|
|||
<svelte:head><title>Impressum · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<article class="max-w-3xl mx-auto">
|
||||
<h1 class="font-display text-3xl font-extrabold mb-6">Impressum</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink mb-6">Impressum</h1>
|
||||
<div class="rich">{@html data.html}</div>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
<svelte:head><title>Kontakt · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<div class="max-w-xl mx-auto">
|
||||
<h1 class="font-display text-3xl font-extrabold mb-2">Schreib uns</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink mb-2">Schreib uns</h1>
|
||||
<p class="text-ink-2 mb-6">{data.intro}</p>
|
||||
|
||||
{#if form?.sent}
|
||||
<div class="card p-8 text-center flex flex-col items-center gap-3">
|
||||
<div class="grid place-items-center size-16 rounded-full bg-brand-soft text-brand"><CircleCheck class="size-8" /></div>
|
||||
<p class="font-display text-xl font-bold">Danke für deine Nachricht!</p>
|
||||
<p class="text-xl font-bold text-brand-ink">Danke für deine Nachricht!</p>
|
||||
<p class="text-ink-2">Wir melden uns so schnell wie möglich.</p>
|
||||
<a href="/" class="btn btn-soft mt-2">Zur Startseite</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<svelte:head><title>Ansprechpartner · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<h1 class="font-display text-3xl font-extrabold mb-2">Ansprechpartner</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink mb-2">Ansprechpartner</h1>
|
||||
<p class="text-ink-2 mb-5">Hier findest du die richtigen Menschen für deine Fragen.</p>
|
||||
|
||||
{#if data.contacts.length > 6}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,25 @@
|
|||
<script lang="ts">
|
||||
import Newspaper from '@lucide/svelte/icons/newspaper';
|
||||
import PostCard from '$lib/components/PostCard.svelte';
|
||||
import PageTitle from '$lib/components/PageTitle.svelte';
|
||||
import EmptyState from '$lib/components/EmptyState.svelte';
|
||||
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<svelte:head><title>Meldungen · {data.brand.appName}</title></svelte:head>
|
||||
<svelte:head><title>Aktuelles · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<h1 class="font-display text-3xl font-extrabold mb-6">Meldungen</h1>
|
||||
<PageTitle eyebrow="Aktuelles" title="Neuigkeiten" />
|
||||
|
||||
{#if data.items.length}
|
||||
<div class="grid md:grid-cols-2 gap-3">
|
||||
{#each data.items as p, i (p.id)}
|
||||
{#if i === 0 && data.page === 1}
|
||||
<div class="md:col-span-2"><PostCard post={p} variant="hero" /></div>
|
||||
{:else}
|
||||
<PostCard post={p} />
|
||||
{/if}
|
||||
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-10">
|
||||
{#each data.items as p (p.id)}
|
||||
<PostCard post={p} />
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
{#if data.pages > 1}
|
||||
<nav class="flex items-center justify-center gap-2 mt-8" aria-label="Seiten">
|
||||
<nav class="flex items-center justify-center gap-2 mt-12" aria-label="Seiten">
|
||||
{#if data.page > 1}<a class="btn btn-soft" href="?seite={data.page - 1}">Neuere</a>{/if}
|
||||
<span class="px-3 text-ink-3">Seite {data.page} von {data.pages}</span>
|
||||
{#if data.page < data.pages}<a class="btn btn-soft" href="?seite={data.page + 1}">Ältere</a>{/if}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
<BackLink href="/meldungen" label="Alle Meldungen" />
|
||||
|
||||
<header class="space-y-3 mb-6">
|
||||
<p class="text-ink-3 font-semibold">{formatLong(post.publishedAt)}</p>
|
||||
<h1 class="font-display text-3xl sm:text-4xl font-extrabold">{post.title}</h1>
|
||||
<p class="eyebrow eyebrow-rule !text-accent-ink">{formatLong(post.publishedAt)}</p>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink">{post.title}</h1>
|
||||
{#if post.teaser}<p class="text-lg text-ink-2">{post.teaser}</p>{/if}
|
||||
<ArticleActions target="vorlesen" favorite={{ href: `/meldungen/${post.slug}`, title: post.title, kind: 'post' }} />
|
||||
</header>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
alt={post.cover.alt}
|
||||
width={post.cover.width}
|
||||
height={post.cover.height}
|
||||
class="w-full rounded-[1.5rem] shadow-card mb-8 max-h-[70vh] object-cover"
|
||||
class="w-full rounded-2xl mb-8 max-h-[70vh] object-cover"
|
||||
/>
|
||||
{/if}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<svelte:head><title>Merkliste · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<h1 class="font-display text-3xl font-extrabold mb-2">Merkliste</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink mb-2">Merkliste</h1>
|
||||
<p class="text-ink-2 mb-6">Deine gemerkten Seiten – nur auf diesem Gerät gespeichert.</p>
|
||||
|
||||
{#if favorites.items.length}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
<script lang="ts">
|
||||
import ChevronRight from '@lucide/svelte/icons/chevron-right';
|
||||
import Icon from '$lib/components/Icon.svelte';
|
||||
import Tile from '$lib/components/Tile.svelte';
|
||||
import ArticleActions from '$lib/components/ArticleActions.svelte';
|
||||
import RichContent from '$lib/components/RichContent.svelte';
|
||||
|
|
@ -18,33 +16,27 @@
|
|||
</svelte:head>
|
||||
|
||||
<article class="max-w-3xl mx-auto">
|
||||
<nav aria-label="Brotkrümel" class="flex flex-wrap items-center gap-1 text-sm text-ink-3 mb-4">
|
||||
<a href="/" class="hover:text-ink font-semibold">Start</a>
|
||||
{#each p.trail as t (t.slug)}
|
||||
<ChevronRight class="size-3.5" />
|
||||
<a href="/s/{t.slug}" class="hover:text-ink font-semibold">{t.title}</a>
|
||||
{/each}
|
||||
</nav>
|
||||
|
||||
<header class="tone-{p.color} mb-6">
|
||||
<div class="flex items-start gap-4">
|
||||
<span class="grid place-items-center size-14 rounded-2xl bg-tone text-white shrink-0 shadow-[0_10px_22px_-10px_var(--tone)]">
|
||||
<Icon name={p.icon} class="size-7" />
|
||||
<header class="mb-8 space-y-3">
|
||||
<nav aria-label="Brotkrümel" class="eyebrow eyebrow-rule">
|
||||
<span class="flex flex-wrap items-center gap-x-2">
|
||||
<a href="/" class="hover:text-brand-ink">Start</a>
|
||||
{#each p.trail as t (t.slug)}
|
||||
<span aria-hidden="true" class="size-1 rounded-full bg-accent"></span>
|
||||
<a href="/s/{t.slug}" class="hover:text-brand-ink">{t.title}</a>
|
||||
{/each}
|
||||
</span>
|
||||
<div class="min-w-0 pt-1">
|
||||
<h1 class="font-display text-3xl sm:text-4xl font-extrabold">{p.title}</h1>
|
||||
{#if p.teaser}<p class="text-lg text-ink-2 mt-2">{p.teaser}</p>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink">{p.title}</h1>
|
||||
{#if p.teaser}<p class="text-lg text-ink-2">{p.teaser}</p>{/if}
|
||||
{#if hasText}
|
||||
<div class="mt-4">
|
||||
<div class="pt-2">
|
||||
<ArticleActions target="vorlesen" favorite={{ href: `/s/${p.slug}`, title: p.title, kind: 'page' }} />
|
||||
</div>
|
||||
{/if}
|
||||
</header>
|
||||
|
||||
{#if p.cover}
|
||||
<img src={p.cover.url} alt={p.cover.alt} class="w-full rounded-[1.5rem] shadow-card mb-8 max-h-[60vh] object-cover" />
|
||||
<img src={p.cover.url} alt={p.cover.alt} class="w-full rounded-2xl mb-8 max-h-[60vh] object-cover" />
|
||||
{/if}
|
||||
|
||||
<div class="space-y-8">
|
||||
|
|
@ -53,9 +45,9 @@
|
|||
{#if p.children.length}
|
||||
<section class="space-y-3">
|
||||
{#if hasText}<h2 class="eyebrow">Bitte wähle aus</h2>{/if}
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 gap-3">
|
||||
<div class="grid sm:grid-cols-2 gap-3">
|
||||
{#each p.children as c (c.id)}
|
||||
<Tile href="/s/{c.slug}" label={c.title} icon={c.icon} color={c.color} />
|
||||
<Tile href="/s/{c.slug}" label={c.title} icon={c.icon} sub={c.teaser} />
|
||||
{/each}
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<svelte:head><title>Suche · {data.brand.appName}</title></svelte:head>
|
||||
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<h1 class="font-display text-3xl font-extrabold mb-5">Suche</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink mb-5">Suche</h1>
|
||||
|
||||
<form role="search" class="flex gap-2 mb-8" data-sveltekit-keepfocus>
|
||||
<label class="relative flex-1">
|
||||
|
|
@ -41,8 +41,8 @@
|
|||
<ul class="card divide-y divide-line/70 overflow-hidden">
|
||||
{#each r.pages as p (p.id)}
|
||||
<li>
|
||||
<a href="/s/{p.slug}" class="tone-{p.color} flex items-center gap-3 px-4 py-3 hover:bg-surface-2">
|
||||
<span class="grid place-items-center size-10 rounded-xl bg-tone-soft text-tone-ink shrink-0"><Icon name={p.icon} class="size-5" /></span>
|
||||
<a href="/s/{p.slug}" class="flex items-center gap-3 px-4 py-3 hover:bg-surface-2">
|
||||
<span class="grid place-items-center size-10 rounded-full bg-surface-2 text-brand-ink shrink-0"><Icon name={p.icon} class="size-5" /></span>
|
||||
<span class="min-w-0">
|
||||
<span class="block font-semibold">{p.title}</span>
|
||||
{#if p.teaser}<span class="block text-sm text-ink-3 truncate">{p.teaser}</span>{/if}
|
||||
|
|
@ -56,13 +56,13 @@
|
|||
{#if r.posts.length}
|
||||
<section>
|
||||
<h2 class="eyebrow mb-3">Meldungen</h2>
|
||||
<div class="space-y-3">{#each r.posts as p (p.id)}<PostCard post={p} />{/each}</div>
|
||||
<div class="space-y-4">{#each r.posts as p (p.id)}<PostCard post={p} variant="row" />{/each}</div>
|
||||
</section>
|
||||
{/if}
|
||||
{#if r.events.length}
|
||||
<section>
|
||||
<h2 class="eyebrow mb-3">Termine</h2>
|
||||
<div class="space-y-2.5">{#each r.events as e (e.id)}<EventRow event={e} expanded />{/each}</div>
|
||||
<div class="divide-y divide-line">{#each r.events as e (e.id)}<EventRow event={e} expanded />{/each}</div>
|
||||
</section>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
<div class="max-w-3xl mx-auto">
|
||||
<div class="flex flex-wrap items-end justify-between gap-3 mb-5">
|
||||
<h1 class="font-display text-3xl font-extrabold">Termine</h1>
|
||||
<h1 class="text-3xl sm:text-4xl text-brand-ink">Termine</h1>
|
||||
<a href="/termine.ics" class="btn btn-soft btn-sm" title="Termine im eigenen Kalender abonnieren">
|
||||
<CalendarPlus class="size-4" /> In meinen Kalender
|
||||
</a>
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
<div class="space-y-8">
|
||||
{#each groups as [month, items] (month)}
|
||||
<section>
|
||||
<h2 class="font-display text-lg font-bold text-ink-2 mb-3 sticky top-16 bg-bg/90 backdrop-blur py-2 z-10">
|
||||
<h2 class="eyebrow eyebrow-rule sticky top-16 lg:top-20 bg-bg/95 backdrop-blur py-3 z-10">
|
||||
{formatMonthYear(`${month}-01`)}
|
||||
</h2>
|
||||
<div class="space-y-2.5">
|
||||
<div class="divide-y divide-line">
|
||||
{#each items as e (e.id)}<EventRow event={e} expanded />{/each}
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { getSettings } from '$lib/server/settings';
|
||||
import { getMedia } from '$lib/server/content';
|
||||
|
||||
const hex = (v: string, fallback: string) => (/^#[0-9a-f]{6}$/i.test(v) ? v : fallback);
|
||||
|
||||
export const load = ({ locals }) => {
|
||||
const s = getSettings();
|
||||
return {
|
||||
|
|
@ -8,7 +10,8 @@ export const load = ({ locals }) => {
|
|||
brand: {
|
||||
appName: s.appName,
|
||||
orgName: s.orgName,
|
||||
color: /^#[0-9a-f]{6}$/i.test(s.brandColor) ? s.brandColor : '#0e7c66',
|
||||
color: hex(s.brandColor, '#2e2672'),
|
||||
accent: hex(s.accentColor, '#85357c'),
|
||||
logo: getMedia(s.logoId)
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<svelte:head>
|
||||
<meta name="theme-color" content={data.brand.color} />
|
||||
{@html `<style>:root{--brand:${data.brand.color}}</style>`}
|
||||
{@html `<style>:root{--brand:${data.brand.color};--accent:${data.brand.accent}}</style>`}
|
||||
</svelte:head>
|
||||
|
||||
{@render children()}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
<div class="grid grid-cols-2 lg:grid-cols-4 gap-3 mb-8">
|
||||
{#each stats as s (s.label)}
|
||||
<a href={s.href} class="card pressable p-4 tone-{s.tone}">
|
||||
<span class="grid place-items-center size-10 rounded-xl bg-tone-soft text-tone-ink mb-3"><s.icon class="size-5" /></span>
|
||||
<a href={s.href} class="card pressable p-4">
|
||||
<span class="grid place-items-center size-10 rounded-full bg-surface-2 text-brand-ink mb-3"><s.icon class="size-5" /></span>
|
||||
<p class="font-display text-3xl font-extrabold">{s.value}</p>
|
||||
<p class="text-sm text-ink-3">{s.label}</p>
|
||||
</a>
|
||||
|
|
@ -37,8 +37,8 @@
|
|||
</div>
|
||||
|
||||
{#if data.messages.length}
|
||||
<a href="/admin/postfach" class="card pressable flex items-center gap-4 p-4 mb-8 tone-coral">
|
||||
<span class="grid place-items-center size-11 rounded-xl bg-tone text-white"><Inbox class="size-5" /></span>
|
||||
<a href="/admin/postfach" class="card pressable flex items-center gap-4 p-4 mb-8">
|
||||
<span class="grid place-items-center size-11 rounded-full bg-accent text-white"><Inbox class="size-5" /></span>
|
||||
<span class="flex-1 min-w-0">
|
||||
<span class="block font-bold">{data.unread} neue {data.unread === 1 ? 'Nachricht' : 'Nachrichten'}</span>
|
||||
<span class="block text-sm text-ink-3 truncate">Von {data.messages.map((m) => m.name).join(', ')}</span>
|
||||
|
|
|
|||
|
|
@ -16,8 +16,9 @@ export const actions = {
|
|||
const f = fields(await request.formData());
|
||||
const appName = f.str('appName', 40);
|
||||
const brandColor = f.str('brandColor', 7);
|
||||
const accentColor = f.str('accentColor', 7);
|
||||
if (!appName) return fail(400, { error: 'Die App braucht einen Namen.' });
|
||||
if (!/^#[0-9a-f]{6}$/i.test(brandColor)) return fail(400, { error: 'Die Farbe ist ungültig.' });
|
||||
if (![brandColor, accentColor].every((c) => /^#[0-9a-f]{6}$/i.test(c))) return fail(400, { error: 'Eine der Farben ist ungültig.' });
|
||||
const website = f.str('website', 300);
|
||||
if (website && !/^https?:\/\//.test(website)) return fail(400, { error: 'Die Website muss mit https:// beginnen.' });
|
||||
|
||||
|
|
@ -27,9 +28,11 @@ export const actions = {
|
|||
greeting: f.str('greeting', 120),
|
||||
intro: f.str('intro', 400),
|
||||
brandColor,
|
||||
accentColor,
|
||||
logoId: f.int('logoId'),
|
||||
heroEnabled: f.bool('heroEnabled'),
|
||||
heroImageId: f.int('heroImageId'),
|
||||
heroTagline: f.str('heroTagline', 40),
|
||||
website,
|
||||
contactEmail: f.str('contactEmail', 200),
|
||||
contactIntro: f.str('contactIntro', 400),
|
||||
|
|
|
|||
|
|
@ -9,11 +9,21 @@
|
|||
let { data } = $props();
|
||||
const s = $derived(data.settings);
|
||||
let color = $state('');
|
||||
let accent = $state('');
|
||||
$effect.pre(() => {
|
||||
color = s.brandColor;
|
||||
accent = s.accentColor;
|
||||
});
|
||||
|
||||
const presets = ['#0e7c66', '#1f6fb2', '#4b4fc4', '#8a3fbf', '#c2410c', '#b91c5c', '#0f766e', '#3f6212', '#334155'];
|
||||
// Paare aus Hauptfarbe (Schrift, Buttons) und Akzent (Kreis, Hervorhebungen)
|
||||
const presets = [
|
||||
['#2e2672', '#85357c'],
|
||||
['#0f4c5c', '#e36414'],
|
||||
['#1d3557', '#e63946'],
|
||||
['#264027', '#b5853f'],
|
||||
['#3a2e39', '#1e8a78'],
|
||||
['#12355b', '#d4a017']
|
||||
];
|
||||
</script>
|
||||
|
||||
<PageHeader title="Einstellungen" description="Name, Aussehen und rechtliche Texte der App." />
|
||||
|
|
@ -39,12 +49,17 @@
|
|||
|
||||
<Panel title="Startseite">
|
||||
<Switch name="heroEnabled" checked={s.heroEnabled} label="Bild oben anzeigen" hint="Großes Bild über der Begrüßung" />
|
||||
<div class="max-w-xl">
|
||||
<div class="max-w-xl space-y-4">
|
||||
<ImageField name="heroImageId" value={data.hero} label="Startbild" aspect="aspect-[16/7]" />
|
||||
<p class="hint">
|
||||
Am besten ein Foto im Querformat, mindestens 1600 px breit. Solange keins gewählt ist, erscheint eine
|
||||
Platzhalter-Illustration.
|
||||
Platzhalter in der Markenfarbe.
|
||||
</p>
|
||||
<div>
|
||||
<label class="label" for="heroTagline">Text im Kreis</label>
|
||||
<input id="heroTagline" name="heroTagline" class="field" maxlength="40" value={s.heroTagline} placeholder="z. B. Arbeit, Bildung, Teilhabe" />
|
||||
<p class="hint">Läuft oben am Farbkreis entlang, höchstens 40 Zeichen. Leer lassen, wenn kein Text erscheinen soll.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="greeting">Begrüßung</label>
|
||||
|
|
@ -86,23 +101,43 @@
|
|||
{#snippet aside()}
|
||||
<Panel title="Aussehen">
|
||||
<div>
|
||||
<span class="label">Markenfarbe</span>
|
||||
<div class="flex flex-wrap gap-2 mb-3">
|
||||
{#each presets as p (p)}
|
||||
<span class="label">Farbpaar</span>
|
||||
<div class="flex flex-wrap gap-2 mb-4">
|
||||
{#each presets as [p, a] (p)}
|
||||
<button
|
||||
type="button"
|
||||
class="size-8 rounded-full ring-offset-2 ring-offset-surface transition {color.toLowerCase() === p ? 'ring-3' : 'hover:scale-110'}"
|
||||
style="background:{p}; --tw-ring-color:{p}"
|
||||
aria-label="Farbe {p}"
|
||||
onclick={() => (color = p)}
|
||||
></button>
|
||||
class="flex rounded-full overflow-hidden ring-offset-2 ring-offset-surface transition {color.toLowerCase() === p && accent.toLowerCase() === a ? 'ring-3 ring-ink' : 'hover:scale-105'}"
|
||||
aria-label="Farbpaar {p} und {a}"
|
||||
onclick={() => {
|
||||
color = p;
|
||||
accent = a;
|
||||
}}
|
||||
>
|
||||
<span class="size-8" style="background:{p}"></span><span class="size-8" style="background:{a}"></span>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="color" bind:value={color} class="size-11 rounded-xl border border-line cursor-pointer bg-transparent" aria-label="Eigene Farbe" />
|
||||
<input name="brandColor" bind:value={color} class="field font-mono" maxlength="7" />
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<div>
|
||||
<label class="label" for="brandColor">Hauptfarbe</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="color" bind:value={color} class="size-10 shrink-0 rounded-lg border border-line cursor-pointer bg-transparent" aria-label="Hauptfarbe wählen" />
|
||||
<input id="brandColor" name="brandColor" bind:value={color} class="field font-mono text-sm px-2" maxlength="7" />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="accentColor">Akzent</label>
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="color" bind:value={accent} class="size-10 shrink-0 rounded-lg border border-line cursor-pointer bg-transparent" aria-label="Akzentfarbe wählen" />
|
||||
<input id="accentColor" name="accentColor" bind:value={accent} class="field font-mono text-sm px-2" maxlength="7" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="hint">Die Hauptfarbe sollte dunkel sein, weil Schrift und Buttons sie verwenden.</p>
|
||||
<div class="mt-3 relative overflow-hidden rounded-2xl p-4 h-24 text-white font-bold" style="background:{color}">
|
||||
<span class="relative z-10">Vorschau</span>
|
||||
<span class="absolute -right-6 -bottom-10 size-28 rounded-full" style="background:{accent}"></span>
|
||||
</div>
|
||||
<div class="mt-3 rounded-2xl p-4 text-white font-display font-bold" style="background:{color}">Vorschau</div>
|
||||
</div>
|
||||
<ImageField name="logoId" value={data.logo} label="Logo" aspect="aspect-[3/1]" />
|
||||
<p class="hint -mt-3">Am besten ein PNG mit transparentem Hintergrund. Wird auch als App-Symbol verwendet.</p>
|
||||
|
|
|
|||
|
|
@ -8,33 +8,27 @@
|
|||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<PageHeader title="Startseite" description="Die bunten Kacheln auf der Startseite der App – jede führt zu einer Seite, einem Bereich oder einer Website.">
|
||||
<PageHeader title="Startseite" description="Die Bereiche auf der Startseite der App – jede führt zu einer Seite, einem Bereich oder einer Website.">
|
||||
{#snippet actions()}
|
||||
<a href="/admin/kacheln/neu" class="btn btn-primary"><Plus class="size-4" />Neue Kachel</a>
|
||||
{/snippet}
|
||||
</PageHeader>
|
||||
|
||||
{#if data.tiles.length}
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3">
|
||||
<ul class="grid sm:grid-cols-2 xl:grid-cols-3 gap-3">
|
||||
{#each data.tiles as t, i (t.id)}
|
||||
<div class="tone-{t.color} relative rounded-[1.4rem] bg-tone-soft p-4 min-h-32 flex flex-col justify-between">
|
||||
<div class="flex items-start justify-between">
|
||||
<span class="grid place-items-center size-12 rounded-2xl bg-tone text-white"><Icon name={t.icon} class="size-6" /></span>
|
||||
<div class="flex items-center gap-1 bg-surface/80 rounded-xl p-0.5">
|
||||
<MoveButtons id={t.id} first={i === 0} last={i === data.tiles.length - 1} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-end justify-between gap-2 mt-4">
|
||||
<span class="min-w-0">
|
||||
<span class="block font-display font-bold text-tone-ink leading-tight">{t.label}</span>
|
||||
<span class="block text-xs text-ink-3 truncate mt-0.5">{t.href}</span>
|
||||
</span>
|
||||
<a href="/admin/kacheln/{t.id}" class="btn btn-sm btn-icon bg-surface/80 hover:bg-surface shrink-0" aria-label="{t.label} bearbeiten"><Pencil class="size-4" /></a>
|
||||
</div>
|
||||
</div>
|
||||
<li class="flex items-center gap-3 rounded-full bg-surface-2 pl-2 pr-2 py-2">
|
||||
<span class="grid place-items-center size-12 rounded-full bg-surface text-brand-ink shrink-0"><Icon name={t.icon} class="size-[1.35rem]" /></span>
|
||||
<span class="flex-1 min-w-0">
|
||||
<span class="block font-bold text-brand-ink leading-tight truncate">{t.label}</span>
|
||||
<span class="block text-xs text-ink-3 truncate">{t.href}</span>
|
||||
</span>
|
||||
<MoveButtons id={t.id} first={i === 0} last={i === data.tiles.length - 1} />
|
||||
<a href="/admin/kacheln/{t.id}" class="btn btn-sm btn-icon bg-surface hover:bg-brand-soft shrink-0" aria-label="{t.label} bearbeiten"><Pencil class="size-4" /></a>
|
||||
</li>
|
||||
{/each}
|
||||
</div>
|
||||
<p class="hint mt-4">Die Pfeile ändern die Reihenfolge (oben = weiter vorne).</p>
|
||||
</ul>
|
||||
<p class="hint mt-4">Die Pfeile ändern die Reihenfolge auf der Startseite.</p>
|
||||
{:else}
|
||||
<div class="card p-8 text-center text-ink-3">Noch keine Kacheln. Die Startseite zeigt dann nur Neuigkeiten und Termine.</div>
|
||||
{/if}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
{/if}
|
||||
<input type="hidden" name="href" value={target === 'custom' ? custom : target} />
|
||||
</Panel>
|
||||
<Panel title="Aussehen">
|
||||
<Panel title="Symbol">
|
||||
<IconTonePicker bind:icon bind:color {label} />
|
||||
</Panel>
|
||||
</EditForm>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<li class="flex items-center gap-3 pr-3 py-1.5 hover:bg-surface-2/60" style="padding-left: {0.75 + p.depth * 1.75}rem">
|
||||
<MoveButtons id={p.id} first={p.first} last={p.last} />
|
||||
{#if p.depth > 0}<CornerDownRight class="size-4 text-ink-3 -ml-1" />{/if}
|
||||
<span class="tone-{p.color} grid place-items-center size-9 rounded-xl bg-tone-soft text-tone-ink shrink-0"><Icon name={p.icon} class="size-[1.1rem]" /></span>
|
||||
<span class="grid place-items-center size-9 rounded-full bg-surface-2 text-brand-ink shrink-0"><Icon name={p.icon} class="size-[1.1rem]" /></span>
|
||||
<a href="/admin/seiten/{p.id}" class="flex-1 min-w-0 py-2">
|
||||
<span class="font-semibold truncate block">{p.title}</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
<Panel title="Aussehen">
|
||||
<Panel title="Symbol">
|
||||
<IconTonePicker bind:icon bind:color label={title} />
|
||||
</Panel>
|
||||
<Panel>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export const GET = () => {
|
|||
start_url: '/',
|
||||
scope: '/',
|
||||
display: 'standalone',
|
||||
background_color: '#f7f5f0',
|
||||
background_color: '#ffffff',
|
||||
theme_color: s.brandColor,
|
||||
icons: [192, 512].flatMap((size) => [
|
||||
{ src: `/app-icon/${size}`, sizes: `${size}x${size}`, type: 'image/png', purpose: 'any' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue