Streak Popups with Medal Flip
The first card stamps six shoe prints every 0.3s, each glowing green on landing before sinking into an inset impression. The second expands a laurel wreath and spins a glass medal with two highlight sweeps. Canvas2D and Skia share a display list.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "streak-popups-with-medal-flip" to this project. The full source is attached at the end of this prompt. Put the files under components/streak-popups-with-medal-flip/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Details
- Platforms
- iOS, Android, Web
- Requires
- Expo SDK 54+
- Access
- Pro
- Updated
- 15 Nov 2026
- License
- Unlimited commercial projects
- Original design
- @ivanboroja on X
Are you the designer? Ask us to change or remove this.
Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs
What it does
Two dark rounded popup cards side by side, one for a missed day and one for a three-day streak, on a six-second loop. In the first, six footprints appear one after another, alternating left and right. Each lands with a bright green glow that fades to an inset, pressed-in look, and the third print is black to mark the missed day. At the end they blur away in order. In the second card a laurel branch swells outward and settles, light rays strengthen behind a glass medal, and the medal turns a full revolution with a thick green edge and a readable 3 on both faces. Two glossy highlights then sweep across it. Each card ends with a pill label, a short message and a white button.
How it's built
A shared JavaScript core builds the timeline and emits a flat list of drawing instructions: paths, fills, gradients, blurs and clips. Every transform, including the medal's horizontal squash during the turn, is baked into the path data. A thin executor draws the list with Canvas2D in the HTML preview, and in React Native a Skia picture recorder replays it into a Skia canvas each frame. The footprint inset shadow is made by subtracting an offset copy of the shape and blurring it. Text and the button are ordinary views. A requestAnimationFrame loop sets the time, there are no Reanimated worklets, and the card exposes props for a frozen time, playing state, speed and press.
Good for
- Habit, streak and fitness apps that need a reward or missed-day popup
- Achievement unlocks and milestone dialogs
- A reference for drawing inset shadows and a coin flip with thickness in Skia
Dependencies
@shopify/react-native-skiaexpo-fontreact-native