diff options
Diffstat (limited to 'src/lib/custom-animations/ScaleAndFade.ts')
-rw-r--r-- | src/lib/custom-animations/ScaleAndFade.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/custom-animations/ScaleAndFade.ts b/src/lib/custom-animations/ScaleAndFade.ts new file mode 100644 index 000000000..ad2c15f8f --- /dev/null +++ b/src/lib/custom-animations/ScaleAndFade.ts @@ -0,0 +1,39 @@ +import {withTiming} from 'react-native-reanimated' + +export function ScaleAndFadeIn() { + 'worklet' + + const animations = { + opacity: withTiming(1), + transform: [{scale: withTiming(1)}], + } + + const initialValues = { + opacity: 0, + transform: [{scale: 0.7}], + } + + return { + animations, + initialValues, + } +} + +export function ScaleAndFadeOut() { + 'worklet' + + const animations = { + opacity: withTiming(0), + transform: [{scale: withTiming(0.7)}], + } + + const initialValues = { + opacity: 1, + transform: [{scale: 1}], + } + + return { + animations, + initialValues, + } +} |