-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: This version includes support for Reanimated 1.4.0 and drops support for earlier versions. It also remove legacy functions to deal with transitions: toggle, useToggle, useTransition
- Loading branch information
1 parent
06025f4
commit 983a3ca
Showing
13 changed files
with
3,894 additions
and
2,007 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
{ | ||
"extends": "react-native-wcandillon", | ||
"rules": { | ||
"react-native/no-color-literals": 0, | ||
"import/prefer-default-export": 0, | ||
"import/no-unresolved": 0, | ||
"import/export": 0 | ||
"import/extensions": [ | ||
2, | ||
{ | ||
"extensions": [ | ||
".ts", | ||
".tsx" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Animated from "react-native-reanimated"; | ||
import { TransformsStyle } from "react-native"; | ||
|
||
const { divide, sub, multiply } = Animated; | ||
|
||
type AnimatedTransform = { | ||
[P in keyof TransformsStyle["transform"]]: Animated.Adaptable< | ||
TransformsStyle["transform"][P] | ||
>; | ||
}; | ||
|
||
export const translateZ = ( | ||
perspective: Animated.Adaptable<number>, | ||
z: Animated.Adaptable<number> | ||
) => ({ scale: divide(perspective, sub(perspective, z)) }); | ||
|
||
export const transformOrigin = ( | ||
x: Animated.Adaptable<number> = 0, | ||
y: Animated.Adaptable<number> = 0, | ||
...transformations: AnimatedTransform[] | ||
): AnimatedTransform[] => [ | ||
{ translateX: x }, | ||
{ translateY: y }, | ||
...transformations, | ||
{ translateX: multiply(x, -1) }, | ||
{ translateY: multiply(y, -1) } | ||
]; |
Oops, something went wrong.