fix: hide fullscreen arrows on mobile

This commit is contained in:
2026-06-14 11:36:18 +02:00
parent 298e11c10b
commit efddb34399
2 changed files with 27 additions and 3 deletions

View File

@@ -289,16 +289,29 @@ function syncOverlayDownload(photo) {
overlayDownload.setAttribute("aria-disabled", "false"); overlayDownload.setAttribute("aria-disabled", "false");
} }
function getPhotoTimelineOrder(photos) {
return [...photos].sort((left, right) => {
const leftTime = getPhotoTimestamp(left)?.getTime() ?? Number.POSITIVE_INFINITY;
const rightTime = getPhotoTimestamp(right)?.getTime() ?? Number.POSITIVE_INFINITY;
if (leftTime !== rightTime) {
return leftTime - rightTime;
}
return String(left.name).localeCompare(String(right.name));
});
}
function getOverlayPhotos() { function getOverlayPhotos() {
if (!state.visiblePhotos.length) { if (!state.visiblePhotos.length) {
return state.photos; return getPhotoTimelineOrder(state.photos);
} }
if (state.activePhotoId && state.visiblePhotos.some((photo) => photo.id === state.activePhotoId)) { if (state.activePhotoId && state.visiblePhotos.some((photo) => photo.id === state.activePhotoId)) {
return state.visiblePhotos; return getPhotoTimelineOrder(state.visiblePhotos);
} }
return state.photos.length ? state.photos : state.visiblePhotos; return state.photos.length ? getPhotoTimelineOrder(state.photos) : getPhotoTimelineOrder(state.visiblePhotos);
} }
function findPhotoByName(photoName, photos = state.photos) { function findPhotoByName(photoName, photos = state.photos) {

View File

@@ -762,6 +762,17 @@ export const APP_STYLES = ` :root {
pointer-events: none; pointer-events: none;
} }
@media (max-width: 760px) {
.overlay-prev,
.overlay-next {
display: none;
}
.overlay-download {
right: 16px;
}
}
.overlay-nav { .overlay-nav {
position: fixed; position: fixed;
top: 50%; top: 50%;