GCBGutenberg
Control Blocks
v1.3.3
Buy

Layers card

A card with layers at different depths that lean toward the pointer in 3D.

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.

Recorded in the editor: place each layer on the card. On the live page each layer sits at its own depth, so the card tilts in 3D under the pointer.

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:

FieldType
Shapeselect
Layersrepeater
Widest it getsrange
How far it leansrange

The depth and the lean are CSS, driven by custom properties the template prints for each layer.

Use it

  1. Unzip the download.
  2. Copy tilt/ and layout-box/ into your theme's blocks/ folder.
  3. 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.

Build anything in the block editor

Every licence includes all features and a year of updates and support.

Buy GCB from $8.25 a month See pricing