Skip to content
animorio
IT
Back to the library

Blend modes

Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

The blend modes of a design app, in a card on warm white, minimal style: an orange circle and a blue square overlapping, and six modes to choose from. At every change the square pulls away, takes the new mode and comes back on a spring, and where the two shapes cross the colour truly changes. At the top the colour of the crossing, worked out and written in hex; below, a line saying in words what that mode does. Pointing at a mode tries it on without choosing it.

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>
<!--
  "Blend modes" 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>Blend modes</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 blend modes of a design app: two flat shapes overlapping, six modes to choose, the top shape pulling
         away and coming back at every change, and the colour where they cross worked out and written -->
    <section class="bm" data-bm aria-label="Blend modes">
      <header class="bm__head">
        <strong>Blend mode</strong>
        <span class="bm__result"><i class="bm__chip" data-outchip aria-hidden="true"></i><span data-outhex>#3B6CFF</span></span>
      </header>
      <div class="bm__view" aria-hidden="true">
        <i class="bm__floor"></i>
        <div class="bm__pair">
          <div class="bm__under" data-under><i></i></div>
          <div class="bm__over" data-over><i data-ink></i></div>
        </div>
      </div>
      <div class="bm__modes" role="radiogroup" aria-label="Blend mode" data-modes>
        <i class="bm__thumb" data-thumb aria-hidden="true"></i>
        <button type="button" role="radio" aria-checked="true" data-mode="normal">Normal</button>
        <button type="button" role="radio" aria-checked="false" data-mode="multiply">Multiply</button>
        <button type="button" role="radio" aria-checked="false" data-mode="screen">Screen</button>
        <button type="button" role="radio" aria-checked="false" data-mode="overlay">Overlay</button>
        <button type="button" role="radio" aria-checked="false" data-mode="darken">Darken</button>
        <button type="button" role="radio" aria-checked="false" data-mode="difference">Difference</button>
      </div>
      <p class="bm__note"><span class="bm__clip"><span data-outnote>The top shape simply covers the one below.</span></span></p>
    </section>
    <span class="live" aria-live="polite" data-live></span>

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

18 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 “Blend modes” 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 warm white, a white rounded card: “Blend mode” and on the right a pill with the colour swatch and its code. Below, a light floor with an orange circle on the left and a blue round-cornered square on the right, overlapping by a third; under them a soft shadow. Then six choices on two rows, “Normal”, “Multiply”, “Screen”, “Overlay”, “Darken” and “Difference”, with the white thumb on the choice; at the bottom a line: “The top shape simply covers the one below.”. Tapping “Multiply” the square pulls away to the right turning slightly, changes mode while it is clear and comes back onto the circle with a bounce; the circle gives a little as it lands. Where they cross there is now a dark blue; the swatch at the top and the code run to the new value, the thumb slides onto the choice and the line says “Multiplies the two: always darker, like inks.”. “Screen” lightens, “Overlay” adds contrast, “Difference” subtracts. Pointing at a mode, the crossing, the swatch and the line show it at once, and go back to the choice when you leave.

How it works

A context of its own

The two shapes sit in a container with isolation: isolate: the top shape blends only with the one below, not with the floor or the card.

Changing from afar

The square pulls away, and the new mode is given to it while it is not touching the circle: the colour never snaps in view.

The same formula

Every mode has its formula for one channel: the script applies it to the two colours and writes the result, the same one the browser draws.

Trying on

Pointing at a mode applies it without moving anything and without changing the choice; on leaving, the chosen one comes back.

Values to change

NameFileDefaultWhat it changes
UNDERscript.js#ff6a3dThe colour of the shape below, the circle.
OVERscript.js#3b6cffThe colour of the shape on top, the square.
APARTscript.js30How many pixels the top shape pulls away at every change.
SPRINGscript.js1How much the shape bounces on coming back.
LOOPscript.jstrueLeft alone, the demo’s pointer tries the modes one after the other.

Try them in the Playground

When to use it

In the layers panel of a design app or an image editor, and on the page of a course or documentation explaining blend modes. The two shapes pulling apart and coming back together also carry a comparison between two filters or two colour themes.

On phones

The card is at most 348 pixels wide and about 320 tall; the floor gets shorter on short screens and the shapes keep their size. The six choices sit on two rows of three, 32 pixels tall; with a finger a tap chooses, and there is no try-on by pointing.

With reduced motion

No shapes pulling apart and no bounces: the mode changes in place, the thumb and the texts change in one step. The demo’s pointer does not start.

Pitfalls

  • Without isolation: isolate the top shape blends with the background too: with Multiply on a grey floor all of it would change colour, not just the crossing.
  • The shapes are flat colours on purpose: with a gradient the crossing would not be one colour and the written code would lie.
  • The shadow is a separate element under the shapes: a shadow put on the blending shape would be blended as well.
  • The modes are a radio group: the arrow keys move across the two rows, and every choice is announced to screen reader users, with the colour that results.
  • The code is worked out in sRGB on 8-bit values: it is what the browser draws, not what a program blending in another colour space would give.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 1 December 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 animations