Skip to content

Breathing tiles

Turn a grid of squares in a looping wave with Oscillate.

Preview of breathing tiles

Static preview at 1.5 seconds. Open the scene in the editor and press Play to see the motion.

Animation · Rectangle → Clone → Oscillate → Transform

Download scene JSON · Open SVG preview

Download the JSON file and open it in svertik with Open or by dragging it onto the editor. The scene is complete and editable.

  1. Create an outlined Rectangle, 30 × 30 px, with no fill, a turquoise stroke and Stroke width 2.
  2. Add Clone in Grid mode: Columns 11, Rows 8, Spacing [1.5, 1.5].
  3. Add Oscillate after Clone: Wave Sine, Frequency 0.5, Amplitude 1, Element phase 8. Its Time follows scene.time.
  4. Nest Transform inside Oscillate with Rotation 45. Oscillate swings the rotation around 0, and Element phase delays each square a little after the previous one.
  5. Set the document duration to 8 seconds with Loop enabled. At 0.5 Hz that is four full cycles, so the loop is seamless.

Run this from the main svertik checkout, replacing the input path with the downloaded file:

Terminal window
pnpm svertik render breathing-tiles.json -o breathing-tiles.svg --time 1.5

Without --time the render is the first frame, where every square is upright.

{
"version": 1,
"notes": "A grid of squares that turn in a wave. Oscillate drives a nested Transform, offset per element.",
"document": {
"width": 640,
"height": 480
},
"animation": {
"duration": 8,
"loop": true,
"fps": 60,
"tracks": []
},
"objects": [
{
"kind": "shape",
"id": "tiles",
"name": "Tiles",
"shape": "rectangle",
"params": {
"width": 30,
"height": 30,
"fill": false,
"stroke": true,
"strokeColor": "#09fdd1",
"strokeWidth": 2
},
"stack": [
{
"id": "tiles-clone",
"type": "clone",
"params": {
"mode": "grid",
"columns": 11,
"rows": 8,
"spacing": [
1.5,
1.5
]
}
},
{
"id": "tiles-oscillate",
"type": "oscillate",
"params": {
"wave": "sine",
"time": {
"$expr": "scene.time",
"fallback": 0
},
"frequency": 0.5,
"amplitude": 1,
"elementPhase": 8
},
"children": [
{
"id": "tiles-transform",
"type": "transform",
"params": {
"rotation": 45
}
}
]
}
]
}
]
}

Clone · Oscillate · Transform

Back to all recipes