1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-25 22:34:49 +02:00

Update MkImageGallery.vue

This commit is contained in:
syuilo
2026-07-10 08:36:42 +09:00
parent d5609abf25
commit 95901e5220

View File

@@ -54,7 +54,13 @@ const imagesOffset = ref(currentIndex.value * -window.innerWidth);
let currentScrollLeft = imagesOffset.value;
function onHorizontalSwipe(offset: number) {
imagesOffset.value = currentScrollLeft + offset;
if (currentIndex.value === 0 && offset > 0) { // これ以上戻れない
imagesOffset.value = currentScrollLeft + (offset / 3);
} else if (currentIndex.value === props.images.length - 1 && offset < 0) { // これ以上進めない
imagesOffset.value = currentScrollLeft + (offset / 3);
} else {
imagesOffset.value = currentScrollLeft + offset;
}
}
function scrollToCurrentIndex() {