diff --git a/packages/web/src/javascripts/Components/Panes/PaneAnimator.tsx b/packages/web/src/javascripts/Components/Panes/PaneAnimator.tsx index e64c58fd3..ee807a171 100644 --- a/packages/web/src/javascripts/Components/Panes/PaneAnimator.tsx +++ b/packages/web/src/javascripts/Components/Panes/PaneAnimator.tsx @@ -42,9 +42,6 @@ export async function animatePaneExitTransitionOffscreenToTheRight(elementId: st const animation = element.animate( [ - { - transform: 'translateX(0)', - }, { transform: 'translateX(100%)', }, diff --git a/packages/web/src/javascripts/Components/Panes/usePaneGesture.ts b/packages/web/src/javascripts/Components/Panes/usePaneGesture.ts index 4962f27a9..aab9aeb38 100644 --- a/packages/web/src/javascripts/Components/Panes/usePaneGesture.ts +++ b/packages/web/src/javascripts/Components/Panes/usePaneGesture.ts @@ -89,11 +89,10 @@ export const usePaneSwipeGesture = ( overlayElementRef.current = overlayElement } - const currentLeft = parseInt(element.style.left || '0') const newLeft = direction === 'right' ? Math.max(x, 0) : Math.min(x, 0) - element.style.left = `${newLeft}px` + element.animate([{ transform: `translate3d(${newLeft}px,0,0)` }], { duration: 0, fill: 'forwards' }) - const percent = Math.min(window.innerWidth / currentLeft / 10, 0.45) + const percent = Math.min(window.innerWidth / newLeft / 10, 0.45) overlayElementRef.current.animate([{ opacity: percent }], { duration: 0, fill: 'forwards',