
The cube stories
Stories, 3D, Transitions
NewFree
The publish panel of a blog, with the article as a square sheet of two-tone origami paper: every phase of the publishing is a group of real folds, each drawn first as the dashed line of an origami diagram, and the square becomes a kite, then a swan with a neck, a head and a tail. When the article is live the swan opens its wings, takes off with a few beats and lands. If the upload fails the flap that was folding falls open again and its line stays red until Retry folds it again.
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>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>The publishing origami</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/instrument-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the publish panel of a blog: the article is a square of two-tone origami paper. Every phase of the publishing
(build, optimize, upload, publish) is a group of folds, each one drawn first as a dashed line like in an
origami diagram; the square becomes a kite, then a long body, then a bird with a neck, a head and a tail.
When the article is live the bird opens its wings, takes off with a few beats and lands again.
The paper is painted by script.js on the canvas; the words, the phase bars and the button are HTML -->
<section class="pub" aria-labelledby="pub-title" data-publish>
<div class="pub__head">
<div class="pub__words">
<h2 class="pub__title" id="pub-title">Notes on Folding</h2>
<p class="pub__meta"><span class="pub__swap" data-meta>Draft · saved 2 min ago</span></p>
</div>
<p class="pub__figure" aria-hidden="true">
<span class="pub__pct" data-pct>1,240 words</span>
<span class="pub__live" data-live-badge>
<svg class="pub__tick" viewBox="0 0 24 24"><path d="M5.5 12.6l4.1 4.1L18.6 7.4" pathLength="1"/></svg>
<span>Live</span>
</span>
</p>
</div>
<div class="pub__paper" aria-hidden="true" data-paper>
<canvas class="pub__canvas" data-canvas></canvas>
</div>
<div class="pub__phases" role="progressbar" aria-labelledby="pub-title" aria-valuemin="0" aria-valuemax="100"
aria-valuenow="0" aria-valuetext="Not published yet" data-bar>
<div class="pub__phase" data-phase><span class="pub__name">Build</span><span class="pub__track"><span class="pub__fill"></span></span></div>
<div class="pub__phase" data-phase><span class="pub__name">Optimize</span><span class="pub__track"><span class="pub__fill"></span></span></div>
<div class="pub__phase" data-phase><span class="pub__name">Upload</span><span class="pub__track"><span class="pub__fill"></span></span></div>
<div class="pub__phase" data-phase><span class="pub__name">Publish</span><span class="pub__track"><span class="pub__fill"></span></span></div>
</div>
<div class="pub__foot">
<p class="pub__site"><span class="pub__swap" data-site>fieldnotes.blog/notes-on-folding</span></p>
<button class="pill" type="button" data-action data-autoclic><span class="pill__label" data-label>Publish</span></button>
</div>
<p class="sr" role="status" aria-live="polite" data-live></p>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.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.
38 values to change
With the Animorio connector, Claude Code takes it from here, guide included, and fits it into your project. Paste this request:
Take “The publishing origami” from Animorio and fit it into my siteThe sheet is a list of convex polygons, each with its outline in the paper’s own coordinates (the square from −0.5 to 0.5), the affine map that brings it to where it lies now and its height in the stack. At the start there is a single facet. So a facet always knows which part of the paper it is, and which of its sides are the sheet’s cut edge and which are creases.
A fold is a line (a point and a direction), the side that moves and the kind: valley, mountain or reverse. Every facet the line crosses is cut in two (a convex polygon clipped by a half plane), and the parts on the moving side are reflected: their map gets the mirror in the line, x′ = x − 2((x − p)·n)n. In a valley fold the flap ends on top of the stack with the order of its layers reversed, in a mountain fold at the bottom; in a reverse fold the point ends between the layers, as in a real neck. All the folds are worked out once at the start: for each one the paper cut before the fold and the paper after are kept.
During the fold every point of the flap, at a distance d from the line, lies at foot + n·d·cos θ and d·sin θ high, with θ from 0 to 180 degrees; its height in the stack meanwhile goes from the old one to the new one. Everything is projected in perspective after turning the scene: the sheet is seen a little from above, and while the flap stands up the camera leans a little, so that you see it lifted off the paper and not just shortened. The facets are painted from the lowest to the highest, measured in the paper’s frame and not after the turn.
Which side of the paper shows comes from the winding of the projected outline: if the reflection has reversed it you see the back, coral instead of blue. The facet’s normal, worked out from its corners in 3D, gives the light coming from the top left; every facet casts a shadow that grows with its height, and the whole sheet a blurred shadow on the panel, drawn off the canvas so that only the shadow lands. The sides that are creases are traced with a pale line, the cut edges with a dark one; a glint runs along every new crease, and a very faint grain of fibres covers the paper.
Before every fold its line is drawn in the style of origami diagrams, pale where it runs on the paper and dark outside it, clipped to the sheet’s outline. If the upload fails the flap stops halfway and falls back with elastic.out, and the line turns red. The wings are the kite’s two flaps, hinged on the back: in flight they turn round that hinge in opposite directions, between 30 and 118 degrees, while the camera turns and drops to show them. Unfolding is the same thing backwards: every fold from 180 to 0 degrees, the last one first.
The four phases are a role=progressbar with aria-valuenow and an aria-valuetext naming the phase; the panel has aria-busy while it works and an aria-live line says when the publishing starts, fails, is cancelled and when the article is live. The button changes its word (Publish, Cancel, Retry, Publish again) and takes the new width with a little bounce; a click from a script, the library preview’s, never cancels and publishes again only after Live has shown for two and a half seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
SECONDS | script.js | 7.5 | How long the demo’s publishing takes, in seconds, before the swan flies: all the folds get shorter or longer together. |
WORDS | script.js | ['Building 24 pages', 'Optimizing 61 images', …] | What the line says during the four phases (the phases’ names under the sheet are in index.html). |
SITE | script.js | fieldnotes.blog/notes-on-folding | The article’s address; at the end the line says on which site it is live. |
FAIL_EVERY | script.js | 2 | In the demo, one publishing in how many goes wrong (0 never). |
FAIL_PHASE | script.js | 2 | The phase that goes wrong then: 0 Build, 1 Optimize, 2 Upload, 3 Publish. The flap that falls open is that phase’s first fold. |
NECK | script.js | 0.62 | How long the swan’s neck is, in sides of the sheet. |
BEATS | script.js | 3 | The wing beats when the swan takes off. |
LIFT | script.js | 30 | How high it flies, in pixels. |
TURN | script.js | 30 | How far it turns in flight to show its wings, in degrees. |
GLINT | script.js | 0.75 | The glint that runs along every new crease: 0 none, 1 bright. |
For a wait of a few seconds split into phases and with an outcome: publishing an article or a site, a deploy, an export that goes through several stages. The folds say «a flat thing taking shape one step at a time» well, and the flap that falls open shows at once where everything stopped; for a load of a moment it is too much.
The panel takes the screen’s width less 32 pixels (358 on a 390 screen) and stays 362 tall; the sheet scales to fit its room and the canvas paints at the screen’s real density, up to twice. The button is a pill 40 tall that squashes and springs back under a finger; the corner lifting ahead of time and the widening words are there only under the mouse.
No turning flaps, leaning camera, glints or flight: the dashed lines still show, and at every fold the new sheet fades in over the old one, so the figure grows step by step and says how far along things are. The error leaves the flap open with the red line, the end shows the swan standing with its wings just open, and the new words fade in.
GSAP 3.15.0, Instrument Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 17 KB; the libraries: GSAP 28 KB.
Tested on 8 October 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.
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.