Vibary.ai
← All particles

Coin Toss

Coins thrown up through the frame, turning far enough to show their edge.

celebrationplayfulenergetic18 particles · light · canvas-2d · automatic · finite
Variant

The canvas in this preview is the file shown here. The surrounding demo shell only provides context and is not part of the copied code.

285 lines · react only
import { useEffect, useRef } from "react";

/**
 * Vibary · Coin Toss
 *
 * Coins thrown up through the frame, tumbling, falling back out.
 *
 * The technique: at edge-on the coin shows its rim, not nothing. A disc

About this effect

A reward moment with weight to it — points credited, cashback earned, a bonus unlocked. At edge-on the coin shows its rim rather than nothing: a disc animated by scaling its width to the cosine of the turn vanishes into a hairline twice per revolution and reads as a squashed sticker, so here the silhouette never gets narrower than the coin's thickness and the lit face slides across that rim and swaps sides as it turns past edge-on. The throw is specified by where it should peak rather than by a velocity — launch speed is solved from the container height — so the arc stays in frame at any size.

Points creditedCashback earnedBonus unlockedReward reveal

Related effects