A card built from layers. Your client places each layer on the card in the editor: a photo, a name, a price badge. On the page each layer sits at its own depth, so the card leans toward the pointer in 3D and the layers slide against each other as it turns.
Download example A zip of block folders for your theme. Needs GCB 1.3.1 or later, and nothing else.
What's in the download
tilt/The card: its shape, its layers, how wide it gets and how far it leans.layout-box/A box for content on the card. Any blocks inside.
Each folder is an ordinary GCB block: block.json, block.fields.json and render.php, plus a style.css and a view.js where it needs them. There is no build step and no library.
How it's built
The layers are a repeater field: each row is one layer with its picture or words, its place on the card and its depth. The editor opens them in a popout where your client drags each one into place.
Its fields, from block.fields.json:
| Field | Type |
|---|---|
| Shape | select |
| Layers | repeater |
| Widest it gets | range |
| How far it leans | range |
The depth and the lean are CSS, driven by custom properties the template prints for each layer.
Use it
- Unzip the download.
- Copy
tilt/andlayout-box/into your theme'sblocks/folder. - Reload the block editor. The block is in the inserter.
That's all of it. You don't register the block: there's no register_block_type() call and nothing to add to functions.php. GCB registers every folder in your theme's blocks/ folder by itself.
It is your block now. Change the markup, the fields or the script to suit the design. The docs cover every field type and marker used here.
More examples: all examples, or download them together as the GCB Kit.