Added a blur transition

pull/3477/head
vaibhav111tandon 5 years ago
parent 5b4758f0f8
commit df2164df78

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "svelte",
"version": "3.8.1",
"version": "3.9.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -9,6 +9,24 @@ export interface TransitionConfig {
tick?: (t: number, u: number) => void;
}
interface BlurParams {
delay: number;
duration: number;
}
export function blur(node: Element, {
delay = 0,
duration = 400
}: BlurParams): TransitionConfig {
const f = +getComputedStyle(node).filter;
return {
delay,
duration,
css: t => `filter: blur(${t * f})`
};
}
interface FadeParams {
delay: number;
duration: number;

Loading…
Cancel
Save