about summary refs log tree commit diff
path: root/src/lib/custom-animations/ShrinkAndPop.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-05-20 18:56:44 -0500
committerGitHub <noreply@github.com>2024-05-20 16:56:44 -0700
commita7b0242cc8aaf09273abe20903e88e59a4acd1a7 (patch)
tree9e3f21bcf0def435877e2a1a9c5fc8eedc6c7950 /src/lib/custom-animations/ShrinkAndPop.ts
parent6dde48756366008a897bfffdcec6c1756df59ef4 (diff)
downloadvoidsky-a7b0242cc8aaf09273abe20903e88e59a4acd1a7.tar.zst
[🐴] Empty chat prompt (#4132)
* Add empty chat pill

* Tweak padding

* move to `components`, place inside `KeyboardStickyView`

* cleanup unused vars

* add a new animation type

* (unrelated) add haptic to long press

* adjust shrink and pop

---------

Co-authored-by: Hailey <me@haileyok.com>
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,
+  }
+}