Scrollcraft
Chapter 5 of 15RO

The nine scroll techniques.

Nearly every cinematic site is a mix of these nine. This page is the reference, and the site you are reading uses all of them, so you can feel each one.

Chapter 5 of 155 min read

What you will learn

By the end of this chapter
  1. 01Name the nine scroll techniques and say what each one is for.
  2. 02Choose a technique by the job it does in the story, not by how impressive it looks.
  3. 03Build each one with CSS and a little JavaScript, with a still version under reduced motion.
  4. 04Combine two or three techniques on one page without them competing.

Keep scrolling. The cards move sideways.

1

Sticky positioning

Section labels lock under the top bar and hand over to the next one.

See it: Product, Skills, Build
2

Scroll snap

The view settles on defined panels. Safe on a horizontal strip, risky on the whole page.

See it: Demo below
3

Scroll triggered

Elements fade and rise once when they enter the viewport.

See it: Every page
4

Infinite scroll

More content loads as you approach the end. A sentinel element at the bottom asks for the next batch.

See it: Build, prompt library
5

Scroll driven

A value follows the exact scroll position. Words light up, bars fill.

See it: Home, statement and top bar
6

Zoom on scroll

An image scales up gradually while it crosses the screen.

See it: Home, particle head
7

Parallax

Background layers move more slowly than the foreground, which gives depth.

See it: Home hero and the final band
8

Horizontal scroll

Vertical scroll moves a row of cards sideways inside a pinned section.

See it: Below: the nine cards
9

Scrollytelling

A fixed scene stays put while text steps scroll past and change it.

See it: Build, the four-stage loop

01 · Each technique, with code

9 techniques
1

Sticky positioning

Section labels lock under the top bar and hand over to the next one.

Use for chapter labels and long lists where context should stay visible.

HTML
<section>
  <h2 class="label">01 · Brief</h2>
  <p>Scroll. The label stays under the top edge until its section ends.</p>
</section>
<section>
  <h2 class="label">02 · Build</h2>
  <p>Then the next label takes over.</p>
</section>
<section>
  <h2 class="label">03 · Review</h2>
  <p>No JavaScript at all.</p>
</section>
2

Scroll snap

The view settles on defined panels. Safe on a horizontal strip, risky on the whole page.

Do not combine y-axis snap with smooth scrolling or pinned sections. They fight each other.

HTML
<div class="strip" tabindex="0">
  <div>One</div><div>Two</div><div>Three</div><div>Four</div>
</div>
3

Scroll triggered

Elements fade and rise once when they enter the viewport.

Hide only under a .js class. Never hide content again when scrolling back up.

HTML
<p class="lead">Scroll down.</p>
<div class="card reveal">Arrives once</div>
<div class="card reveal">and stays</div>
<div class="card reveal">when you scroll back up</div>
4

Infinite scroll

More content loads as you approach the end. A sentinel element at the bottom asks for the next batch.

Cap the total or give a way past it, or the footer becomes unreachable.

HTML
<ol id="list"></ol>
<p id="sentinel">Loading…</p>
5

Scroll driven

A value follows the exact scroll position. Words light up, bars fill.

Use for progress and for text you want read at the pace of the scroll.

CSS only (check browser support first)
.progress { transform-origin: 0 50%; animation: grow linear both; animation-timeline: scroll(root); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
HTML
<div class="bar"></div>
<section class="pin">
  <p class="words">The scroll becomes the camera and the page becomes the set.</p>
</section>
<p class="after">End of the pinned section.</p>
6

Zoom on scroll

An image scales up gradually while it crosses the screen.

Animate transform only. Scaling width or height forces layout on every frame.

HTML
<p class="lead">Scroll down.</p>
<figure>
  <div class="img"></div>
</figure>
<p class="lead"></p>
7

Parallax

Background layers move more slowly than the foreground, which gives depth.

Keep speeds between 0.15 and 0.5. Reduce, do not remove, the effect on phones.

HTML
<header class="hero">
  <div class="layer far" data-speed="0.2"></div>
  <div class="layer mid" data-speed="0.35"></div>
  <div class="layer near" data-speed="0.5"></div>
  <h1>Depth</h1>
</header>
<main><p>Content scrolls at normal speed over the slower layers.</p></main>
8

Horizontal scroll

Vertical scroll moves a row of cards sideways inside a pinned section.

Pin once per page. Set the wrapper height from the track width.

HTML
<p class="lead">Scroll down.</p>
<section class="hs">
  <div class="pin">
    <div class="track">
      <div class="card">1</div>
      <div class="card">2</div>
      <div class="card">3</div>
      <div class="card">4</div>
      <div class="card">5</div>
    </div>
  </div>
</section>
<p class="lead">After the gallery.</p>
9

Scrollytelling

A fixed scene stays put while text steps scroll past and change it.

Stack the scene above the text on phones, and keep each step tall enough to read.

HTML
<section class="scrolly">
  <div class="vis">
    <div class="shape"></div>
  </div>
  <div class="steps">
    <p class="step">Brief: say what you want.</p>
    <p class="step">Generate: one piece at a time.</p>
    <p class="step">Inspect: look at every width.</p>
    <p class="step">Refine: describe what you saw.</p>
  </div>
</section>

02 · Real-world recipes

5 recipes
a

Sticky product tour

A device stays pinned while feature blocks scroll past. The feature being read decides what the device shows. Most product launch pages are built on this.

Light the last feature whose heading has passed a reading line, checked in the scroll frame, so a fast fling never skips one. Watch the heading, not the whole block, so the lit text is the text in view. On phones, put the line just under the pinned device.

HTML
<section class="tour">
  <div class="device">
    <div class="screen" data-i="0"><b>Track</b></div>
  </div>
  <div class="features">
    <article>
      <h3>Track</h3>
      <p>Every run, logged without opening the app.</p>
    </article>
    <article>
      <h3>Plan</h3>
      <p>A week of sessions built from your last month.</p>
    </article>
    <article>
      <h3>Share</h3>
      <p>A route card your friends can open in one tap.</p>
    </article>
  </div>
</section>
b

Clip-path reveal

A case-study image opens from a small window to its full frame as it reaches the middle of the screen. A staple of studio portfolios.

Set the clip from JavaScript only, so the image is fully visible if the script never runs. clip-path: inset() is cheap to animate.

HTML
<p class="lead">Scroll down.</p>
<figure class="reveal-img">
  <div class="img"></div>
  <figcaption>Case study · 2026</figcaption>
</figure>
<p class="lead"></p>
c

Frame-sequence scrub

The scroll position picks a frame and a canvas draws it. This is how product rotations on launch pages work. The preview draws its frames in code; a real site preloads image files.

Export 60 to 120 frames as WebP or AVIF, preload them before the section, and draw only when the frame number changes.

HTML
<section class="seq">
  <canvas></canvas>
</section>
<p class="after">A real site draws image files here: one per frame, preloaded.</p>
d

Scroll-speed marquee

A line of text drifts on its own, speeds up while the reader scrolls, then settles back. A common accent on agency sites.

Repeat the text so it wraps without a gap, and do not start it at all under reduced motion.

HTML
<p class="lead">Scroll, fast and slow.</p>
<div class="marquee">
  <div class="row">Strategy · Design · Motion · Build · </div>
</div>
<p class="lead"></p>
e

Headline revealed line by line

Each line of a large headline slides up from behind a mask, one after another.

Break the lines by hand in the markup rather than measuring the text, so a late font cannot break the split.

HTML
<p class="lead">Scroll down.</p>
<h2 class="split">
  <span class="line"><span>Quiet pages</span></span>
  <span class="line"><span>that move only</span></span>
  <span class="line"><span>when it matters.</span></span>
</h2>
<p class="lead"></p>

03 · Choosing and combining

You wantUseAvoid
Depth in the first screenParallaxSpeeds above 0.6
Content that arrives gracefullyScroll triggered revealsRe-hiding on scroll up
A guided explanationScrollytelling or scroll driven wordsMore than one pinned section per page
A feature galleryHorizontal scrollFewer than four cards, it is not worth pinning
An endless listInfinite scroll with a capAn unreachable footer
Smooth, expensive-feeling movementLenisPage-level scroll snap
Reduced motion is part of the design. When prefers-reduced-motion is set, switch off smooth scrolling, parallax and the reveal movement together. A fade can stay.

Practice · Work with AI

The same task in your tool

Ask for one technique at a time, by name, with its limits. Then make the AI explain the code, so you can change it yourself next time.

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.

Add one technique

Prompt
Read CLAUDE.md. Add a sticky product tour to the site for [subject]: the device stays pinned while three features scroll past, and the active feature is the last one whose heading has passed 55% of the screen height. Plain CSS and JavaScript, one scroll listener, transform and opacity only. Under prefers-reduced-motion the features simply stack. Show me the plan first.

Explain it back

Prompt
Explain the code you just wrote line by line, as if I will maintain it alone: what runs on every frame, what runs once, and what I would change to make the effect slower or calmer.

Practice · Exercises

Try first, then compare
1

Match technique to job

For each job, pick a technique: keep a label visible while its section is read; show a long timeline; reveal a quote once; tell a product story in three beats.

Hint: four of the nine techniques answer these exactly.

Show the solution

Sticky positioning for the label; horizontal scroll for the timeline; scroll triggered for the quote; scrollytelling (or a sticky product tour) for the three beats.

2

Remove the JavaScript

The sticky positioning demo uses no JavaScript. Which other technique in this chapter can also be built in CSS alone in current browsers?

Hint: look at the scroll driven demo and at scroll snap.

Show the solution

Scroll snap is pure CSS. Scroll driven progress can be CSS too, with animation-timeline: scroll(); keep a JavaScript fallback for browsers that do not support it yet.

CSS
.progress {
  transform-origin: 0 50%;
  animation: grow linear both;
  animation-timeline: scroll(root);
}
@keyframes grow { from { transform: scaleX(0); } }
3

One too many

A hero has parallax layers, a zoom on scroll, a split headline and a scroll-speed marquee. Remove the effects that compete and keep the page cinematic.

Hint: one effect should lead each screen.

Show the solution

Keep the split headline as the first impression and one supporting depth effect, parallax or zoom, not both. Move the marquee further down the page, where it has the screen to itself.

Practice · Course project

One site, built across the course

Give the site for [subject] its signature moments. Pick two recipes from section 02 that fit your story, and build them one at a time.

  1. Choose two recipes and write in notes.md why each one serves the story.
  2. Add the first with the “Add one technique” prompt, check it, commit.
  3. Add the second, check that the two do not compete on the same screen, commit.
  4. Run “Explain it back” for both and keep the answers next to the code as comments.

Practice · Test it

Check the result
  • Each new effect runs at a steady frame rate while you scroll: no long tasks in the Performance panel.
  • With reduced motion on, each effect has a still version that still tells the story.
  • At 375 pixels wide, nothing overlaps and pinned sections fit the screen.
  • Keyboard scrolling (Space, Page Down, arrows) moves through every section.

Practice · Assessment

Acceptance criteria

0 of 4 criteria met

Next Playground

Four live experiments: smoothing, parallax speed, stagger timing and easing curves.

Keyboard shortcuts: [ previous chapter · ] next chapter