Skip to content
animorio
IT
All components

Secret Santa draw card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.6 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On white, a light card: at the top the parcel with its bow, “Secret Santa”, the party and the budget, and the “5 people” pill. Below, five rows: on the left who gives, with initials and name (the first row is you), on the right a tile with initials. Pressing “Draw names” the bow shakes, the five tiles turn one after another to their wrapping-paper side, red with a white ribbon, and trade rows four times, swinging aside so they do not pass through each other; the last trade lands them on the real draw, worked out so that nobody gets their own name. Then a thin line draws from each person to their gift and the tile on your row turns green, with a halo: it is the only one you can open. Tapping it, it spins round and shows the initials, while the line below rolls to “You give to Chen. Keep it secret”; another tap closes it. The button, now “Draw again”, redoes the draw.

How it works

A fair draw

The 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.

Two-sided tiles

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.

Only yours opens

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#d2374cThe wrapping paper’s colour.
PINEscript.js#1c7a55The colour of your match.
NAMESscript.jsMarta, Idris, Chen, PaoloThe other four in the group, separated by a comma.
SHUFFLESscript.js4How many times the names trade places before they stop.
SWAPscript.js0.3How many seconds one trade lasts.
HOLDscript.js3The seconds the match stays open before the demo starts again.
LOOPscript.jstrueLeft alone, a pointer draws the names and opens yours.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

No spins and no trades: pressing the button, the tiles are already sealed in place, and yours opens and closes without motion.

Pitfalls

  • Names, party and budget are made up. In a real app the draw happens on the server and each person gets only their own match: here the browser knows them all, so it is not a real secret.
  • The tile that opens is a button whose label changes (“Your match, tap to reveal”, then “You give to Chen”), and the line below sits in an aria-live region.
  • With 3D tiles you need perspective on the holder and backface-visibility with the -webkit- prefix too, or Safari shows both faces at once.

Libraries

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.

Testing

Tested on 19 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components