From ace356211126279971229fa3a6524783e5d62518 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Sat, 6 Jun 2026 10:25:07 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Social-Bild-Modal=20mit=20QR-Code=20f?= =?UTF-8?q?=C3=BCr=20Kalender-Termine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Single Button öffnet Vorschau-Modal mit beiden Formaten side-by-side. Pro Format Download-Button. ESC + Click-outside schließen. Endpoint generiert zusätzlich QR-Code (qrcode → PNG-Buffer), der direkt auf den Termin im Kalender-Grid verweist (/kalender/#event-). Pin-Icon, QR und Layout für OG (1200x630) und Square (1080x1080). Co-Authored-By: Claude Sonnet 4.6 --- scripts/generate-icons.mjs | 3 +- .../components/blocks/CalendarBlock.svelte | 114 ++++++++++++++---- src/lib/iconify-mdi-subset.generated.json | 3 - .../api/social/calendar/[slug]/+server.ts | 58 ++++++--- 4 files changed, 135 insertions(+), 43 deletions(-) diff --git a/scripts/generate-icons.mjs b/scripts/generate-icons.mjs index 722351e..9498c59 100644 --- a/scripts/generate-icons.mjs +++ b/scripts/generate-icons.mjs @@ -67,9 +67,8 @@ const EXTRA_ICONS = [ 'information-outline', // OrganisationsMapBlock: activate-overlay 'cursor-default-click-outline', - // CalendarBlock: social-image buttons + // CalendarBlock: social-image modal button 'image-outline', - 'crop-square', ]; const STATIC_PATTERN = /icon="mdi:([a-z0-9-]+)"/g; diff --git a/src/lib/components/blocks/CalendarBlock.svelte b/src/lib/components/blocks/CalendarBlock.svelte index ee14077..cc650a0 100644 --- a/src/lib/components/blocks/CalendarBlock.svelte +++ b/src/lib/components/blocks/CalendarBlock.svelte @@ -446,6 +446,16 @@ let copyToastKey = $state(null); let modalImage = $state<{ src: string; alt: string } | null>(null); let linkedSlug = $state(null); + let socialModal = $state<{ slug: string; title: string } | null>(null); + + function openSocial(item: EventCardItem) { + if (!item._slug) return; + socialModal = { slug: item._slug, title: item.title || "Termin" }; + } + + function closeSocial() { + socialModal = null; + } function eventId(item: EventCardItem): string { if (item._slug) return `event-${item._slug}`; @@ -887,34 +897,20 @@ {/if} {#if item._slug} - openSocial(item)} class="btn-outline btn-sm group" - aria-label="Social-Bild (Quer 1200×630)" - title="Social-Bild Quer (1200×630)" + aria-label="Social-Bild als Vorschau öffnen" + title="Social-Bild Vorschau" > - - + Social-Bild + {/if} + + +
+
+

Quer · 1200 × 630

+ Social-Bild Quer + + + Quer herunterladen + +
+
+

Quadrat · 1080 × 1080

+ Social-Bild Quadrat + + + Quadrat herunterladen + +
+
+ +

+ Die Bilder werden automatisch generiert. Für Posts auf Instagram, Facebook, WhatsApp oder als Hintergrund-Grafik. +

+ + +{/if} +