Skip to content

Commit

Permalink
fix(frontend/HorizontalSwipe): スワイプ・UIアニメーションが無効の際はトランジションを行わないように (m…
Browse files Browse the repository at this point in the history
…isskey-dev#13076)

* fix(frontend/HorizontalSwipe): アニメーションを減らすが考慮されるように

* fix

* fix

* revert unused change

* fix
  • Loading branch information
kakkokari-gtyih authored and AyumuNekozuki committed Feb 16, 2024
1 parent 5649ef9 commit 22f1532
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/frontend/src/components/MkHorizontalSwipe.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div
ref="rootEl"
:class="[$style.transitionRoot]"
:class="[$style.transitionRoot, { [$style.enableAnimation]: shouldAnimate }]"
@touchstart.passive="touchStart"
@touchmove.passive="touchMove"
@touchend.passive="touchEnd"
Expand Down Expand Up @@ -44,6 +44,8 @@ const emit = defineEmits<{
(ev: 'swiped', newKey: string, direction: 'left' | 'right'): void;
}>();

const shouldAnimate = computed(() => defaultStore.reactiveState.enableHorizontalSwipe.value || defaultStore.reactiveState.animation.value);

// ▼ しきい値 ▼ //

// スワイプと判定される最小の距離
Expand Down Expand Up @@ -188,7 +190,9 @@ watch(tabModel, (newTab, oldTab) => {
.transitionChildren {
grid-area: 1 / 1 / 2 / 2;
transform: translateX(var(--swipe));
}

.enableAnimation .transitionChildren {
&.swipeAnimation_enterActive,
&.swipeAnimation_leaveActive {
transition: transform .3s cubic-bezier(0.65, 0.05, 0.36, 1);
Expand Down

0 comments on commit 22f1532

Please sign in to comment.