From 719afb6920342e0a6d351051c77097f0b15e9796 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Wed, 14 Jan 2026 11:48:40 +0100 Subject: [PATCH] Refresh gallery layout and tile styling --- resources/js/guest/pages/GalleryPage.tsx | 225 ++++++++++++----------- 1 file changed, 115 insertions(+), 110 deletions(-) diff --git a/resources/js/guest/pages/GalleryPage.tsx b/resources/js/guest/pages/GalleryPage.tsx index 9eb1c4f..bf1c240 100644 --- a/resources/js/guest/pages/GalleryPage.tsx +++ b/resources/js/guest/pages/GalleryPage.tsx @@ -364,124 +364,129 @@ export default function GalleryPage() { {t('galleryPage.loading', 'Lade…')} )} - - {list.map((p: GalleryPhoto) => { - const imageUrl = normalizeImageUrl(p.thumbnail_path || p.file_path); - const createdLabel = p.created_at - ? new Date(p.created_at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) - : t('galleryPage.photo.justNow', 'Gerade eben'); - const likeCount = counts[p.id] ?? (p.likes_count || 0); - const localizedTaskTitle = localizeTaskLabel(p.task_title ?? null, locale); - const altSuffix = localizedTaskTitle - ? t('galleryPage.photo.altTaskSuffix', { task: localizedTaskTitle }) - : ''; - const altText = t('galleryPage.photo.alt', { id: p.id, suffix: altSuffix }, `Foto ${p.id}${altSuffix}`); + + + {list.map((p: GalleryPhoto) => { + const imageUrl = normalizeImageUrl(p.thumbnail_path || p.file_path); + const createdLabel = p.created_at + ? new Date(p.created_at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) + : t('galleryPage.photo.justNow', 'Gerade eben'); + const likeCount = counts[p.id] ?? (p.likes_count || 0); + const localizedTaskTitle = localizeTaskLabel(p.task_title ?? null, locale); + const altSuffix = localizedTaskTitle + ? t('galleryPage.photo.altTaskSuffix', { task: localizedTaskTitle }) + : ''; + const altText = t('galleryPage.photo.alt', { id: p.id, suffix: altSuffix }, `Foto ${p.id}${altSuffix}`); - const openPhoto = () => { - const index = list.findIndex((photo) => photo.id === p.id); - setCurrentPhotoIndex(index >= 0 ? index : null); - }; + const openPhoto = () => { + const index = list.findIndex((photo) => photo.id === p.id); + setCurrentPhotoIndex(index >= 0 ? index : null); + }; - return ( + return ( + { + if (e.key === 'Enter') { + openPhoto(); + } + }} + className="group relative overflow-hidden border border-white/40 bg-white text-white shadow-md ring-1 ring-black/5 transition duration-300 hover:-translate-y-0.5 hover:shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-400 dark:border-white/10 dark:bg-slate-950 dark:ring-white/10" + style={{ borderRadius: radius }} + {...fadeScaleMotion} + > + {altText} { + (e.target as HTMLImageElement).src = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjRjNGNEY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzk5OSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPk5vIEltYWdlPC90ZXh0Pjwvc3ZnPg=='; + }} + loading="lazy" + /> +
+
+ {localizedTaskTitle && ( +

+ {localizedTaskTitle} +

+ )} +
+ {createdLabel} + + {p.uploader_name || t('galleryPage.photo.anonymous', 'Gast')} + +
+
+
+ + +
+ + ); + })} + {list.length === 0 && Array.from({ length: 6 }).map((_, idx) => ( { - if (e.key === 'Enter') { - openPhoto(); - } - }} - className="group relative overflow-hidden border border-white/20 bg-gray-950 text-white shadow-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-pink-400" + key={`placeholder-${idx}`} + className="relative overflow-hidden border border-muted/40 bg-white shadow-sm ring-1 ring-black/5 dark:bg-slate-950 dark:ring-white/10" style={{ borderRadius: radius }} {...fadeScaleMotion} > - {altText} { - (e.target as HTMLImageElement).src = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjRjNGNEY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzk5OSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPk5vIEltYWdlPC90ZXh0Pjwvc3ZnPg=='; - }} - loading="lazy" - /> -
-
- {localizedTaskTitle && ( -

- {localizedTaskTitle} -

- )} -
- {createdLabel} - - {p.uploader_name || t('galleryPage.photo.anonymous', 'Gast')} - -
-
-
- - +
+
+ +
+
- ); - })} - {list.length === 0 && Array.from({ length: 6 }).map((_, idx) => ( - -
-
- -
-
-
- - ))} - + ))} + + {currentPhotoIndex !== null && list.length > 0 && (