ContentBox.js · Guide
Make your page come alive in a few clicks. ContentBox.js has three animation tools built in: one click for a whole section, a Motion tab for a single element, and a timeline to fine-tune. You don't write any animation code. Here is what we'll make in about five minutes:
In this guide
Step 1
The Animate Section and Motion Timeline windows open from two buttons in the editor's left sidebar. Add them after you create the editor:
builder.addButton({
pos: 2, // position in the sidebar
title: 'Animate Section',
html: '<svg><use xlink:href="#icon-wand"></use></svg>',
onClick: () => builder.openMotionCascade(),
})
builder.addButton({
pos: 3,
title: 'Motion Timeline',
html: '<svg><use xlink:href="#icon-anim-timeline"></use></svg>',
onClick: () => builder.openMotionDock(),
})If you followed Adding a Custom Top Bar for ContentBox.js, you already have them. The Motion tab needs nothing: it is always in the edit panel on the right.
Step 2
You should see: the section plays right away, with each item coming in one after the other. Click another style to try it, or choose Slow under Spread for a gentler cascade.
One click on Fade up, then Slow for a gentler cascade.
Step 3
You should see: the heading plays word by word. The same tab has the presets from Animate Section, plus scroll effects such as parallax, all for just this element.
Split text on the heading, from the Motion tab.
Step 4
To change the timing, drag a diamond left or right: the item starts sooner or later. Set Duration to make the whole section play faster or slower.
Scrub with the playhead, then press play.
Step 5
Save, then open your page. The animation plays when the section comes into view, as in the video at the top.
Note: your viewing page needs the ContentBox runtime, which the getting-started guides already include.