Skip to content

Commit

Permalink
fix: blast initial scale
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaHadjar committed Oct 31, 2024
1 parent 6800faa commit 9e0a2e5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Confetti.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,14 @@ export const Confetti = forwardRef<ConfettiMethods, ConfettiProps>(
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;
Expand Down

0 comments on commit 9e0a2e5

Please sign in to comment.