diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts index 7e879cb941..d3de606337 100644 --- a/src/runtime/transition/index.ts +++ b/src/runtime/transition/index.ts @@ -131,7 +131,27 @@ export function slide(node: Element, { `border-bottom-width: ${t * border_bottom_width}px;` }; } - +interface SwipeLeftParams { + delay?: number; + duration?: number; + easing?: EasingFunction; +} +export function swipeLeft(node: Element, { + delay = 0, + duration = 500, + easing = cubicInOut +}:SwipeLeftParams ) { + return { + delay, + duration, + css: t => { + const eased = easing(t); + return ` + transform: translate3d(-${(1-eased)*100}%,0,0); + ` + } + }; +} interface ScaleParams { delay?: number; duration?: number;