This commit is contained in:
Jon Staab
2024-10-17 16:03:50 -07:00
parent 2f561149fa
commit fd5b0a9af3
33 changed files with 129 additions and 140 deletions
+7 -6
View File
@@ -9,8 +9,8 @@ export const fly = (node: Element, params?: FlyParams | undefined) =>
baseFly(node, {y: 20, ...params})
export type TranslateParams = {
delay?: number,
duration?: number,
delay?: number
duration?: number
easing?: (t: number) => number
axis?: "x" | "y"
reverse?: boolean
@@ -18,7 +18,7 @@ export type TranslateParams = {
export const translate = (
node: Element,
{delay = 0, duration = 400, easing = cubicOut, axis = "y", reverse = false}: TranslateParams = {}
{delay = 0, duration = 400, easing = cubicOut, axis = "y", reverse = false}: TranslateParams = {},
) => {
return {
delay,
@@ -32,7 +32,7 @@ export const translate = (
} else {
return `transform: translateY(${p})`
}
}
},
}
}
@@ -75,5 +75,6 @@ export function slideAndFade(
}
}
export const conditionalTransition = (condition: any, transition: any) =>
(node: any, args?: any) => condition ? transtion(node, args) : null
export const conditionalTransition =
(condition: any, transition: any) => (node: any, args?: any) =>
condition ? transtion(node, args) : null