ISSUE-058 - New opening/closing transition props feature added. Last name wiping added.
Now we can define separate opening and closing transition settings as well as common (both ways) transition props. This is all pretty cool. Timing for open/close animations and transitions are looking better and more mature.
This commit is contained in:
1 parent
a38af0dec4
commit
9f4e564a74
5 files changed
+162
-80
No files matched your search
+29
-3
@@ -69,16 +69,42 @@ export function wipeCustomDegClip(
|
||||
* @param propsArray
|
||||
* @returns
|
||||
*/
|
||||
export function commonTransition(propsArray: TransitionArgs[]) {
|
||||
export function commonTransition(propsArray: TransitionArgs[] = []) {
|
||||
if (propsArray.length === 0){
|
||||
return "";
|
||||
}
|
||||
|
||||
return (
|
||||
"transition: "
|
||||
+ propsArray.map(p => `
|
||||
${p?.property ?? "all"} ${p?.duration ?? 1000}ms ${p?.timing ?? ""} ${p?.delay ?? 0}ms
|
||||
`).join(", ")
|
||||
${p?.property ?? "all"} ${p?.duration ?? 1000}ms ${p?.timing ?? ""} ${p?.delay ?? 0}ms`,
|
||||
).join(", ")
|
||||
+ ";"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* An extension and evolution of commonTransition() provides a way to define
|
||||
* transition configurations that can be differentiated by which direction
|
||||
* (opening or closing) that they're going and can even support additional
|
||||
* "shared" properties that are common in either direction.
|
||||
* @param open the (often visible) state of the element
|
||||
* @param openingPropsArray what transition props to use when "open" (opening)
|
||||
* @param closingPropsArray what transition props to use when "closed" (closing)
|
||||
* @param sharedPropsArray what transition props to use in either direction
|
||||
* @returns
|
||||
*/
|
||||
export function commonDirectionalTransition(
|
||||
open: boolean,
|
||||
openingPropsArray: TransitionArgs[] = [],
|
||||
closingPropsArray: TransitionArgs[] = [],
|
||||
sharedPropsArray: TransitionArgs[] = [],
|
||||
) {
|
||||
return open
|
||||
? commonTransition(openingPropsArray.concat(sharedPropsArray))
|
||||
: commonTransition(closingPropsArray.concat(sharedPropsArray));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the x, y coordinates of a six point polygon for use in a clip-path
|
||||
* mask. By taking a fraction to indicate the progress through the animation it
|
||||
|
||||
Reference in new issue
Block a user