
The star rating
Ratings, SVG, Hover
The ticket of Lodestar Six, a made-up lottery, on cream security paper with fine guilloche lines, stamp-cut edges, a holographic seal, a serial number and a barcode. Above it sits the draw board with six reels. Pressing Check results spins the reels, which stop one after the other with a small settle; every drawn number that is also on the ticket gets circled in pen, the matched counter goes up and in the end the prize rolls in digit by digit while a line of light runs over the ticket. Play again puts everything back.
A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.
<!doctype html>
<!--
"Lottery ticket" from Animorio · https://animorio.com
License: free on your own sites and your clients’ sites, paid work included.
Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lottery ticket</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/index.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage" data-stage>
<!-- the ticket of Lodestar Six, an invented lottery: Check results spins six reels for the winning numbers,
every number that is also on the ticket gets circled by hand, the count goes up and the prize rolls in -->
<section class="lotto" aria-labelledby="l-title" data-card>
<svg class="defs" aria-hidden="true" focusable="false">
<defs data-filters></defs>
</svg>
<div class="board" data-board>
<div class="board__head">
<span class="board__label">Winning numbers</span>
<span class="board__draw">Draw 1184 · Sat 21 Nov</span>
</div>
<ol class="reels" aria-hidden="true" data-reels></ol>
</div>
<div class="ticket-wrap" data-ticket-wrap>
<article class="ticket" data-ticket>
<svg class="ticket__guilloche" aria-hidden="true" data-guilloche></svg>
<span class="ticket__sheen" aria-hidden="true"></span>
<header class="ticket__head">
<span class="seal" aria-hidden="true" data-seal>
<svg viewBox="0 0 24 24"><path d="M12 3.2 13.9 10.1 20.8 12 13.9 13.9 12 20.8 10.1 13.9 3.2 12 10.1 10.1Z"/><circle cx="12" cy="12" r="8.6"/><circle cx="12" cy="12" r="10.2"/></svg>
</span>
<div class="ticket__name">
<h2 class="ticket__brand" id="l-title">Lodestar <span>Six</span></h2>
<p class="ticket__sub">6 from 49 · Saturday draw</p>
</div>
<span class="ticket__price"><small>Play</small>$2</span>
</header>
<p class="ticket__label">Your numbers</p>
<ul class="picks" aria-label="Your numbers" data-picks></ul>
<div class="perf" aria-hidden="true">
<span class="perf__holes"></span>
<span class="perf__micro" data-micro></span>
</div>
<footer class="stub">
<svg class="barcode" viewBox="0 0 120 26" preserveAspectRatio="none" aria-hidden="true" data-barcode></svg>
<p class="stub__serial"><span>Serial</span><b data-serial>2611 0418 7302</b></p>
</footer>
<span class="ticket__sweep" aria-hidden="true" data-sweep></span>
</article>
</div>
<div class="result">
<div class="result__text" aria-hidden="true">
<p class="result__count"><span class="digit" data-count></span> of 6 matched</p>
<p class="result__prize"><span class="result__line" data-prize>Match 3 to win</span></p>
</div>
<button class="check" type="button" data-check>
<span class="check__face" data-face>
<span class="check__shine" aria-hidden="true"></span>
<span class="check__label" data-label>
<svg class="check__icon" viewBox="0 0 16 16" aria-hidden="true" data-icon><path d="M13 8a5 5 0 1 1-1.6-3.7"/><path d="M11.8 1.8v2.8H9"/></svg>
<span data-label-text>Check results</span>
</span>
<span class="check__bar" aria-hidden="true"><i data-bar></i></span>
</span>
</button>
</div>
<p class="sr" aria-live="polite" data-live></p>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.
51 values to change
With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:
Take “Lottery ticket” from Animorio and fit it into my siteEvery reel is a column of random numbers ending with the drawn number. A GSAP tween takes the column in yPercent to the last number and at the same time y four pixels further, with a power2.out; then an elastic.out brings y back to zero. On every frame the column’s speed becomes the vertical stdDeviation of its own SVG feGaussianBlur, so the numbers blur only vertically and turn sharp again when they stop.
The circle is an ellipse worked out in 52 points, tilted, going round one turn and a tenth: the radius changes with two sines (WOBBLE) and grows slowly, so the end passes outside the start like a real pen. The points are joined with quadratic curves at the midpoints; two paths, a full one and a thin one shifted by half a pixel, are drawn with strokeDashoffset from the length to zero.
The pattern is drawn in SVG on every resize: two families of thirteen waves of stacked sines, in opposite phase, crossing as on a banknote, stronger at the sides through a mask. The ticket edges are two repeated radial gradients in the mask, and the shadow is a drop-shadow on the wrapper, so it follows the cuts. The barcode comes from a number generator with a fixed seed.
The counter is a column from zero to six, the prize a column from 0 to 9 repeated twice for each digit: yPercent takes them to the right number, with a back.out for the counter and a longer power3.out for each digit of the prize. The whole sequence is a GSAP timeline; with nobody touching it, a delayedCall starts again after the result and after the return.
| Name | File | Default | What it changes |
|---|---|---|---|
PICKS | script.js | 7, 12, 19, 23, 34, 41 | The player’s six numbers printed on the ticket. |
DRAW | script.js | 23, 4, 41, 30, 12, 45 | The six numbers drawn in the first round, in the order of the draw; after that they are random. |
PRIZES | script.js | 0, 0, 0, 40, 250, 12000, 2400000 | The prize in dollars for 0, 1, 2… 6 matched numbers. |
MAX | script.js | 49 | The numbers go from 1 to this. |
SPIN | script.js | 1.1 | The seconds the first reel spins. |
STAGGER | script.js | 0.44 | The seconds between one reel stopping and the next. |
OVERSHOOT | script.js | 4 | The pixels a reel passes the number by before settling. |
WOBBLE | script.js | 0.05 | How irregular the pen circle is. |
PEN | script.js | 0.5 | The seconds to circle a number. |
SPEED | script.js | 1 | The speed of everything. |
AUTO | script.js | true | The ticket checking itself and starting again until someone touches it. |
--pen | style.css | #e0442a | The red of the pen, the lit windows and the prize. |
--paper | style.css | #fbf7ee | The ticket paper. |
--board | style.css | #131a2b | The draw board. |
On the site or app of a lottery, a charity raffle, a prize contest or any draw game: the moment someone who bought a ticket checks the results and sees at once which numbers they matched. It also suits picking the winners of an event, a giveaway or a company raffle.
The piece narrows to 92% of the screen and the reels, the numbers and the barcode get shorter with the height of the box, so the board, the ticket and the button all fit. A tap on the button shrinks it like the mouse; the tilt of the ticket stays mouse only.
No spinning reels, springs, tilt or light sweep: the drawn numbers fade in one after the other, the pen circles fade in already drawn, the counter and the prize change without rolling and the button labels swap with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.
Tested on 18 November 2026
Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.