From 502ca1d32c3f32f9136aa522342e006077ee3131 Mon Sep 17 00:00:00 2001 From: ralksta Date: Fri, 29 May 2026 17:26:54 +0200 Subject: [PATCH] feat: redesign hero section as visual image grid with large previews - Hero images shown as landscape tiles (16:10 aspect ratio) in a grid - Full cover images instead of tiny thumbnails with UUID text - Remove button appears on hover (red X, top-right corner) - Slide number badge shown bottom-left for ordering reference - Much more visual and recognizable at a glance --- app/admin/admin.css | 88 ++++++++++++++++++++-------- app/admin/components/PageBuilder.tsx | 15 ++--- 2 files changed, 72 insertions(+), 31 deletions(-) diff --git a/app/admin/admin.css b/app/admin/admin.css index cd03ac2..34f7639 100644 --- a/app/admin/admin.css +++ b/app/admin/admin.css @@ -456,35 +456,75 @@ text-align: center; } -/* Hero List */ -.hero-list { - display: flex; - flex-wrap: wrap; - gap: 0.5rem; +/* Hero Grid */ +.hero-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); + gap: 0.6rem; } -.hero-item { - display: inline-flex; - align-items: center; - gap: 0.4rem; - padding: 0.3rem 0.6rem; - background: var(--admin-bg-raised); - border: 1px solid var(--admin-border); - border-radius: 6px; -} - -.hero-item-thumb { - width: 32px; - height: 32px; - object-fit: cover; - border-radius: 4px; +.hero-tile { + position: relative; + aspect-ratio: 16 / 10; + border-radius: 8px; + overflow: hidden; background: var(--admin-bg-elevated); + border: 1px solid var(--admin-border); + transition: border-color 0.15s; } -.hero-uuid { - font-family: monospace; - font-size: 0.75rem; - color: var(--admin-text-secondary); +.hero-tile:hover { + border-color: var(--admin-border-hover); +} + +.hero-tile img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.hero-tile-remove { + position: absolute; + top: 4px; + right: 4px; + width: 22px; + height: 22px; + border-radius: 50%; + background: rgba(0, 0, 0, 0.6); + backdrop-filter: blur(4px); + border: none; + color: #fff; + font-size: 0.85rem; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + opacity: 0; + transition: opacity 0.15s; +} + +.hero-tile:hover .hero-tile-remove { + opacity: 1; +} + +.hero-tile-remove:hover { + background: rgba(220, 40, 40, 0.8); +} + +.hero-tile-index { + position: absolute; + bottom: 4px; + left: 4px; + width: 18px; + height: 18px; + border-radius: 4px; + background: rgba(0, 0, 0, 0.5); + color: #fff; + font-size: 0.65rem; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; } /* Album Grid */ diff --git a/app/admin/components/PageBuilder.tsx b/app/admin/components/PageBuilder.tsx index 3218598..b5f258d 100644 --- a/app/admin/components/PageBuilder.tsx +++ b/app/admin/components/PageBuilder.tsx @@ -465,26 +465,27 @@ export default function PageBuilder() { + Add Hero -
+
{gallery.hero.length === 0 && (

No hero images configured. Add asset UUIDs to show a hero carousel.

)} {gallery.hero.map((id, i) => ( -
+
- - {id.slice(0, 8)}...{id.slice(-4)} - - + {i + 1}
))}