diff --git a/packages/frontend/src/components/MkImageGallery.item.vue b/packages/frontend/src/components/MkImageGallery.item.vue index 30af595707..3da3fb821d 100644 --- a/packages/frontend/src/components/MkImageGallery.item.vue +++ b/packages/frontend/src/components/MkImageGallery.item.vue @@ -326,6 +326,22 @@ function onPointerup(ev: PointerEvent) { const shouldCloseByDownwardSwipe = verticalSwipeDelta > 200 || (verticalSwipeDelta > 0 && pointerVec.y > 5); // 下の方で離された、または下に向かって強めに弾かれた if (shouldCloseByUpwardSwipe || shouldCloseByDownwardSwipe) { emit('close'); + beginAnimation({ + from: { + x: translation.value.x, + y: translation.value.y, + }, + to: { + x: translation.value.x, + y: translation.value.y + (shouldCloseByUpwardSwipe ? -window.innerHeight : window.innerHeight), + }, + duration: 200, + easing: easing_easeInOutQuad, + apply: (state) => { + translation.value.x = state.x; + translation.value.y = state.y; + }, + }); return; } diff --git a/packages/frontend/src/components/MkImageGallery.vue b/packages/frontend/src/components/MkImageGallery.vue index ba4000df12..0ded924c37 100644 --- a/packages/frontend/src/components/MkImageGallery.vue +++ b/packages/frontend/src/components/MkImageGallery.vue @@ -4,24 +4,33 @@ SPDX-License-Identifier: AGPL-3.0-only -->