Scratch

You won

Text

Type

Colour

Ground

Ground

Motion

Plays

Checking your unlocks…

About this effect

Scratch prints your words in a coat of scratch-off foil, grained and lightly brushed, with a sheen gliding over it, and hides a bright two-colour prize underneath. A coin scratches it off in quick strokes up and down, working across the words; the foil darkens at the edge of every cut, flakes come away and tumble, and once most of it is gone the rest falls off and the prize glints with little stars. Move the pointer over the letters and you scratch too. On a loop the foil coats the letters again and the coin goes once more.

The foil is a layer the coin cuts into, so a scratch stays exactly where it was made; how much is left is checked a few times a second on a tiny copy. It is drawn on a canvas from the heading's own letters (font, size and line breaks are the page's), and the heading keeps your words for screen readers and search.

Coin sets how wide each stroke is. Heavy letters hold the most foil; it suits giveaways, launches, discount codes and any reveal you want people to play with.

Formats
React, HTML
No dependencies
Built with
Canvas, over real text
Default font Unbounded
Plays
Loop, In view, Hover
Reduced motion
Respected
Shows the finished frame

Accessibility. One real heading, read once; the foil and prize are drawn on a canvas hidden from screen readers. Under reduced motion the prize shows from the start, with no foil to scratch.

Also known as scratch card text, scratch off reveal, scratch to reveal, lottery text effect, foil reveal text, interactive reveal.

Use it in anything you build, client work included, no credit needed. Don’t republish or resell the effect itself.

More reveal