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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user