Skip to content
animorio
IT
Back to the library

Sync conflict

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

A note changed on two devices: the two versions fan out, with the differing lines highlighted. The one under the pointer lifts and straightens; once picked it takes the border and the tick, and the button brings it to the centre while the other slips behind it. “Keep both” stacks the two, and the notice at the top becomes “All synced”.

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>
<!--
  "Sync conflict" 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>Sync conflict</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 note edited on two devices: the two versions fan out with the changed lines marked,
         picking one brings it forward while the other slips behind, Keep both stacks them -->
    <section class="sc" data-sc aria-labelledby="sc-title">
      <header class="sc__head">
        <span class="sc__badge" aria-hidden="true">
          <svg class="sc__warn" data-warn viewBox="0 0 20 20"><path d="M4.200 8.300a6 6 0 0 1 10.600-2.100M15.800 11.700a6 6 0 0 1-10.600 2.100"></path><path d="M15 3.200v3.200h-3.200M5 16.800v-3.200h3.200"></path></svg>
          <svg class="sc__ok" viewBox="0 0 20 20"><path data-ok pathLength="1" d="M5 10.400l3.300 3.300 6.700-7.200"></path></svg>
        </span>
        <div class="sc__titles">
          <h1 class="sc__title" id="sc-title"><span data-title>Sync conflict</span></h1>
          <p class="sc__sub"><span data-sub>Trip checklist changed on two devices</span></p>
        </div>
      </header>

      <div class="sc__deck" data-deck role="radiogroup" aria-label="Version to keep">
        <div class="sc__slot" data-card>
          <button class="sc__card" type="button" role="radio" aria-checked="false" data-pick>
            <span class="sc__dev"><svg viewBox="0 0 20 20" aria-hidden="true"><rect x="4" y="4.500" width="12" height="8.200" rx="1.400"></rect><path d="M2.500 15.500h15"></path></svg><b>This Mac</b><span class="sc__ring" aria-hidden="true"><svg viewBox="0 0 12 12"><path data-tick pathLength="1" d="M3 6.300l2 2 4-4.300"></path></svg></span></span>
            <span class="sc__when">Edited 9:41</span>
            <span class="sc__lines"><span>Passports</span><span><mark>Taxi at 6:40</mark></span><span>Camera charger</span></span>
          </button>
        </div>
        <div class="sc__slot" data-card>
          <button class="sc__card" type="button" role="radio" aria-checked="false" data-pick>
            <span class="sc__dev"><svg viewBox="0 0 20 20" aria-hidden="true"><rect x="6" y="2.800" width="8" height="14.400" rx="2"></rect><path d="M9 14.800h2"></path></svg><b>iPhone</b><span class="sc__ring" aria-hidden="true"><svg viewBox="0 0 12 12"><path data-tick pathLength="1" d="M3 6.300l2 2 4-4.300"></path></svg></span></span>
            <span class="sc__when">Edited 9:44</span>
            <span class="sc__lines"><span>Passports</span><span><mark>Taxi at 7:15</mark></span><span>Camera charger</span><span><mark>Water plants</mark></span></span>
          </button>
        </div>
      </div>

      <div class="sc__keys">
        <button class="sc__btn" type="button" data-keep disabled><span class="sc__btntext"><span data-keeplabel>Pick a version</span></span></button>
        <button class="sc__link" type="button" data-both>Keep both</button>
      </div>
      <span class="sc__say" data-say aria-live="polite"></span>
    </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.

28 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 “Sync conflict” 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 near black, a dark panel: at the top an amber tile with the two sync arrows, “Sync conflict” and “Trip checklist changed on two devices”. Below, two slightly tilted cards: “This Mac, Edited 9:41” and “iPhone, Edited 9:44”, with the lines of the same note; the differing ones (“Taxi at 6:40” and “Taxi at 7:15”, plus “Water plants” on the phone only) have an amber ground. Further down, the dimmed “Pick a version” button and “Keep both”. Move over a card and it lifts, straightens, and the other one steps back a little. On click it takes the teal border, the disc at the top fills with the tick and the button lights up as “Keep iPhone version”. Press it and the chosen card goes to the centre and grows, the other slips behind it and vanishes, the two arrows spin and leave a green tick, the lines lose their colour and “All synced” appears at the top. “Keep both” instead straightens the two cards and stacks one on the other. After a moment, in the demo, the conflict comes back.

How it works

One pose per state

A single function says where each card sits (x, y, rotation, scale, opacity) from the state, the picked card and the card under the pointer; every change calls it again.

Hover and pick

Hovering lifts and straightens the card; the click gives it the bordered class, draws the tick in the disc and lights the button with the device’s name.

Keeping one version

The shift towards the centre is computed from the deck’s width: the chosen card goes there and grows, the other goes there shrunk and at zero opacity.

The end

The two arrows turn half a round and fade, the tick draws itself with the dashoffset and the highlighted lines lose their ground with a transition.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#3fd6c2The colour of the picked version, of the button and of the final tick.
WARNscript.js#f5b440The colour of the notice and of the differing lines.
TILTscript.js3By how many degrees the two fanned versions are tilted.
LIFTscript.js6By how many pixels the version under the pointer lifts.
SPRINGscript.js1How much the cards and the buttons bounce: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer looks at the two versions, keeps one, then keeps both.

Try them in the Playground

When to use it

In apps that sync across several devices or people: notes, documents, sheets, cloud files, contacts, settings. It appears when the same thing was changed in two places and someone has to choose.

On phones

The same panel, 312 pixels wide at most: the two cards sit side by side, half a deck wide, and are picked with the finger; the hover that lifts them only exists where there is a pointer.

With reduced motion

The cards stay where they are: the pick lights the border and the tick, keeping one dims the other, and the words and the tick at the top change at once. The demo does not move by itself.

Pitfalls

  • The notes and times are made up and nothing syncs: in a real app the differences are computed line by line and “All synced” comes after the server’s answer.
  • The two cards are a radiogroup: the arrow keys move from one to the other and pick it, as with radio buttons.
  • GSAP moves the card’s wrapper, CSS draws the button inside: that way the border and the shadow do not fight the transform.
  • The centre position is in pixels: on resize the poses are recomputed at once, even halfway through a move.
  • The hover that lifts the cards is tied to (hover: hover): on a phone it does not stick after the touch.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 23 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 animations