about summary refs log tree commit diff
path: root/src/lib/custom-animations/ScaleAndFade.ts
blob: ad2c15f8f659ca13e805c52a30f28dc2f269c599 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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,
  }
}