GCBGutenberg
Control Blocks
v1.3.3
Buy

Scroll timeline

A stage held on screen while the page scrolls, with layers set at moments along a timeline.

A scene that plays as the page scrolls. The stage holds on screen while the visitor scrolls through it, and each layer is set at moments along a timeline: where it is, how big, and any CSS such as opacity or rotation. Your client drags the moment in the editor and sees the stage at that point.

Recorded in the editor: drag the moment and the block changes with it.

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

  • scene/ The scene: its layers, how long it runs, its height, and keyframes for the stage itself.

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 and their moments are fields, stored as plain data with the block. The template prints the stage and its layers, and the script reads the keyframes and moves the layers as the page scrolls.

Its fields, from block.fields.json:

FieldType
Layersrepeater
How long it runsrange
Heightrange
Colour behind the layerscolor
The stage's own keyframesrepeater

view.js is about 7 KB of plain JavaScript with no animation library. With no script, the stage shows its first moment.

Use it

  1. Unzip the download.
  2. Copy scene/ 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