Skip to content

Replace the 12MB money video with a canvas animation - #44

Merged
zlshames merged 1 commit into
masterfrom
money-rain
Sep 18, 2026
Merged

zlshames merged 1 commit into
masterfrom
money-rain

Conversation

@zlshames

Copy link
Copy Markdown
Member

money.webm was 12MB for a six-second celebration.

Deferring it with preload="none" fixed the page weight, but moved the cost somewhere worse: the download began at the moment of the celebration. A donor on a slow connection got their confetti late, or not at all — the worst possible moment to be waiting on 12MB.

Now

Drawn on a canvas: falling banknotes with sway, rotation and a fade-out, count scaled to the viewport so a phone isn't buried and a desktop doesn't look sparse.

Before After
Weight 12MB ~6kB inline JS
Download at celebration 12MB none
Starts after the download on the frame it's called

prefers-reduced-motion is handled inside the component, so the donation flow no longer checks it.

Two things found by testing rather than reading

  • Notes all spawned above the viewport, leaving a beat of empty screen before anything fell. Visible as a canvas that was shown but painting nothing. They now start spread across and above it, so it's raining instantly.
  • It rained yen, euros and pounds alongside dollars, which is noise next to a price in USD. Dollars only now.

The public/media/ directory is gone, and the build confirms zero references to the old file.

🤖 Generated with Claude Code

money.webm was 12MB for a six-second celebration. Deferring it with
preload="none" fixed the page weight but moved the cost somewhere worse:
the download began at the moment of the celebration, so a donor on a slow
connection got their confetti late or not at all -- exactly the wrong
moment to be waiting on 12MB.

It is now drawn on a canvas: falling banknotes with sway, rotation and a
fade-out, sized to the viewport so a phone is not buried and a desktop does
not look sparse. About 6kB of inline JS, nothing downloaded, and it starts
on the frame it is called.

Notes spawn spread across and above the viewport rather than all above it.
The first version had them start off-screen, which left a beat of empty
screen before anything fell -- visible as a canvas that was shown but
painting nothing.

Dollars only. The first pass rained yen, euros and pounds alongside
dollars, which is just noise next to a price in USD.

prefers-reduced-motion is handled inside the component, so the donation
flow no longer has to check it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@zlshames
zlshames merged commit 57f5379 into master Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant