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
This commit is contained in:
ralksta
2026-05-29 17:26:54 +02:00
parent 276e9b3d68
commit 502ca1d32c
2 changed files with 72 additions and 31 deletions

View File

@@ -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 */

View File

@@ -465,26 +465,27 @@ export default function PageBuilder() {
+ Add Hero
</button>
</div>
<div className="hero-list">
<div className="hero-grid">
{gallery.hero.length === 0 && (
<p className="empty-hint">
No hero images configured. Add asset UUIDs to show a hero carousel.
</p>
)}
{gallery.hero.map((id, i) => (
<div key={i} className="hero-item">
<div key={i} className="hero-tile">
<img
className="hero-item-thumb"
src={`/api/admin/thumbnail/${id}`}
alt=""
loading="lazy"
/>
<span className="hero-uuid" title={id}>
{id.slice(0, 8)}...{id.slice(-4)}
</span>
<button className="admin-btn-icon" onClick={() => removeHero(i)} title="Remove">
<button
className="hero-tile-remove"
onClick={() => removeHero(i)}
title="Remove"
>
×
</button>
<span className="hero-tile-index">{i + 1}</span>
</div>
))}
</div>