
Melting words
Text, Scroll, SVG
Scroll inside the preview
A scroll animation for the page of a holiday flat to rent, Casa Lanterna in Lisbon: on a sheet of drafting paper the floor plan draws itself like by hand, one room at a time, with the thick walls traced by a pencil that follows the tip, then the windows, the doors with their swing and the furniture in thin lines. When a room is closed a warm tone spreads from its door and beside it, in a card, the real photo of that room opens with its name and its square metres rolling up. At the end the dimensions, the 86 m² total and the ‘Check availability’ button that lights up.
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>
<!--
"Floor plan scroll" 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>Casa Lanterna, Lisbon: the floor plan</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- the floor plan section of a made-up holiday flat, Casa Lanterna in Lisbon. A sticky stage with the plan on a
sheet of paper: as you scroll it draws itself like by hand, one room at a time (the walls, then the doors with
their swing and the windows, then the furniture in thin lines). When a room is closed it fills with a warm tone
and the card beside it shows a real photo of that room, with its name and its square metres rolling up. At the
end the total and the button to check the dates -->
<section class="corsa" data-corsa>
<div class="palco" data-palco>
<header class="testa">
<span class="marchio">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 1.8v2.4M7.2 4.2h5.6l1.2 2.2v8.2l-1.2 2.2H7.2L6 14.6V6.4l1.2-2.2Z"/><path class="fiamma" d="M10 8.2c.9 1 1.5 1.8 1.5 2.7a1.5 1.5 0 0 1-3 0c0-.9.6-1.7 1.5-2.7Z"/></svg>
Casa Lanterna
</span>
<span class="testa-destra"><span class="lungo">Alfama, Lisbon</span> <i class="lungo"></i> <span>2 bedrooms</span> <i></i> <span><b>86</b> m²</span></span>
</header>
<div class="scena">
<!-- the sheet with the plan -->
<figure class="foglio" data-foglio>
<div class="foglio-dentro">
<svg class="pianta" data-pianta viewBox="-6 0 616 414" role="img" aria-label="Floor plan of Casa Lanterna: living room, kitchen, two bedrooms, bathroom and terrace">
<defs>
<pattern id="tratteggio" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<path d="M0 0v6" class="tratto"/>
</pattern>
</defs>
<g data-guide class="guide"></g>
<g data-riempimenti></g>
<g data-arredi class="arredi"></g>
<g data-aperture class="aperture"></g>
<g data-muri class="muri"></g>
<g data-etichette class="etichette"></g>
<g data-matita class="matita" aria-hidden="true">
<path class="matita-legno" d="M0 0 L5 -13 L-5 -13 Z"/>
<path class="matita-punta" d="M0 0 L1.7 -4.4 L-1.7 -4.4 Z"/>
<path class="matita-corpo" d="M-5 -13 h10 v-30 h-10 Z"/>
<path class="matita-riga" d="M-1.6 -13 v-30"/>
</g>
</svg>
</div>
<figcaption class="cartiglio">
<span>Floor plan, third floor</span>
<span class="cartiglio-destra"><span data-totale>0</span> <span class="di">of 86 m²</span></span>
</figcaption>
<span class="barra" aria-hidden="true"><b data-barra></b></span>
</figure>
<!-- the card with the photo of the room -->
<article class="carta" data-carta>
<div class="foto" data-foto>
<div class="foto-vuota" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M3.5 6.5h17v11h-17z"/><path d="m3.5 15 5-4.5 4 3.5 2.5-2 5.5 4.5"/><circle cx="15.5" cy="9.5" r="1.4"/></svg>
</div>
</div>
<div class="carta-testo">
<div class="piccolo" data-piccoli></div>
<div class="nomi" data-nomi></div>
<div class="riga-mq">
<span class="mq"><span data-mq>0</span><small> m²</small></span>
<span class="nota" data-nota></span>
</div>
<div class="fine" data-fine>
<span class="fine-totale"><b>86 m²</b> from €148 a night</span>
<a class="pillola" href="#" data-pulsante>
<span class="pillola-fondo" aria-hidden="true"></span>
<span class="pillola-testo">Check availability</span>
<svg class="pillola-freccia" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9M8.5 4.5 12 8l-3.5 3.5"/></svg>
</a>
</div>
</div>
</article>
</div>
</div>
</section>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/ScrollTrigger.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
27 values to change
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 “Floor plan scroll” from Animorio and fit it into my siteEach room is an object with its name, square metres, photo and its lines in plan units (the sheet is 616 by 414): walls as segments [x1, y1, x2, y2, outer?] with the gaps for doors and windows already left, openings built by three functions (the door from its hinge, closed end and open end, with the arc worked out from the cross product; the window with its two faces and the glass; the double railing) and furniture as SVG paths made by small helpers (rectangle, circle, ellipse, rounded rectangle).
Each path measures its length with getTotalLength() and gets stroke-dasharray ‘length length+1’ and stroke-dashoffset equal to the length, as attributes. GSAP takes the attribute to 0 (attr: { 'stroke-dashoffset': 0 }). Walls go at a steady speed (DRAW_SPEED units per second, ease none), one after the other; doors, windows and furniture quicker with sine.inOut.
Every stroke drawn is logged in a list with its start, end and curve. On every timeline update the active stroke is found, its curve is applied to the elapsed time and getPointAtLength() gives the point where the pencil goes, turned 22 degrees plus a slow sway. Between strokes the pencil fades out with quickTo.
Each room's fill is a rectangle inside a clipPath with a circle centred on the door: GSAP grows the r attribute from 0 to the distance of the farthest corner. The terrace also has a 45 degree hatch pattern. Each new room lowers the one before to 55 %, at the end they all go back to 80 %.
The photos sit one on top of the other: the new one opens with clip-path from inset(100% 0 0 0) to inset(0) and comes down from 1.14 to 1, the old one shrinks to 0.96. Name, type and note are stacks of lines that slide up with back.out. Square metres and total are two properties of an object the timeline moves; the timeline's onUpdate writes them rounded.
The timeline is paused and ScrollTrigger moves it back and forth (scrub 0.4) while the 100lvh stage stays pinned; the section's height comes from the timeline's length. Lenis smooths the wheel. Thin lines stay one pixel at every width: the script writes into --px how many plan units make a pixel and the CSS multiplies the stroke width.
| Name | File | Default | What it changes |
|---|---|---|---|
DRAW_SPEED | script.js | 520 | How fast the pencil draws the walls, in plan units per second of the timeline. |
RIDE | script.js | 1 | How much scroll the plan takes: 2 is twice as long. |
SMOOTH | script.js | 1 | Seconds the smooth scroll takes to catch up with the wheel. |
ROOM_TONE | script.js | 1 | How strong the warm tone of a finished room is (0 none). |
PHOTO_ZOOM | script.js | 1.14 | How zoomed in each photo is when it arrives. |
PENCIL | script.js | 1 | 1 shows the pencil that follows the line, 0 hides it. |
PRICE | script.js | 148 | The price a night next to the button, in euros. |
For the page of a holiday home, a flat to rent, an estate agency or an architecture studio: when you want to show how the home is laid out room by room, tying each room of the plan to its photo, and lead whoever scrolls down to the booking button.
The same animation with adapted sizes: the sheet goes on top, as wide as the screen and sized on its height too, the card goes underneath sideways, with the photo on the left and the name, square metres and button on the right; on the plan only the square metres stay, and the thin lines stay one pixel. You scroll with your finger.
The floor plan is already fully drawn, with the rooms coloured, the dimensions and the button lit; as you scroll the card moves from one room to the next with a fade only, no pencil and no movement.
GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 14 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.
Tested on 5 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.