about summary refs log tree commit diff
path: root/src/lib/custom-animations/ShrinkAndPop.ts
blob: ea2386c14e928ace90a40e01ca0d7e2f9d998a32 (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
import {withDelay, withSequence, withTiming} from 'react-native-reanimated'

export function ShrinkAndPop() {
  'worklet'

  const animations = {
    opacity: withDelay(125, withTiming(0, {duration: 125})),
    transform: [
      {
        scale: withSequence(
          withTiming(0.7, {duration: 75}),
          withTiming(1.1, {duration: 150}),
        ),
      },
    ],
  }

  const initialValues = {
    opacity: 1,
    transform: [{scale: 1}],
  }

  return {
    animations,
    initialValues,
  }
}