From 9e0a2e55e350c3ceaefd9a5bbe55294347df2ab7 Mon Sep 17 00:00:00 2001 From: Alireza Hadjar Date: Fri, 1 Nov 2024 01:44:34 +0300 Subject: [PATCH] fix: blast initial scale --- src/Confetti.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Confetti.tsx b/src/Confetti.tsx index c268479..5c60e59 100644 --- a/src/Confetti.tsx +++ b/src/Confetti.tsx @@ -317,7 +317,14 @@ export const Confetti = forwardRef( Extrapolation.CLAMP ); - const scale = Math.abs(Math.cos(rx)); // Scale goes from 1 -> 0 -> 1 + const oscillatingScale = Math.abs(Math.cos(rx)); // Scale goes from 1 -> 0 -> 1 + const blastScale = interpolate( + progress.value, + [0, 0.2, 1], + [0, 1, 1], + Extrapolation.CLAMP + ); + const scale = blastScale * oscillatingScale; const px = flakeSize.width / 2; const py = flakeSize.height / 2;