onScroll Kit
Trigger or drive an animation with the scroll, and drag where it starts and ends.
Pick onScroll in the type menu of an autoplay row, or click the preview of an onScroll() value, to open the onScroll editor.

animate('.panel', {
id: 'Panel reveal',
y: { from: 40, to: 0 },
autoplay: onScroll({ target: '.panel', enter: 'bottom top', leave: 'top bottom', sync: true }),
});
Thresholds
Drag the points of the scroll map to set the thresholds. The C points set the container thresholds, the T points the target thresholds. Green points set where the animation enters, red points where it leaves. You can also type each threshold in its field, such as bottom, top+=40 or 50%.
Fields
| Field | Edits |
|---|---|
| container | The element that scrolls. Empty for the browser window |
| target | The element whose position the thresholds follow |
| axis | y for vertical scroll, x for horizontal scroll |
| container enter, container leave, target enter, target leave | The four thresholds |
| sync | true links the progress to the scroll. interpolation smooths it with a catch-up amount, ease eases it with a sync ease, and methods calls playback methods such as play pause on each threshold |
| repeat | false stops the scroll sync once the animation completes |
| debug | Shows markers for the thresholds over your website |
In the free version, an onScroll() value from your code still plays and saves, but its fields need Editor Kit.