Skip to content
animorio
IT
All components

Make an offer button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.3 KBGSAP 28 KBFreeDownload the zip

The “Make an offer” button of a second-hand marketplace, doing the whole negotiation by itself: it opens into the price to propose, with plus and minus keys, ready-made discounts and the bar saying how likely the offer is to be accepted; then it closes while the offer leaves, comes back with the seller’s counter-offer and, once accepted, becomes the deal with its price.

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>
<!--
  "Make an offer button" 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>Make an offer button</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 Make an offer button of a second-hand marketplace: it opens into the price to propose,
         the offer leaves, the seller's counter-offer comes back and the deal is closed -->
    <i class="frame" data-frame aria-hidden="true"></i>
    <div class="of" data-of data-state="idle">
      <button class="of__face of__idle" type="button" data-face="idle" data-open>
        <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10.800 2.500H16a1.500 1.500 0 0 1 1.500 1.500v5.200a1.500 1.500 0 0 1-.440 1.060l-6.500 6.500a1.500 1.500 0 0 1-2.120 0l-5.200-5.200a1.500 1.500 0 0 1 0-2.120l6.500-6.500a1.500 1.500 0 0 1 1.060-.440Z"></path><circle cx="13.500" cy="6.500" r="1.200"></circle></svg>
        <span>Make an offer</span>
      </button>

      <div class="of__face of__panel" data-face="panel" role="group" aria-label="Your offer">
        <div class="of__row"><span class="of__label">Your offer</span><button class="of__close" type="button" data-close aria-label="Close"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="m2.500 2.500 7 7m0-7-7 7"></path></svg></button></div>
        <div class="of__amount">
          <button class="of__step" type="button" data-step="-1" aria-label="Lower the offer"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.500 6h7"></path></svg></button>
          <span class="of__price"><i>$</i><span class="of__digits"><b data-outoffer>200</b></span></span>
          <button class="of__step" type="button" data-step="1" aria-label="Raise the offer"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.500 6h7M6 2.500v7"></path></svg></button>
        </div>
        <p class="of__listed">Listed at <b>$200</b></p>
        <div class="of__chips" role="group" aria-label="Quick offers">
          <button type="button" data-pct="5" aria-pressed="false">5% off</button>
          <button type="button" data-pct="10" aria-pressed="false">10% off</button>
          <button type="button" data-pct="15" aria-pressed="false">15% off</button>
        </div>
        <div class="of__meter"><span class="of__track"><i data-fill></i></span><span class="of__chance"><span data-outchance>Very likely to be accepted</span></span></div>
        <button class="of__send" type="button" data-send><span>Send offer</span></button>
      </div>

      <div class="of__face of__sent" data-face="sent" aria-hidden="true">
        <svg viewBox="0 0 20 20" aria-hidden="true"><path class="of__plane" d="M17.500 2.500 8.800 11.200M17.500 2.500l-5.300 15-3.400-6.300-6.300-3.400Z"></path><path class="of__check" pathLength="1" d="m4.500 10.500 3.600 3.600 7.400-8.200"></path></svg>
        <span class="of__senttext"><span data-outsent>Sending offer</span></span>
        <i class="of__wire" data-wire></i>
      </div>

      <div class="of__face of__counter" data-face="counter" role="group" aria-label="Counter-offer">
        <span class="of__who"><span class="of__label">Seller countered</span><strong><span>$<b data-outcounter>190</b></span><s>$<b data-outmine>175</b></s></strong></span>
        <button class="of__no" type="button" data-decline aria-label="Decline"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="m2.500 2.500 7 7m0-7-7 7"></path></svg></button>
        <button class="of__yes" type="button" data-accept>Accept</button>
      </div>

      <button class="of__face of__deal" type="button" data-face="deal" data-reset>
        <svg viewBox="0 0 20 20" aria-hidden="true"><path class="of__check" pathLength="1" d="m4.500 10.500 3.600 3.600 7.400-8.200"></path></svg>
        <span>Deal at $<b data-outdeal>190</b></span>
      </button>
    </div>
    <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.

31 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 “Make an offer button” 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 dark pill with a price tag and the words “Make an offer”. On tap the pill widens on a spring into a light card, and what is inside arrives one piece after the other: “Your offer”, the big price between the minus and plus keys, “Listed at $200”, three ready-made discounts (5, 10 and 15 per cent), the coral bar with the line saying how likely it is to be accepted and the “Send offer” button. On every change the price rolls up or down, the chosen discount turns dark, the bar shortens or lengthens on a bounce and fades when the offer is low, and the line goes from “Very likely to be accepted” to “Could go either way” down to “Unlikely”. With “Send offer” the card closes into a dark pill: a coral line runs along the bottom, the paper plane flies off, the words roll from “Sending offer” to “Offer sent” and the tick draws itself. After a moment the pill opens light again with the answer: “Seller countered”, the figure climbing from your offer to theirs, yours struck through beside it, a cross to decline and “Accept”. On accepting, the pill turns coral: “Deal at $190”, with the tick drawing itself; one more tap starts over. Close to the listed price the seller accepts at once, with no counter-offer.

How it works

One shell, five faces

The button is a single shell with five faces laid on top of each other: button, offer, sending, counter-offer, deal. On every step the shell takes the width, height and colour of the new face on a spring, the old one goes out and the new one comes on.

The price and the likelihood

The offer moves in fixed steps between half the price and the full price. The likelihood is a single number, worked out from the discount: it lengthens the bar, fades it and picks the line of text.

The answer

After sending, a GSAP delay brings the answer: within five per cent of the price it is a yes, otherwise a counter-offer halfway, with the figure counting from yours to theirs.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#f0563aThe colour of sending, of the bar and of the deal.
PRICEscript.js200The listed price, in dollars.
STEPscript.js5How much the offer changes on every tap of plus and minus.
SPRINGscript.js1How much the button bounces as it changes shape.
REPLYscript.js1.4How many seconds the seller’s answer takes.

Try them in the Playground

When to use it

On a listing page in a second-hand marketplace, for pre-owned clothing, cars, musical instruments or furniture; in any shop where the price can be negotiated. The same shell carries a price proposal for a quote or a rental.

On phones

Open, the card is at most 284 pixels wide and about 250 tall, and narrows with the screen. The plus and minus keys are 38 pixel circles, the discounts 30 tall and “Send offer” 42 tall and as wide as the card: everything is thumb-sized and nothing depends on hover.

With reduced motion

The button changes size at once and the faces cross-fade; the price and the words change without rolling, the bar takes its length immediately, the tick is already drawn and the counter-offer figure is already its own. The demo’s pointer does not start.

Pitfalls

  • The faces are centred by CSS and GSAP only touches their opacity: the children are the ones that move, so the two transforms never cancel each other.
  • The likelihood is not told by the bar and the colour alone: the line of text sits next to it, and every change is announced in an aria-live region.
  • The shell’s size is taken in pixels from the new face: when the window changes width it is measured again.
  • Price, likelihood and the seller’s answer are invented and worked out in the script: in a real product they come from the server, and the wait has no fixed length.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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