skip the tree
system / motion / scroll8 rebuilds

Scroll

The Scroll examples of the Motion library, rebuilt in Composite: the same trigger, in steps, with the system's own parts.

the category

motion/_rebuilds
rebuilds
8
from motion+
6
easing
steps() only

motion / scroll / scroll direction: hide header

after a motion.dev example
scroll the page
margin_rebuilds/​scroll/​scroll-hide-header.tsx
Motion
useScroll, direction
here
a scroll event
down
the header cuts out
up
the header cuts back

The header cuts out of the box on a scroll down, past 40 px, and back on any scroll up. Nothing slides.

motion / scroll / scroll horizontal gallery

after a motion.dev example
scroll the box
margin_rebuilds/​scroll/​scroll-horizontal.tsx
Motion
useScroll, useTransform
here
scroll(), motion
a step
one card, 64% of the box
cards
5

The scroll of the box picks one of five cards; the row cuts one whole card a step. It does not slide.

motion / scroll / scroll image reveal

after a motion+ example
scroll the box
margin_rebuilds/​scroll/​scroll-image-reveal.tsx
Motion
useScroll, useTransform
here
scroll(), motion
a step
one band, a quarter
bands
4, top down

The picture shows from its top edge down, one quarter a frame. The scroll picks the frame.

motion / scroll / scroll text lines

after a motion+ example
scroll the box
margin_rebuilds/​scroll/​scroll-text-lines.tsx
Motion
useScroll, useTransform
here
scroll(), motion
a step
3 cells sideways
lines
4, in turn each way

The scroll picks one of nine frames. Each line cuts three cells, the lines in turn to the right and to the left.

motion / scroll / scroll zoom hero

after a motion+ example
scroll the box
margin_rebuilds/​scroll/​scroll-zoom-hero.tsx
Motion
useScroll, useTransform
here
scroll(), motion
a step
one tenth of the box
size
40% to 100%

The hero picture grows from 40% of the box to all of it in six cuts. The title stays in the middle.

motion / scroll / scroll velocity: 3d planes

after a motion+ example
scroll the box
margin_rebuilds/​scroll/​scroll-velocity-linked-offset.tsx
Motion
useScroll, useVelocity
here
scroll(), Retro 3D
speed
four steps, 0 to 3
offset
an eighth of the wall a step

Cards stand in a tunnel and come forward as the box scrolls, one place at a time. The faster the scroll, the wider the cards stand apart, in whole steps of speed. When the scroll stops, the offset cuts back to none. Under reduced motion the speed stays at none.

motion / scroll / scroll highlight

after a motion+ example
scroll the box
margin_rebuilds/​scroll/​scroll-highlight.tsx
Motion
useScroll, useTransform
here
scroll(), motion
marked
one line, a solid fill
lines
6

The scroll picks the marked line; its fill is bone, and the others are grey. A line is marked one cut after the other.