fix: nav hover unified, lightbox full viewport with proper nav
CD — Kai-Sa-Cam Deployment / deploy (push) Successful in 10s

This commit is contained in:
2026-10-30 23:47:52 +01:00
parent c26d0d078c
commit a95b39d8cb
2 changed files with 48 additions and 33 deletions
+19 -10
View File
@@ -177,33 +177,42 @@ export function MediaGallery({ showToast }: MediaGalleryProps) {
{selectedItem && (
<div
className="fixed top-0 left-0 w-screen h-screen bg-black/90 backdrop-blur-md flex items-center justify-center z-[9999] animate-fade-in"
className="fixed inset-0 w-full h-full bg-black/95 backdrop-blur-md flex items-center justify-center z-[99999] animate-fade-in"
onClick={() => setSelectedItem(null)}
>
<button
className="absolute left-2 sm:left-4 top-1/2 -translate-y-1/2 glass-button rounded-full w-10 h-10 flex items-center justify-center z-[10000]"
className="fixed left-2 sm:left-4 top-1/2 -translate-y-1/2 glass-button rounded-full w-10 h-10 flex items-center justify-center z-[100000] text-lg"
onClick={(e) => {
e.stopPropagation();
const idx = media.findIndex((m) => m.filename === selectedItem.filename);
const prev = media[(idx - 1 + media.length) % media.length];
setSelectedItem(prev);
if (idx > 0) setSelectedItem(media[idx - 1]);
}}
disabled={media.findIndex((m) => m.filename === selectedItem.filename) === 0}
>
‹
</button>
<button
className="absolute right-2 sm:right-4 top-1/2 -translate-y-1/2 glass-button rounded-full w-10 h-10 flex items-center justify-center z-[10000]"
className="fixed right-2 sm:right-4 top-1/2 -translate-y-1/2 glass-button rounded-full w-10 h-10 flex items-center justify-center z-[100000] text-lg"
onClick={(e) => {
e.stopPropagation();
const idx = media.findIndex((m) => m.filename === selectedItem.filename);
const next = media[(idx + 1) % media.length];
setSelectedItem(next);
if (idx < media.length - 1) setSelectedItem(media[idx + 1]);
}}
disabled={
media.findIndex((m) => m.filename === selectedItem.filename) ===
media.length - 1
}
>
›
</button>
<button
className="fixed top-2 right-2 glass-button rounded-full w-10 h-10 flex items-center justify-center z-[100000] text-lg"
onClick={() => setSelectedItem(null)}
>
×
</button>
<div
className="relative w-full h-full flex items-center justify-center p-2 sm:p-4"
className="w-full h-full flex items-center justify-center"
onClick={(e) => e.stopPropagation()}
>
{selectedItem.type === "video" ? (
@@ -211,13 +220,13 @@ export function MediaGallery({ showToast }: MediaGalleryProps) {
src={selectedItem.url}
controls
autoPlay
className="w-full h-full object-contain rounded-[20px] sm:rounded-[30px]"
className="w-full h-full max-w-full max-h-full object-contain"
/>
) : (
<img
src={selectedItem.url}
alt={selectedItem.filename}
className="w-full h-full object-contain rounded-[20px] sm:rounded-[30px]"
className="w-full h-full max-w-full max-h-full object-contain"
/>
)}
</div>