Skip to content
animorio
IT
All components

Serum product card

Cards, Hover, ImagesGSAP, CSS onlyEasyCompressed weight: Demo 5.6 KBGSAP 28 KBFreeDownload the zip

The card of a skincare product: a serum in its amber dropper bottle, in a real photo on a warm tile. Three sizes to choose, 15, 30 and 50 ml: the pill slides, the bottle grows or shrinks on a spring, the price counts to the new one, the price per millilitre rolls below and “Best value” appears on the size that pays off. “Add to bag” confirms with the chosen size.

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>
<!--
  "Serum product 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>Serum product 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">
    <!-- the product card of a skincare shop: the size picked changes the price, the price per millilitre and
         how large the bottle looks, and Add to bag confirms with the size -->
    <section class="sr" data-sr aria-labelledby="sr-title">
      <div class="sr__shot">
        <span class="sr__bottle" data-bottle><img src="siero.webp" alt="Amber glass dropper bottle with a plain paper label" width="840" height="840"></span>
        <i class="sr__grain" aria-hidden="true"></i>
        <em class="sr__chip">Niacinamide 10%</em>
        <em class="sr__best" data-best aria-hidden="true">Best value</em>
      </div>

      <div class="sr__row">
        <span class="sr__name"><b id="sr-title">Dew Drop Serum</b><span>Brightening, for every day</span></span>
        <span class="sr__price" aria-live="polite"><b data-price>€29</b><span class="sr__perroll"><span data-per>€0.97 per ml</span></span></span>
      </div>

      <div class="sr__sizes" role="radiogroup" aria-label="Size" data-sizes>
        <i class="sr__pick" data-pick aria-hidden="true"></i>
        <button class="sr__size" type="button" role="radio" aria-checked="false" tabindex="-1" data-size data-ml="15" data-eur="18">15 ml</button>
        <button class="sr__size" type="button" role="radio" aria-checked="true" data-size data-ml="30" data-eur="29">30 ml</button>
        <button class="sr__size" type="button" role="radio" aria-checked="false" tabindex="-1" data-size data-ml="50" data-eur="42">50 ml</button>
      </div>

      <button class="sr__go" type="button" data-go>
        <svg viewBox="0 0 18 18" aria-hidden="true"><path class="bag" d="M4 6.500h10l-.800 8.500H4.800ZM6.500 6.500V5a2.500 2.500 0 0 1 5 0v1.500"></path><path class="ck" pathLength="1" d="m5 9.500 3 3 5.500-6"></path></svg>
        <span class="sr__gotext"><span data-golabel>Add to bag</span></span>
      </button>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

23 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Serum product 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 card: at the top a cream tile with the photo of an amber glass bottle with a black dropper and a paper label, a white tag “Niacinamide 10%” in the corner and a veil of grain. Below, “Dew Drop Serum”, “Brightening, for every day” and on the right the price, “€29”, with “€0.97 per ml” under it. Then three sizes in a row, 15 ml, 30 ml, 50 ml, with the white pill on the chosen one, and the black button “Add to bag” with the bag. Choose 50 ml and the pill slides and settles, the bottle grows from its base on a spring, the price counts to “€42” with a small jump, “€0.84 per ml” rolls below and the rust tag “Best value” arrives in the top right corner. With 15 ml the bottle shrinks, “€18”, “€1.20 per ml”, and the tag leaves. “Add to bag”: the bottle gives a little hop, the button turns rust, the bag withdraws and a tick draws next to “Added, 30 ml”; after a moment it is back as it was.

How it works

The size decides everything

Each size carries its millilitres and its price in two attributes. On choosing it, a function works out the price, the price per millilitre, how big the bottle must be and whether it is the one that pays off.

The photo on the tile

The photo has a white ground: with mix-blend-mode multiply on the cream tile the white disappears and only the bottle stays, as if it had been shot there.

The growing bottle

The photo’s wrapper scales between SMALL and 1 with its origin low, at the bottle’s base, and a spring GROW seconds long: it grows from the ground, not from the centre.

The price

A number taken to the new value by a tween and written rounded on every frame; the price per millilitre rolls in a one-line window.

The sizes are a radiogroup

Three buttons with the keyboard arrows; the pill moves in percent, with no measuring.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#b5622aThe colour of the Best value tag and of the button after adding.
SMALLscript.js0.82How big the bottle is with the smallest size, compared with the largest.
GROWscript.js0.9How long the bottle takes to grow or shrink on a size change.
COUNTscript.js0.5How long the counting price lasts.
SPRINGscript.js1How much the bottle and the size pill bounce: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer tries the three sizes and adds to the bag.

Try them in the Playground

When to use it

In the shop of a brand of skincare, perfume, supplements, tea or detergents: wherever the same product is sold in several sizes and it pays to show at once what it costs per millilitre or gram.

On phones

The same card, 312 pixels wide at most: the photo tile is 150 pixels tall or a third of the screen if it is short, the sizes stay in one row 32 pixels tall and the button 46.

With reduced motion

No springs and no counting prices: on choosing a size the bottle is already the right size, price, price per millilitre and tag change in one step; the button shows the tick with no hop. The demo does not move by itself.

Pitfalls

  • Brand, product and prices are made up; the photo is real and free (CC0). The bottle’s label in the photo is blank: we wrote nothing on it.
  • There is one photo for the three sizes: the growing bottle hints at the size, but a real shop is better off with a photo per size.
  • mix-blend-mode multiply works because the tile is pale: on a dark ground the bottle would vanish.
  • The chosen size is not told by the pill alone: the buttons are a radiogroup with aria-checked, and the button confirms by writing the size.
  • The blend sits on the wrapper GSAP scales, not on the image inside: an element with a transform isolates what it contains, and a photo blended only in there would keep its white rectangle.
  • The scale’s origin is low (88%): with the origin in the centre the bottle would also grow into the floor.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.6 KB; the libraries: GSAP 28 KB.

Testing

Tested on 24 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