Scrollcraft
Chapter 6 of 15RO

Playground: change the numbers and watch what happens.

Four small experiments. Each one shows how a single setting changes the feel of a scroll site, and prints the line of code to copy.

Chapter 6 of 152 min read

What you will learn

By the end of this chapter
  1. 01Feel how smoothing, parallax speed, stagger and easing change the mood of a page.
  2. 02Choose values on purpose and write them down as design decisions.
  3. 03Copy the exact line of code each setting produces.
  4. 04Keep motion values consistent across the whole site.

01 · Smoothing

Lenis lerp

Lenis moves the page a fraction of the way to where you scrolled on every frame. That fraction is lerp. Click or drag on the bar to set a target.

Code
new Lenis({ lerp: 0.1 })

Low values feel heavy and slow. High values feel close to normal scrolling. The documented default is 0.1.

02 · Parallax

Layer speed

Scroll inside the box. The dots follow the formula from the example: translateY = scroll × (1 − speed).

Scroll this box
Code
layer.style.transform = 'translate3d(0,' + (y * (1 - 0.4)) + 'px,0)'

Speed 1 moves with the page and shows no depth. Speed 0 stays pinned to the page. Values between 0.15 and 0.5 read as depth. Past about 0.6 it tends to look like a fault.

03 · Stagger

Reveal timing
CSS
.reveal { transition-delay: calc(var(--d) * 100ms); }

Short delays read as one movement. Long delays read as a list being counted out. Keep the whole sequence under about a second.

04 · Easing

Cubic Bezier
CSS
transition: transform .9s cubic-bezier(0.2, 0.7, 0.2, 1);

The reveal curve starts fast and settles gently, which is why the example site uses it. Linear motion looks mechanical on interface elements.

Practice · Work with AI

The same task in your tool

The playground gives you numbers. These prompts turn them into one place in the code, so the whole site moves with the same character.

Open a terminal in the project folder and run claude. Press Shift+Tab until plan mode is on, paste the prompt, read the plan, then approve it. Project rules go in CLAUDE.md.

Apply the values

Prompt
Read CLAUDE.md. Collect every motion value in the site for [subject] into one place: the Lenis lerp, the parallax speed, the reveal stagger and the easing curve, as CSS custom properties and one JavaScript object. Use these values: lerp [value], parallax speed [value], stagger [value] ms, easing [cubic-bezier]. Replace the hard-coded numbers and list every line you changed.

Find stray values

Prompt
Search the CSS and JavaScript for durations, delays, easing curves and speeds that do not come from the shared motion values. List each one with its file and line. Do not change them yet.

Practice · Exercises

Try first, then compare
1

Calm versus lively

Find a smoothing value that feels calm and one that feels lively. Write both down with one word for each feeling.

Hint: a lower lerp follows the wheel more slowly.

Show the solution

Around 0.06 to 0.08 feels calm and heavy; around 0.12 to 0.15 feels responsive and light. Very low values make the page feel late, which reads as lag rather than calm.

2

Depth without nausea

Set the parallax speed so the layers feel deep but the text never drifts far from where the reader expects it.

Hint: move the background, not the words.

Show the solution

Keep text layers at speed 1 (moving with the page) and move only the background, at roughly 0.6 to 0.8. Large speed differences on text make reading harder and can cause discomfort.

3

One curve

Pick a single easing curve for every reveal on your site and explain why it fits [subject].

Hint: an ease-out starts fast and settles.

Show the solution

A strong ease-out such as cubic-bezier(.2, .7, .2, 1) arrives quickly and settles gently, which reads as confident and calm. Use it for every reveal; keep linear timing for scrubbed scenes, where the scroll is the easing.

Practice · Course project

One site, built across the course

Turn your choices into the motion settings of the site for [subject], so every effect shares them.

  1. Try each of the four experiments and note the values you like.
  2. Add the values to style.css and app.js as below, then run “Apply the values”.
  3. Run “Find stray values” and fix what it lists.
style.css
:root {
  /* motion: chosen in the playground */
  --reveal-duration: .9s;
  --reveal-stagger: 80ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* app.js */
/* const MOTION = { lerp: 0.09, parallax: 0.7, stagger: 80 }; */

Practice · Test it

Check the result
  • Every duration, delay, easing and speed in the code comes from the shared values.
  • Changing --reveal-duration in one place changes every reveal on the page.
  • Scrolling with a mouse wheel and with a trackpad both feel smooth, neither late nor jumpy.

Practice · Assessment

Acceptance criteria

0 of 3 criteria met

Next GSAP

Timelines, scrubbed and pinned scenes, SVG drawing and split-line text with GSAP, each running live beside its code.

Keyboard shortcuts: [ previous chapter · ] next chapter