From be9276f4c0f1955901ef2d2d4bdcedc2ca4de272 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 7 Mar 2024 18:10:29 -0800 Subject: [PATCH] Better photo scaling without scroll in lightbox modal --- web/static/css/theme.css | 13 ++++++++++--- web/templates/photo/gallery.html | 14 ++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/web/static/css/theme.css b/web/static/css/theme.css index 8c9cfbf..cc05479 100644 --- a/web/static/css/theme.css +++ b/web/static/css/theme.css @@ -46,9 +46,16 @@ img { /* Photo modals in addition to Bulma .modal-content */ .photo-modal { - width: auto !important; - max-width: fit-content; - max-height: fit-content; + width: calc(100vw - 40px); + max-height: calc(100vh - 40px); +} +.photo-modal #detailImg { + background-size: contain; + background-repeat: no-repeat; + background-position: center center; +} +.photo-modal img { + max-height: calc(100vh - 50px); } /* Custom bulma tag colors */ diff --git a/web/templates/photo/gallery.html b/web/templates/photo/gallery.html index 81f9d8c..55a35fc 100644 --- a/web/templates/photo/gallery.html +++ b/web/templates/photo/gallery.html @@ -169,8 +169,12 @@