package main // galleryFanGridCols maps the column count to a tailwind grid class with single-column collapse below 640px. func galleryFanGridCols(cols int) string { switch cols { case 2: return "grid-cols-1 sm:grid-cols-2" case 4: return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" default: return "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3" } } // fallbackImage returns a tiny transparent svg data URI used when no image src is supplied. func fallbackImage() string { return "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Crect%20width%3D%2232%22%20height%3D%2232%22%20fill%3D%22%23222%22%2F%3E%3C%2Fsvg%3E" } // galleryFanComponent renders the mirrored gallery framed by sunburst rays. templ galleryFanComponent(data GalleryFanData) {
if len(data.Images) == 0 {
Add images to populate the fan gallery.
} for _, img := range data.Images {
if img.Src != "" { { } else { } if img.Caption != "" {
{ img.Caption }
}
}
}