Add image lightbox — click gallery image to view full-screen

Clicking any image in a post modal opens it full-screen with a dark
overlay. Close by clicking outside, the ✕ button, or pressing Escape.
Added zoom-in cursor and hover opacity to signal clickability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 09:36:40 +02:00
parent 7bb5924cf6
commit af55297452
3 changed files with 64 additions and 1 deletions

View File

@@ -426,7 +426,49 @@ footer {
object-fit: cover;
border-radius: 8px;
flex-shrink: 0;
cursor: zoom-in;
transition: opacity 0.15s;
}
.img-gallery img:hover { opacity: 0.88; }
/* =====================
LIGHTBOX
===================== */
#lightboxOverlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.92);
z-index: 9999;
align-items: center;
justify-content: center;
animation: lbFade 0.18s ease;
}
#lightboxOverlay.open { display: flex; }
#lightboxImg {
max-width: 92vw;
max-height: 90vh;
object-fit: contain;
border-radius: 6px;
box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.lightbox-close {
position: fixed;
top: 18px;
right: 22px;
background: rgba(255,255,255,0.15);
border: none;
color: #fff;
font-size: 1.6rem;
width: 42px;
height: 42px;
border-radius: 50%;
cursor: pointer;
line-height: 1;
transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }
@keyframes lbFade { from { opacity:0 } to { opacity:1 } }
/* =====================
SUBMIT FORM (in modal)