We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 33ebcfb + 46e9e94 commit 2045165Copy full SHA for 2045165
src/runtime/transition/index.ts
@@ -1,4 +1,4 @@
1
-import { cubicOut, cubicInOut } from 'svelte/easing';
+import { cubicOut, cubicInOut, linear } from 'svelte/easing';
2
import { assign, is_function } from 'svelte/internal';
3
4
type EasingFunction = (t: number) => number;
@@ -43,17 +43,20 @@ export function blur(node: Element, {
43
interface FadeParams {
44
delay: number;
45
duration: number;
46
+ easing: EasingFunction;
47
}
48
49
export function fade(node: Element, {
50
delay = 0,
- duration = 400
51
+ duration = 400,
52
+ easing = linear
53
}: FadeParams): TransitionConfig {
54
const o = +getComputedStyle(node).opacity;
55
56
return {
57
delay,
58
duration,
59
+ easing,
60
css: t => `opacity: ${t * o}`
61
};
62
0 commit comments