Edited: Added Blur transition

pull/3477/head
Vaibhav Tandon 6 years ago committed by GitHub
parent df2164df78
commit efa17333c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -12,18 +12,20 @@ export interface TransitionConfig {
interface BlurParams {
delay: number;
duration: number;
amount: number;
}
export function blur(node: Element, {
delay = 0,
duration = 400
duration = 400,
amount = 5
}: BlurParams): TransitionConfig {
const f = +getComputedStyle(node).filter;
const f = getComputedStyle(node).filter.replace(/^none$/, '');
return {
delay,
duration,
css: t => `filter: blur(${t * f})`
css: (t, u) => `opacity: ${t}; filter: ${f} blur(${u * amount}px);`
};
}

Loading…
Cancel
Save