From 46e9e94a99f8281eaed0f62b626e8f4dc30f0b85 Mon Sep 17 00:00:00 2001 From: Leonardo Marquine Date: Wed, 30 Oct 2019 09:34:26 -0300 Subject: [PATCH] Add easing param to fade transition --- src/runtime/transition/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts index ec19ca1b68af..0a20c81b1f83 100644 --- a/src/runtime/transition/index.ts +++ b/src/runtime/transition/index.ts @@ -1,4 +1,4 @@ -import { cubicOut, cubicInOut } from 'svelte/easing'; +import { cubicOut, cubicInOut, linear } from 'svelte/easing'; import { assign, is_function } from 'svelte/internal'; type EasingFunction = (t: number) => number; @@ -43,17 +43,20 @@ export function blur(node: Element, { interface FadeParams { delay: number; duration: number; + easing: EasingFunction; } export function fade(node: Element, { delay = 0, - duration = 400 + duration = 400, + easing = linear }: FadeParams): TransitionConfig { const o = +getComputedStyle(node).opacity; return { delay, duration, + easing, css: t => `opacity: ${t * o}` }; }