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:
@@ -456,35 +456,75 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hero List */
|
/* Hero Grid */
|
||||||
.hero-list {
|
.hero-grid {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||||
gap: 0.5rem;
|
gap: 0.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-item {
|
.hero-tile {
|
||||||
display: inline-flex;
|
position: relative;
|
||||||
align-items: center;
|
aspect-ratio: 16 / 10;
|
||||||
gap: 0.4rem;
|
border-radius: 8px;
|
||||||
padding: 0.3rem 0.6rem;
|
overflow: hidden;
|
||||||
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;
|
|
||||||
background: var(--admin-bg-elevated);
|
background: var(--admin-bg-elevated);
|
||||||
|
border: 1px solid var(--admin-border);
|
||||||
|
transition: border-color 0.15s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hero-uuid {
|
.hero-tile:hover {
|
||||||
font-family: monospace;
|
border-color: var(--admin-border-hover);
|
||||||
font-size: 0.75rem;
|
}
|
||||||
color: var(--admin-text-secondary);
|
|
||||||
|
.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 */
|
/* Album Grid */
|
||||||
|
|||||||
@@ -465,26 +465,27 @@ export default function PageBuilder() {
|
|||||||
+ Add Hero
|
+ Add Hero
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="hero-list">
|
<div className="hero-grid">
|
||||||
{gallery.hero.length === 0 && (
|
{gallery.hero.length === 0 && (
|
||||||
<p className="empty-hint">
|
<p className="empty-hint">
|
||||||
No hero images configured. Add asset UUIDs to show a hero carousel.
|
No hero images configured. Add asset UUIDs to show a hero carousel.
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{gallery.hero.map((id, i) => (
|
{gallery.hero.map((id, i) => (
|
||||||
<div key={i} className="hero-item">
|
<div key={i} className="hero-tile">
|
||||||
<img
|
<img
|
||||||
className="hero-item-thumb"
|
|
||||||
src={`/api/admin/thumbnail/${id}`}
|
src={`/api/admin/thumbnail/${id}`}
|
||||||
alt=""
|
alt=""
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
/>
|
/>
|
||||||
<span className="hero-uuid" title={id}>
|
<button
|
||||||
{id.slice(0, 8)}...{id.slice(-4)}
|
className="hero-tile-remove"
|
||||||
</span>
|
onClick={() => removeHero(i)}
|
||||||
<button className="admin-btn-icon" onClick={() => removeHero(i)} title="Remove">
|
title="Remove"
|
||||||
|
>
|
||||||
×
|
×
|
||||||
</button>
|
</button>
|
||||||
|
<span className="hero-tile-index">{i + 1}</span>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user