Skip to content
animorio
IT
Back to the library

Hotel laundry bag

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

The laundry request from a hotel room: three rows of garments (shirts, trousers, dresses) with their plus and minus. Each garment added leaves the row as a token and drops into the bag drawn at the top, which fills up and takes the weight; the total rolls, and past five garments the return moves from today at 6 pm to tomorrow morning. The button asks for the pickup.

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>
<!--
  "Hotel laundry bag" 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>Hotel laundry with the garments to count, the bag that fills up and the return time</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 laundry request of a hotel room: each garment added drops into the bag, which fills up;
         the total rolls and the return time moves to the next morning when the bag is too full for today -->
    <section class="ld" data-ld aria-label="Laundry service">
      <header class="ld__head">
        <span class="bag" aria-hidden="true"><svg viewBox="0 0 48 56" data-bag>
          <defs><clipPath id="bag-in"><path d="M11 17c-5 6-8 14-8 22 0 9 6 14 21 14s21-5 21-14c0-8-3-16-8-22Z"></path></clipPath></defs>
          <path class="bag__body" d="M11 17c-5 6-8 14-8 22 0 9 6 14 21 14s21-5 21-14c0-8-3-16-8-22Z"></path>
          <g clip-path="url(#bag-in)"><rect class="bag__fill" data-fill x="0" y="17" width="48" height="38"></rect><path class="bag__fold" d="M9 30c6 3 10-2 15 0s9 3 15 0"></path></g>
          <path class="bag__neck" d="M15 6c2 4 2 8-2 11h22c-4-3-4-7-2-11-3 2-6-1-9 1-3-2-6 1-9-1Z"></path>
          <path class="bag__tie" d="M12 17h24"></path>
        </svg></span>
        <div class="ld__title"><span>Room 214</span><h1>Laundry</h1></div>
        <p class="ld__count roll"><span data-count>0 items</span></p>
      </header>

      <ul class="rows" data-rows></ul>

      <footer class="ld__foot">
        <div class="ld__back"><span>Back in your room</span><p class="roll"><strong data-back>Today, 6:00 pm</strong></p></div>
        <p class="ld__total roll"><strong data-total>€0</strong></p>
      </footer>
      <button class="send" type="button" data-send><span class="roll"><span data-word>Request pickup</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.

28 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 “Hotel laundry bag” 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 lilac background, a white card: at the top a drawn laundry bag, “Room 214”, “Laundry” and a tag with the number of garments. Below, three grey rows: Shirts, Trousers, Dresses, each with how it is treated, the price each and a pill stepper with minus, the figure and plus. At the bottom the “Back in your room” line with the time, the big total and the purple “Request pickup” button, dimmed while the bag is empty. Pressing a plus, the row’s figure rolls, a small purple token leaves the button, makes an arc and drops into the bag: the bag squashes and springs back, its fill rises, the tag and the total roll. At the sixth garment the return time rolls from “Today, 6:00 pm” to “Tomorrow, 9:00 am” and turns rust. Asking for the pickup the bag lifts and tilts, and the button says “Pickup on its way”.

How it works

The quantities, and what follows

A list of quantities, one per garment. From there one function derives the number of garments, the total, the return time (today up to SAME_DAY garments, then tomorrow), the buttons to disable and the bag’s level.

The bag

The bag is an SVG path; the fill is a rectangle behind a clipPath of the same shape, and only its top edge (the y attribute) moves, with elastic.out. When a garment lands the bag squashes to scaleY 0.92 with the origin at the bottom and goes back to 1.

The token

A small square created on the fly leaves the plus that was pressed: x goes to the bag with power1.inOut in half a second, y first rises then falls with two tweens, so the path is an arc. Tag and total update when it lands, 0.42 seconds after the click.

Values to change

NameFileDefaultWhat it changes
GARMENTSscript.js[["Shirts", "washed and pressed", 6], ["Trousers", "pressed", 8], ["Dresses", "dry cleaned", 14]]The garments: name, how they are treated, price each.
BAGscript.js10How many garments fit in the bag.
SAME_DAYscript.js5Up to how many garments come back the same day.
TODAYscript.js"Today, 6:00 pm"The same-day return.
TOMORROWscript.js"Tomorrow, 9:00 am"The return when there are more.
CURRENCYscript.js"€"The currency symbol.
ACCENTscript.js#5b4be0The colour of the service.
LOOPscript.jstrueLeft alone, a pointer fills the bag and asks for the pickup, then starts again.

Try them in the Playground

When to use it

For the app or in-room page of a hotel, a residence or a serviced holiday home: laundry, pressing, but also the minibar or extra towels. It works the same for a laundry that collects at home.

On phones

The same card, at most as wide as the screen minus the margins, with rows and button measured on the height too; plus and minus are 30 pixels wide inside a pill, comfortable for a finger.

With reduced motion

No flying token, squashing bag or rolling figures: quantities, the bag’s level, the total and the time change at once.

Pitfalls

  • The bag’s level is the y attribute of an SVG rectangle: it must be animated with attr, and GSAP must not round it to the pixel or it rises in steps.
  • Minus at zero and the pluses with a full bag are really disabled, not just faded: the keyboard skips them.
  • The pickup button with an empty bag stays pressable but shakes its head: with aria-disabled you understand why, with disabled it would vanish from the tab order.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.2 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