/* PhotoSwipe overrides to match Immich's AssetViewer aesthetic. Layered on top of photoswipe/photoswipe.css. */ .pswp { --pswp-bg: #000; --pswp-placeholder-bg: #111; --pswp-icon-color: #fff; --pswp-icon-color-secondary: transparent; --pswp-icon-stroke-width: 0; --pswp-error-text-color: #fff; --pswp-preloader-color: rgba(255, 255, 255, 0.4); --pswp-preloader-color-secondary: rgba(255, 255, 255, 0.9); --pswp-transition-duration: 250ms; } /* Top toolbar: subtle dark backdrop, no shadows */ .pswp__top-bar { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent); height: 56px; } /* Standard icon buttons: cleaner sizing, hover state */ .pswp__top-bar .pswp__button { width: 44px; height: 44px; margin: 6px; border-radius: 50%; transition: background-color 0.15s; } .pswp__top-bar .pswp__button:hover, .pswp__top-bar .pswp__button:focus-visible { background-color: rgba(255, 255, 255, 0.12); outline: none; } .pswp__top-bar .pswp__button .pswp__icn { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 22px; height: 22px; color: var(--pswp-icon-color); } /* The zoom, counter, and close buttons are suppressed via PhotoSwipe options (counter/zoom/close: false in client/lightbox.ts) so they can be re-enabled through ipp.lightbox.options, rather than being hidden here in CSS. We use a top-left back arrow (registered as `back-button` in client/lightbox-ui.ts) in place of the close button, matching Immich's native asset-viewer. */ .pswp__button--download-button { color: #fff; } /* Side arrows: hover-revealed on desktop, hidden by default on mobile */ .pswp__button--arrow { width: 56px; height: 100px; margin-top: -50px; opacity: 0; transition: opacity 0.2s, background-color 0.15s; border-radius: 8px; background-color: transparent; } .pswp:hover .pswp__button--arrow { opacity: 0.6; } .pswp__button--arrow:hover, .pswp__button--arrow:focus-visible { opacity: 1; background-color: rgba(255, 255, 255, 0.12); outline: none; } /* Disable arrows at far ends of gallery */ .pswp__button--arrow:disabled { opacity: 0 !important; cursor: default; } /* Mobile: PhotoSwipe already auto-fades top bar; here we just hide arrows when configured to do so (default, matches Immich mobile). */ html.pswp-no-arrows .pswp__button--arrow { display: none !important; } /* When the info sidebar is open on desktop, both the top toolbar (which is absolutely positioned at right: 0) and the next-arrow button (right: 0) would sit underneath the 360px sidebar. Shift them inward so they stay visible inside the now-narrower slide viewport. Mobile is unaffected because the sidebar there is a bottom sheet, not a right-side dock. */ @media (min-width: 641px) { html.ipp-sidebar-open .pswp__top-bar { right: 360px; width: auto; } html.ipp-sidebar-open .pswp__button--arrow--next { right: 360px; } } @media (max-width: 640px) { html.pswp-no-mobile-arrows .pswp__button--arrow { display: none !important; } /* Mobile top bar is shorter and translucent */ .pswp__top-bar { height: 48px; } } /* Video slide content */ .pswp__video-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; pointer-events: none; /* let PhotoSwipe handle gestures except on the video */ } .pswp__video-wrap video { /* Fill the slide area immediately (the poster sizes the element before the stream loads) so the container doesn't snap to a new size when the video's real dimensions arrive. */ width: 100%; height: 100%; object-fit: contain; outline: none; pointer-events: auto; background: #000; } /* Smooth backdrop fade in/out to match Immich's open/close feel */ .pswp__bg { transition: opacity var(--pswp-transition-duration); } /* Image caption (from EXIF description) - centered in the 56px bottom margin carved out by the lightbox `padding.bottom` setting. */ .pswp__caption { position: absolute; left: 0; right: 0; bottom: 0; height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; line-height: 1.4; text-align: center; pointer-events: none; } .pswp__caption[hidden] { display: none; }