
Tiles that rise
SVG, Hover, Physics
The «Puzzle of the day» card of Fianchetto, a made-up chess app: mate in one. The white rook lifts, jumps in an arc to d8 and lands with a one-pixel overshoot; the black rook it takes is knocked, tips over, falls on its side, slides spinning off the board and drops into the tray of captured pieces with two small bounces. Then the black king's square turns red and «Mate in 1» becomes «Solved» with a drawn tick. Under the pointer the white pieces rise and show their squares as thin rings; click a piece and then a square to play the move.
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>
<!--
"Chess puzzle" 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>Fianchetto, the puzzle of the day</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/instrument-sans@5.3.0/index.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 Puzzle of the day card of Fianchetto, a made-up chess app: white to play and mate in one. The rook lifts,
jumps in an arc up the d file and lands on d8 with a one-pixel overshoot; the black rook it takes is knocked,
tips over, slides and spins off the board and drops down the tray of captured pieces with a small bounce; the
black king's square turns the accent colour and Mate in 1 becomes Solved with a drawn tick. Hover a white piece
to lift it and see its squares as thin rings; click a piece and then a square to play the move yourself -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
<defs>
<symbol id="p-pawn" viewBox="0 0 100 100">
<path d="M50 21a11.5 11.5 0 0 1 7.4 20.3c3.8 1.5 6.1 3.4 6.1 5.9 0 2.3-2 3.5-4.9 4.2 2.4 7.9 6.4 14.1 11.2 18.6H30.2c4.8-4.5 8.8-10.7 11.2-18.6-2.9-.7-4.9-1.9-4.9-4.2 0-2.5 2.3-4.4 6.1-5.9A11.5 11.5 0 0 1 50 21z"/>
<path d="M25.5 72h49a4 4 0 0 1 4 4v3.5a4 4 0 0 1-4 4h-49a4 4 0 0 1-4-4V76a4 4 0 0 1 4-4z"/>
<path d="M41.5 47.2h17" fill="none" style="stroke: var(--pd)"/>
</symbol>
<symbol id="p-rook" viewBox="0 0 100 100">
<path d="M29 17h9.5v7h6.5v-7h10v7h6.5v-7H71v15.5l-6.5 5V62l6 7.5h-41l6-7.5V37.5L29 32.5z"/>
<path d="M25.5 72h49a4 4 0 0 1 4 4v3.5a4 4 0 0 1-4 4h-49a4 4 0 0 1-4-4V76a4 4 0 0 1 4-4z"/>
<path d="M35.5 37.5h29M35.5 62h29" fill="none" style="stroke: var(--pd)"/>
</symbol>
<symbol id="p-knight" viewBox="0 0 100 100">
<path d="M33 69.5c.8-9.6 4.6-15.6 10.6-20.4-5.4-.2-9.6 1.6-12.8 5.4l-6.4-5.2c1.4-6.2 5.8-12.6 12.2-16.4L35.4 24l7.2 6c14-0 25.2 10.4 26.2 27.6.3 4.8-.3 8.8-1.2 11.9z"/>
<path d="M25.5 72h49a4 4 0 0 1 4 4v3.5a4 4 0 0 1-4 4h-49a4 4 0 0 1-4-4V76a4 4 0 0 1 4-4z"/>
<path d="M46 39.5a2.2 2.2 0 1 0 .1 0z" style="fill: var(--pd); stroke: none"/>
<path d="M52 32.5c6.5 2.4 10.6 8.4 11.6 16" fill="none" style="stroke: var(--pd)"/>
</symbol>
<symbol id="p-bishop" viewBox="0 0 100 100">
<path d="M50 10.5a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11z"/>
<path d="M50 22.5c10.2 7 15.6 14.6 15.6 22.6 0 6.2-3.8 9.6-8.4 10.8 1.6 5.8 5 10.4 9.4 14.1H33.4c4.4-3.7 7.8-8.3 9.4-14.1-4.6-1.2-8.4-4.6-8.4-10.8 0-8 5.4-15.6 15.6-22.6z"/>
<path d="M25.5 72h49a4 4 0 0 1 4 4v3.5a4 4 0 0 1-4 4h-49a4 4 0 0 1-4-4V76a4 4 0 0 1 4-4z"/>
<path d="M55.5 33.5 46 44M42 56h16" fill="none" style="stroke: var(--pd)"/>
</symbol>
<symbol id="p-queen" viewBox="0 0 100 100">
<path d="M22 26.5a4.5 4.5 0 1 1 .1 0zM36 19.5a4.5 4.5 0 1 1 .1 0zM50 16.5a4.5 4.5 0 1 1 .1 0zM64 19.5a4.5 4.5 0 1 1 .1 0zM78 26.5a4.5 4.5 0 1 1 .1 0z"/>
<path d="M23.5 31 34 51l2.2-24.5L45.6 49 50 22l4.4 27 9.4-22.5L66 51l10.5-20-4.8 27.5c-.9 3.8-1.4 7.4-.7 11H29c.7-3.6.2-7.2-.7-11z"/>
<path d="M25.5 72h49a4 4 0 0 1 4 4v3.5a4 4 0 0 1-4 4h-49a4 4 0 0 1-4-4V76a4 4 0 0 1 4-4z"/>
<path d="M30 60h40" fill="none" style="stroke: var(--pd)"/>
</symbol>
<symbol id="p-king" viewBox="0 0 100 100">
<path d="M47.2 7.5h5.6v5.4h5.4v5.6h-5.4v6.2h-5.6v-6.2h-5.4v-5.6h5.4z"/>
<path d="M50 27c-8.6 0-15 5.2-15 11.6 0 5 3 9 7.2 11.2-2 8.2-5.6 14.4-11 19.7h37.6c-5.4-5.3-9-11.5-11-19.7 4.2-2.2 7.2-6.2 7.2-11.2C65 32.2 58.6 27 50 27z"/>
<path d="M25.5 72h49a4 4 0 0 1 4 4v3.5a4 4 0 0 1-4 4h-49a4 4 0 0 1-4-4V76a4 4 0 0 1 4-4z"/>
<path d="M42 50.5h16" fill="none" style="stroke: var(--pd)"/>
</symbol>
</defs>
</svg>
<main class="stage" data-stage>
<article class="card" data-card aria-label="Fianchetto, puzzle of the day">
<header class="head">
<span class="mark" aria-hidden="true">
<svg viewBox="0 0 24 24"><rect x="2" y="2" width="20" height="20" rx="6"/><path class="mark__sq" d="M7 7h5v5H7z"/><path class="mark__hot" d="M12 12h5v5h-5z"/></svg>
</span>
<div class="head__text">
<p class="brand">Fianchetto</p>
<h1 class="title">Puzzle of the day</h1>
</div>
<p class="date">Wed, Nov 18</p>
</header>
<div class="table" data-table>
<div class="tray" data-tray aria-label="Captured pieces"><span class="tray__groove"></span></div>
<div class="board" data-board role="grid" aria-label="Chessboard, white to play">
<div class="squares" aria-hidden="true"></div>
<div class="marks" data-marks aria-hidden="true"></div>
<div class="coords" data-coords aria-hidden="true"></div>
<div class="pieces" data-pieces></div>
</div>
</div>
<footer class="foot">
<div class="turn">
<span class="turn__swatch" aria-hidden="true"></span>
<span class="turn__text" data-turn>White to play</span>
</div>
<div class="goal" data-goal>
<span class="goal__bg" data-goalbg></span>
<span class="goal__face goal__face--todo" data-todo>Mate in 1</span>
<span class="goal__face goal__face--done" data-done>
<svg class="tick" viewBox="0 0 16 16" aria-hidden="true"><path data-tick d="M3.4 8.6 6.6 11.6 12.8 4.8"/></svg>
Solved
</span>
</div>
<div class="rating">
<span class="rating__label">Rating</span>
<span class="rating__num" data-rating>1842</span>
<span class="rating__gain" data-gain>+8</span>
</div>
</footer>
</article>
<p class="hint" data-hint>Hover a white piece, click it, then a square</p>
</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.
31 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 “Chess puzzle” from Animorio and fit it into my siteEvery piece is a box one square big, moved with translate in percent of its own size: 100% is one square. So the position is written in squares (x the file, y the row from the top), the board can change size whenever it likes and nothing has to be worked out again in pixels. Inside the box, the ground shadow and one layer for height and rotation holding the SVG drawing.
The jump is two numbers: the ground position, going from d1 to d8 with power2.inOut, and the height, rising with sine.out and falling with power2.in. The height lifts the drawing, enlarges it a little and widens and fades the shadow, which stays on the ground. On landing the height goes one pixel below zero in 0.06 s and comes back in 0.36 s.
The taken rook has a small simulation of its own, in squares and seconds, in a GSAP ticker. First it tips on the left edge of its base: a turn around the middle plus the shift that makes it a turn around the edge, with a push that grows with the sine of the angle, and at 90 degrees it bounces back with 28% of its speed. Then it slides: friction slows it down and the spin follows. Past the edge it falls into the tray with gravity and bounces with 32% of its speed, while it shrinks and lies flat.
The squares of every white piece are worked out as in chess (sliding for rook, bishop and queen up to the first piece, knight jumps, king steps, pawn step and capture), without looking for checks on its own king: for the rings that is enough. The rings open from the piece outward, nearest first, with back.out.
After the landing, one timeline: the squares of the move, the king's square taking the colour, the king flinching with GSAP keyframes, the line naming the move, the pill turning over with the tick drawn by strokeDashoffset and the rating counting up. Then a delayedCall brings everything back to the start and the autopilot plays again.
| Name | File | Default | What it changes |
|---|---|---|---|
JUMP | script.js | 0.72 | Seconds of the rook's jump from d1 to d8. |
ARC | script.js | 0.55 | Height of the jump's arc, in squares. |
HOVER_LIFT | script.js | 0.06 | How far a piece rises under the pointer, in squares. |
KNOCK | script.js | 5.2 | Speed the taken rook slides away at, in squares per second. |
FRICTION | script.js | 3.4 | How hard the board slows it down. |
GRAVITY | script.js | 16 | How fast it falls down the tray. |
BOUNCE | script.js | 0.32 | How much speed it keeps on each bounce in the tray. |
HOLD | script.js | 3.2 | Seconds the solved puzzle stays before it starts again. |
WAIT | script.js | 1.4 | Seconds before the puzzle plays by itself. |
For a chess or board game app, the puzzle of the day widget of a puzzle site, the page of a chess club or a tournament, the onboarding of an app that teaches the game. The taken piece falling into the tray gives weight to the right move with no need for confetti.
The same. The board is sized on the smallest of 62% of the width, 50% of the height and 440 pixels, and the whole card, tray and words included, follows it. Without a pointer there is no hover: tap a white piece, its squares show, then tap the square.
No jumps and no falls: the rook fades from d1 and appears on d8, the taken one fades and appears lying in the tray, the king's square, the «Solved» pill and the rating fade in. A wrong move only makes the piece blink.
GSAP 3.15.0, Instrument Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.
Tested on 18 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.