about summary refs log tree commit diff
path: root/src/lib/custom-animations/ShrinkAndPop.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/custom-animations/ShrinkAndPop.ts')
-rw-r--r--src/lib/custom-animations/ShrinkAndPop.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lib/custom-animations/ShrinkAndPop.ts b/src/lib/custom-animations/ShrinkAndPop.ts
new file mode 100644
index 000000000..ea2386c14
--- /dev/null
+++ b/src/lib/custom-animations/ShrinkAndPop.ts
@@ -0,0 +1,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,
+  }
+}