|
|
|
@@ -342,11 +342,9 @@ export default function PublicGrid({ cards, maxCols = 5 }: { cards: Card[], maxC |
|
|
|
key={card.id} |
|
|
|
onClick={() => { |
|
|
|
setActiveCard(card); |
|
|
|
// If any extraMedia item is flagged auto-fullscreen, open it immediately. |
|
|
|
// The carousel's index 0 is the cover image; extraMedia starts at offset 1 (or 0 if no cover). |
|
|
|
const offset = card.imageUrl ? 1 : 0; |
|
|
|
const idx = (card.extraMedia || []).findIndex(m => m.autoFullscreen); |
|
|
|
if (idx >= 0) setFullscreenIndex(offset + idx); |
|
|
|
// If any media item is flagged auto-fullscreen, open the viewer from the start. |
|
|
|
const triggers = (card.extraMedia || []).some(m => m.autoFullscreen); |
|
|
|
if (triggers) setFullscreenIndex(0); |
|
|
|
}} |
|
|
|
className="group relative cursor-pointer overflow-hidden rounded-xl shadow-md aspect-square bg-gray-200 transition-all duration-300 hover:shadow-xl hover:-translate-y-1" |
|
|
|
> |
|
|
|
|