From 67697ef605cb4f5dc87da753778164db52c05855 Mon Sep 17 00:00:00 2001 From: deflax Date: Fri, 19 Jan 2024 20:57:14 +0200 Subject: [PATCH] switch display from flex to grid --- src/scheduler/templates/gallery.html | 33 +++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/scheduler/templates/gallery.html b/src/scheduler/templates/gallery.html index fc262f7..75c02a2 100644 --- a/src/scheduler/templates/gallery.html +++ b/src/scheduler/templates/gallery.html @@ -13,25 +13,32 @@ } .gallery { - display: flex; - flex-wrap: wrap; - justify-content: space-around; - margin: 0px; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 20px; + background: teal; + padding: 15px; } - .gallery-item { - flex: 0 1 calc(25% - 20px); - margin: 10px; /* Added margin between items */ + .gallery .gallery-item { overflow: hidden; position: relative; cursor: pointer; - box-sizing: border-box; /* Include padding and border in the element's total width and height */ + box-sizing: border-box; } - .gallery-item img { - max-width: 100%; /* Ensure images don't exceed the width of their container */ - height: auto; + .gallery img { + width: 100%; display: block; + -webkit-filter: grayscale(1); + filter: grayscale(1); + transition: all 100ms ease-out; + } + + .gallery .gallery-item:hover img { + transform: scale(1.04); + -webkit-filter: grayscale(0); + filter: grayscale(0); } .overlay { @@ -48,7 +55,7 @@ transition: opacity 0.3s ease; } - .gallery-item:hover .overlay { + .gallery .gallery-item:hover .overlay { opacity: 1; } @@ -61,7 +68,7 @@ display: block; text-decoration: none; color: inherit; - } + } DeflaxTV Video Gallery