
The elastic button
Buttons, Hover, Text
A Secret Santa draw in one card: five people, five tiles. Pressing the button, the tiles turn to their wrapping-paper side, trade rows blind and land on the real draw, where nobody gets themselves. Only your own opens again, with a tap.
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>
<!--
"Secret Santa draw card" 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>Secret Santa draw card</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- a Secret Santa draw: the five names on the right shuffle and are sealed one by one;
only your own match can be opened, with a tap that turns the tile over -->
<section class="ss" data-ss aria-label="Secret Santa draw">
<header class="ss__head">
<span class="ss__tile" aria-hidden="true">
<svg viewBox="0 0 24 24"><rect x="4" y="10" width="16" height="10" rx="2"></rect><path d="M3 7h18v3H3zM12 7v13"></path><path data-bow d="M12 7c-1.200-3.500-5.200-3.300-4.600-1 .4 1.400 2.800 1.300 4.600 1c1.200-3.500 5.200-3.300 4.600-1-.4 1.400-2.800 1.300-4.600 1"></path></svg>
</span>
<span class="ss__who">
<b>Secret Santa</b>
<span>Studio party, 12 Dec, €20</span>
</span>
<span class="ss__pill">5 people</span>
</header>
<ul class="ss__list" data-list></ul>
<p class="ss__note" aria-live="polite"><span class="ss__roll"><span data-note>Nobody draws their own name</span></span></p>
<button class="ss__btn" type="button" data-draw><span class="ss__roll"><span data-label>Draw names</span></span></button>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
</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.
17 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 “Secret Santa draw card” from Animorio and fit it into my siteThe list is shuffled and tried again until nobody has their own name: with five people it takes about three tries on average. The animation comes after: the last trade lands the tiles where the result says.
Each tile has two faces with backface-visibility hidden inside a preserve-3d holder: GSAP turns the holder 180 degrees and you see the wrapping paper. The tiles move on y, measured from the rows.
After the draw a single tile becomes a reachable button: the one on your row. The others stay sealed and out of the keyboard’s way, because other people’s secret is not yours.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #d2374c | The wrapping paper’s colour. |
PINE | script.js | #1c7a55 | The colour of your match. |
NAMES | script.js | Marta, Idris, Chen, Paolo | The other four in the group, separated by a comma. |
SHUFFLES | script.js | 4 | How many times the names trade places before they stop. |
SWAP | script.js | 0.3 | How many seconds one trade lasts. |
HOLD | script.js | 3 | The seconds the match stays open before the demo starts again. |
LOOP | script.js | true | Left alone, a pointer draws the names and opens yours. |
In the app of a group of friends or coworkers before Christmas, on the site of a shop running a gift exchange, in a party app; and wherever a paired draw is needed: a team’s shifts, a tournament’s partners, who brings what to a dinner.
The same card: the button and the tile are tapped with a finger. The rows are also sized on the window’s height, and the tiles are laid again if the card changes size.
No spins and no trades: pressing the button, the tiles are already sealed in place, and yours opens and closes without motion.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.6 KB; the libraries: GSAP 28 KB.
Tested on 19 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.