25 lines
700 B
Templ
25 lines
700 B
Templ
package pages
|
|
|
|
import "git.schreifuchs.ch/schreifuchs/schreifuchs.ch/internal/components/gallery"
|
|
import "fmt"
|
|
|
|
templ Gallery(g gallery.Gallery) {
|
|
<div
|
|
class="grid gap-5 m-5"
|
|
style={ fmt.Sprintf("grid-template-columns: repeat(%d, 1fr); grid-template-rows: repeat(%d, auto);", g.GridWith, g.GridHeight) }
|
|
>
|
|
for _, img := range g.Images {
|
|
<div
|
|
style={ fmt.Sprintf("grid-column: %d / span %d; grid-row: %d / span %d;aspect-ratio: %d / %d;", img.X+1, img.Width, img.Y+1, img.Height, img.Width, img.Height) }
|
|
class="overflow-hidden shadow-sm"
|
|
>
|
|
<img
|
|
src={ "/images/" + img.UID }
|
|
class="w-full h-full object-cover"
|
|
alt="Gallery item"
|
|
/>
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|