Skip to content

Instantly share code, notes, and snippets.

View imjamescrain's full-sized avatar

James Crain imjamescrain

View GitHub Profile
@imjamescrain
imjamescrain / confetti.js
Last active December 15, 2023 06:59
Re-write of Shopify's -> Arrive's Confetti in Reanimated v2
import React, { useEffect } from "react";
import Animated, { FadeOut, withDelay, withTiming, useSharedValue, useAnimatedStyle, cancelAnimation } from "react-native-reanimated";
import PropTypes from "prop-types";
import { Dimensions, StyleSheet } from "react-native";
import FastImage from "react-native-fast-image";
import ConfettiImage from "../../../assets/img/confetti.png";
const NUM_CONFETTI = 100;
const COLORS = ["#31ECBC", "#E0DAFE", "#6345F9"];
const CONFETTI_SIZE = 16;