Scroll is the
timeline.

ScrollDirector is a JavaScript library for building scroll-driven stories with scenes, cameras and layers.

Get started

Same scroll.
Different paths.

As you scroll, the sky drifts up and left, the mountain slides right, and the shore drops. Each layer follows its own keyframes.

Try the parallax example

Give each scene
its own distance.

This scene plays over 380 pixels of scroll. The mask that brings it on screen has its own 300 pixels.

See the starter code

Incoming scene

<Scene
  id="scene-code"
  duration={380}
  transition="mask"
>
Scroll to play

Build your first story.

Use ScrollDirector with React, Next.js, JavaScript or a script tag.

npm install scroll-director
import { Director, Scene, Camera, Layer } from "scroll-director/react";
import "scroll-director/style.css";

export default function Story() {
  return <Director>
    <Scene id="intro" duration={1600}>
      <Camera zoom={[1, 1.2]} />
      <Layer animate={{ y: [40, -40], opacity: [1, 0] }}>
        <h1>Let the story unfold.</h1>
      </Layer>
    </Scene>
    <Scene id="chapter-two" duration={1200} transition="dissolve">
      <Layer><h2>A new perspective.</h2></Layer>
    </Scene>
  </Director>;
}

Import components from /react and include the stylesheet once. Scene duration is scroll distance in pixels.