From 6fc2c0a345c6fa040a996622506b51d6414d6b83 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Tue, 12 May 2026 17:23:41 +0200 Subject: [PATCH] feat(calendar): hover tooltip, light theme grid, UX polish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Hover tooltip on event cells (pointer:fine only, position:fixed bypasses overflow-hidden) — shows title + right-aligned time, max 3 events, "+N weitere" - Grid background changed to himmel-100 (light), all text tokens updated to dark - Today cell: wald-200 green background + wald-400 outline - Empty day cells: subtle bg-himmel-50/40 tint - Event badge larger on desktop (sm:min-w-4.5 sm:h-4.5 sm:text-[10px]) - Weekday headers: font-semibold text-himmel-800 - Calendar takes full width inside widget (removed max-w-2xl cap) - Web Share API per event (navigator.share / clipboard fallback, Kopiert\! toast) - Subscribe bar: webcal:// on Apple, direct ICS download on other platforms Co-Authored-By: Claude Sonnet 4.6 --- .../components/blocks/CalendarBlock.svelte | 145 ++++++++++++++++-- 1 file changed, 131 insertions(+), 14 deletions(-) diff --git a/src/lib/components/blocks/CalendarBlock.svelte b/src/lib/components/blocks/CalendarBlock.svelte index 4cdb5f0..fe79b37 100644 --- a/src/lib/components/blocks/CalendarBlock.svelte +++ b/src/lib/components/blocks/CalendarBlock.svelte @@ -405,6 +405,24 @@ t(T.calendar_weekday_so), ]); + let hasHover = $state(false); + let tooltipDay = $state(null); + let tooltipPos = $state({ x: 0, y: 0 }); + + function showTooltip(e: MouseEvent, key: string) { + if (!hasHover) return; + const r = (e.currentTarget as HTMLElement).getBoundingClientRect(); + tooltipPos = { x: r.left + r.width / 2, y: r.top }; + tooltipDay = key; + } + function hideTooltip() { + tooltipDay = null; + } + + const tooltipEvents = $derived( + tooltipDay ? (eventsByDay.get(tooltipDay) ?? []) : [], + ); + let feedHost = $state(""); const webcalUrl = $derived( feedHost ? `webcal://${feedHost}/api/kalender.ics` : "#", @@ -474,6 +492,9 @@ onMount(() => { feedHost = window.location.host; + hasHover = window.matchMedia( + "(hover: hover) and (pointer: fine)", + ).matches; tickTimer = setInterval(() => { nowMs = Date.now(); }, 60_000); @@ -852,13 +873,13 @@ Tag-Grid. Klick auf Tag filtert Liste unten. -->
-
+
{monthLabel}