Skip to content
animorio
IT
Back to the library

House plant card

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.7 KBGSAP 28 KBFreeDownload the zip

The card of a house plant in a plant-care app: an arc shows the soil moisture, which drops a little at a time; with it change the state word, the colour and the leaf, which droops as the soil dries. Pressing “Water now” three drops fall, the arc climbs back, the leaf lifts with a small swing and the line below says in how many days to water again.

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>
<!--
  "House plant 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>House plant card with the soil moisture that drops and the watering that brings it back up</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 card of a house plant in a plant-care app: the soil moisture drops a little at a time and the leaf
         droops with it; watering, three drops fall, the arc springs back up and the leaf lifts again -->
    <section class="pl" data-pl aria-label="Plant care">
      <header class="pl__head">
        <span class="pl__leaf" aria-hidden="true"><svg viewBox="0 0 40 40"><g data-leaf><path class="leaf__stem" d="M20 37V20"></path><path class="leaf__blade" d="M20 22C9 21 6 12 8 4c9 0 15 5 12 18Z"></path><path class="leaf__blade leaf__blade--b" d="M20 26c9 0 13-6 13-13-8 0-14 4-13 13Z"></path><path class="leaf__vein" d="M19.400 20.500C16 16 13 11 10 7M21 24.500c3-3 6-6 9-9"></path></g></svg></span>
        <div class="pl__title"><span>Living room</span><h1>Monstera</h1></div>
        <p class="pl__state roll"><span data-state>Happy</span></p>
      </header>

      <div class="gauge">
        <svg viewBox="0 0 160 118" aria-hidden="true">
          <path class="gauge__trk" d="M39 115A58 58 0 1 1 121 115"></path>
          <path class="gauge__arc" data-arc pathLength="1" d="M39 115A58 58 0 1 1 121 115"></path>
          <g class="drops" data-drops><path d="M70 -4c-3 5-4.500 7-4.500 9.500a4.500 4.500 0 0 0 9 0C74.500 3 73 1 70 -4Z"></path><path d="M82 -10c-3 5-4.500 7-4.500 9.500a4.500 4.500 0 0 0 9 0C86.500 -3 85 -5 82 -10Z"></path><path d="M93 -3c-3 5-4.500 7-4.500 9.500a4.500 4.500 0 0 0 9 0C97.500 4 96 2 93 -3Z"></path></g>
        </svg>
        <p class="gauge__n"><strong><span data-pct>44</span><small>%</small></strong><span>soil moisture</span></p>
      </div>

      <p class="pl__next roll"><span data-next>Water in about 2 days</span></p>
      <button class="water" type="button" data-water><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.600c-2.600 3.600-4 5.600-4 7.800a4 4 0 0 0 8 0c0-2.200-1.400-4.200-4-7.800Z"></path></svg><span class="roll"><span data-word>Water now</span></span></button>
    </section>
    <p class="sr" data-live aria-live="polite"></p>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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

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 “House plant 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 a light sage background, a white card: at the top a drawn leaf in a box, the room and the plant’s name, and on the right a tag with the state (“Happy”). In the middle an arc three quarters of a turn wide with the soil moisture percentage inside; below, a line saying in how many days to water and the blue “Water now” button. The moisture drops slowly and the arc shortens with it: under 35% the tag rolls to “Thirsty”, arc and glow turn amber and the leaf starts to droop; under 20% it is “Dry”, in red. Pressing the button three drops fall from above into the arc, the moisture climbs back to 92% while counting, the colours turn green again, the leaf lifts slightly past upright and settles, and the line below updates.

How it works

One value, everything else

The moisture is a number from 0 to 100 that a linear tween takes towards zero. At each step one function derives the arc’s length (stroke-dashoffset on a path with pathLength 1), the figure, the state word, the colour (a CSS variable switched by a class), the days to the next watering and the leaf’s angle.

The leaf

The leaf is an SVG group with its origin at the base of the stem (svgOrigin): under the thirst threshold it rotates almost one degree per point lost, up to 26. On watering it goes to minus 9 and back to zero with elastic.out.

The watering

Three drops (teardrop paths) fall staggered by 0.12 seconds with power2.in and vanish while widening; half a second later the moisture climbs with power3.out, no spring, while the card and the button make a small bounce. When done, the drying starts again.

Values to change

NameFileDefaultWhat it changes
STARTscript.js44The soil moisture at the start, in percent.
DRYINGscript.js2.4How many points it loses per second (in the demo time runs fast).
FULLscript.js92What it goes back to after a watering.
THIRSTYscript.js35Under this threshold the plant is thirsty.
DRYscript.js20Under this one it is dry.
DAYscript.js11How many points it loses in a real day: used to say in how many days to water.
ACCENTscript.js#1f9d6bThe colour of the healthy plant.
LOOPscript.jstrueLeft alone, a pointer waters when it is thirsty and then a week goes by.

Try them in the Playground

When to use it

For an app that reminds you when to water, a pot sensor, the site of a nursery or a plant shop that also sells care. In a real product the moisture comes from the sensor or is estimated from the last watering, and DRYING is tiny.

On phones

The same card, at most as wide as the screen minus the margins, with arc, number and button measured on the height too; you water with a tap.

With reduced motion

No falling drops, drooping leaf or bounces: the moisture still drops (it is the information), and on watering arc, number and state go to the new value at once.

Pitfalls

  • The arc’s length is written straight into the style, not with gsap.set: GSAP rounds pixel values to whole numbers, and with pathLength 1 an arc at 44% would become full or empty.
  • The state is not just a colour: there is the word (“Happy”, “Thirsty”, “Dry”) and a line for screen readers when it changes.
  • While watering the leaf does not follow the moisture: two movements on the same group would step on each other, so the function that droops it waits for the end.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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