Deploy
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
'use client'
|
||||||
|
import Image from 'next/image'
|
||||||
|
import { useEmDashContent } from '@/hooks/useEmDashContent'
|
||||||
|
|
||||||
|
export default function GallerySection() {
|
||||||
|
const { items, loading } = useEmDashContent('gallery')
|
||||||
|
if (loading) return <div className="flex justify-center py-16"><div className="w-8 h-8 rounded-full border-2 border-current border-t-transparent animate-spin" /></div>
|
||||||
|
if (!items || items.length === 0) return null
|
||||||
|
return (
|
||||||
|
<section data-vula-section="gallery" id="gallery" className="py-20 lg:py-28 bg-white">
|
||||||
|
<div className="container mx-auto px-4 max-w-7xl">
|
||||||
|
<h2 className="text-3xl lg:text-4xl font-semibold tracking-tight text-center text-[#111827] mb-12">Our Gallery</h2>
|
||||||
|
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4">
|
||||||
|
{items.map((item) => {
|
||||||
|
const d = item.data as { title?: string; description?: string; image?: string }
|
||||||
|
return (
|
||||||
|
<div key={item.id} className="group relative rounded-xl overflow-hidden border border-neutral-100 shadow-[var(--shadow-card)] hover:shadow-[var(--shadow-lifted)] transition-all duration-200 ease-out">
|
||||||
|
<div className="aspect-[4/3] relative overflow-hidden">
|
||||||
|
{d.image && (
|
||||||
|
<Image
|
||||||
|
src={d.image}
|
||||||
|
alt={d.title || 'Gallery image'}
|
||||||
|
fill
|
||||||
|
sizes="(max-width: 640px) 50vw, (max-width: 1024px) 33vw, 25vw"
|
||||||
|
className="object-cover group-hover:scale-105 transition-transform duration-500 ease-out"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200 ease-out flex items-end p-4">
|
||||||
|
<div>
|
||||||
|
{d.title && <p className="text-white font-semibold text-sm">{d.title}</p>}
|
||||||
|
{d.description && <p className="text-white/80 text-xs mt-1">{d.description}</p>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user