Skip to content
animorio
IT
All components

Pet feeder button

Buttons, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.6 KBGSAP 28 KBFreeDownload the zip

The “Feed now” button of a cat’s smart feeder, in a card on white: pick the portion in grams with plus and minus, press, and the button fills with orange from the left while the kibble drops piece by piece from the spout into the bowl, which fills with a small bounce at every piece. At the end the check draws itself, “Fed 60 g”, the hopper goes down and the day’s count goes up; then the cat eats and the bowl empties in small bites.

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>
<!--
  "Pet feeder 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>Pet feeder 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 Feed now button of a smart pet feeder: pick the portion, the kibble drops into the bowl, the hopper
         goes down, and the bowl empties again while the cat eats -->
    <section class="pf" data-pf aria-label="Pet feeder">
      <header class="pf__head">
        <div class="pf__what"><strong>Biscuit’s feeder</strong><span class="pf__clip"><span data-outday>Fed 40 g of 120 g today</span></span></div>
        <span class="pf__hop"><span class="pf__tank" aria-hidden="true"><i data-tank></i></span>Hopper <b data-outhop>62%</b></span>
      </header>

      <div class="pf__pad">
        <svg class="pf__svg" viewBox="0 0 300 112" aria-hidden="true">
          <defs><clipPath id="pf-in"><path d="M99 56C101 84 118 95 150 95S199 84 201 56Z"></path></clipPath></defs>
          <path class="pf__spout" d="M136 0h28v9a5 5 0 0 1-5 5h-18a5 5 0 0 1-5-5Z"></path>
          <ellipse class="pf__shade" cx="150" cy="100" rx="58" ry="5"></ellipse>
          <g data-bowl>
            <path class="pf__bowl" d="M96 54C98 86 116 98 150 98S202 86 204 54Z"></path>
            <g clip-path="url(#pf-in)"><g data-heap>
              <rect class="pf__k" x="96" y="6" width="108" height="60"></rect>
              <ellipse class="pf__k" cx="106" cy="7" rx="7" ry="5"></ellipse><ellipse class="pf__k pf__k--b" cx="119" cy="5" rx="7" ry="5"></ellipse><ellipse class="pf__k" cx="132" cy="6" rx="7" ry="5.500"></ellipse><ellipse class="pf__k pf__k--b" cx="145" cy="3.500" rx="7.500" ry="5"></ellipse><ellipse class="pf__k" cx="158" cy="4" rx="7" ry="5.500"></ellipse><ellipse class="pf__k pf__k--b" cx="171" cy="6" rx="7" ry="5"></ellipse><ellipse class="pf__k" cx="184" cy="5" rx="7" ry="5"></ellipse><ellipse class="pf__k pf__k--b" cx="196" cy="7" rx="7" ry="5"></ellipse>
            </g></g>
            <path class="pf__rim" d="M90 54h120"></path>
          </g>
          <g data-rain></g>
        </svg>
      </div>

      <div class="pf__row">
        <span class="pf__label">Portion</span>
        <div class="pf__step">
          <button type="button" class="pf__pm" data-less aria-label="Smaller portion"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8"></path></svg></button>
          <span class="pf__val"><span class="pf__clip pf__clip--val"><span data-outportion>40 g</span></span></span>
          <button type="button" class="pf__pm" data-more aria-label="Larger portion"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 8h8M8 4v8"></path></svg></button>
        </div>
      </div>

      <button type="button" class="pf__btn" data-feed>
        <span class="pf__fill" data-fill></span>
        <span class="pf__in"><svg class="pf__tick" viewBox="0 0 16 16" aria-hidden="true"><path data-tick d="M3.500 8.300 6.700 11.400 12.600 5" pathLength="1"></path></svg><span class="pf__clip pf__clip--btn"><span data-outbtn>Feed now</span></span></span>
      </button>
    </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.

17 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 “Pet feeder 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 rounded card: at the top “Biscuit’s feeder”, “Fed 40 g of 120 g today” and on the right the pill “Hopper 62%” with a small tank filled in orange. Below, a pale panel: at the top the dark spout, at the bottom a white bowl with a thick rim, empty, with its shadow. Then the row “Portion” with minus, “40 g” and plus in a grey pill. At the bottom the dark button “Feed now”. Plus and minus change the portion by ten grams, with the number rolling. Pressing “Feed now” the button gives slightly, the label becomes “Dispensing” and an orange fill sweeps across it from the left; the kibble leaves the spout, one piece every tenth of a second, spinning as it falls: at every piece the heap in the bowl rises a little with a bounce and the bowl gives a start. When the portion is done the label rolls to “Fed 60 g” with the check drawing itself beside it, the hopper goes down to 56% and the count says “Fed 100 g of 120 g today”. Then the cat eats: the heap goes down in small bites until the bowl is empty, and the button is “Feed now” again.

How it works

Four numbers

The portion chosen, the grams in the bowl, those eaten today and those in the hopper: texts, tank and heap come from them.

The heap is one group

The kibble in the bowl is a rectangle with a row of ovals on top, clipped by the bowl’s shape: it rises and falls by moving the group.

Each piece brings its share

One piece every five grams: when it lands it adds its share to a target, and the heap reaches it on a spring. That way the bounces do not cancel one another.

The button tells the story

“Dispensing” with the fill advancing, then “Fed” with the check, then ready again: while it pours, the button and the two portion keys do not respond.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e2832cThe colour of the kibble, the tank and the button while it pours.
PORTIONscript.js40The portion chosen at the start, in grams (20 to 80, in steps of 10).
EATscript.js4How many seconds the cat takes to empty the bowl; 0 = the bowl stays full.
HOLDscript.js2How many seconds the button stays on “Fed” before it is ready again.
LOOPscript.jstrueLeft alone, the demo’s pointer picks the portion and feeds.

Try them in the Playground

When to use it

In a smart feeder, smart home or pet shop app, and on the page presenting the product; the same button with a quantity carries the dose of a soap dispenser, the coffee of a connected machine, the water of a sprinkler or the food of an aquarium.

On phones

The card is at most 340 pixels wide and about 330 tall. The drawing narrows with the card; the plus and minus keys are 34-pixel circles, the button is 46 tall and as wide as the card.

With reduced motion

No falling kibble or bounces: on press the bowl appears already full, the button is orange at once with “Fed” and the check, the numbers change in one step; after the pause the bowl is empty again. The demo’s pointer does not start.

Pitfalls

  • Several tweens on the same number starting a tenth of a second apart eat the grams: each reads the value mid-way. Keep a separate target that adds up, and let the tween chase it.
  • While it pours the button has `aria-busy` and the portion keys are disabled: a second tap must not pour twice.
  • The check sits beside the label and makes room by widening from zero: the check-plus-label group stays in the middle of the button in every state.
  • The check’s stroke is drawn with `stroke-dashoffset` between 0 and 1: with GSAP’s pixel rounding it would appear all at once.
  • Name, grams and percentages are invented: in a real app they come from the feeder.

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 2 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 components