git404hub

what is scrollmagic fr?

janpaepke/scrollmagic — explained in plain English

Analysis updated 2026-06-24

14,950TypeScriptAudience · developerComplexity · 2/5Setup · easy

tl;dr

Small zero-dependency TypeScript library that wraps IntersectionObserver and ResizeObserver to emit precise scroll-position events and progress values for any element.

vibe map

mindmap
  root((ScrollMagic))
    Inputs
      Scroll container
      Tracked element
      Zone options
    Outputs
      Enter events
      Leave events
      Progress values
    Use Cases
      Parallax
      Scroll bar progress
      Class toggles
      Lazy load
    Tech Stack
      TypeScript
      IntersectionObserver
      ResizeObserver

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Build a horizontal scroll progress bar that fills as the user scrolls down the page

VIBE 2

Trigger an entry animation in GSAP when a section enters the viewport

VIBE 3

Toggle a CSS class on a sticky header based on scroll position progress

VIBE 4

Drive a scroll-linked video timeline that scrubs forward as the user scrolls

what's the stack?

TypeScriptJavaScriptIntersectionObserverResizeObserver

how it stacks up fr

janpaepke/scrollmagicalibaba/hookstriggerdotdev/trigger.dev
Stars14,95014,95514,915
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

ScrollMagic does not animate anything by itself, you still need GSAP, anime.js, or CSS to actually move pixels.

in plain english

ScrollMagic is a small JavaScript library for building scroll-based interactions on a web page. It tells your code where an element sits relative to the viewport as the user scrolls, and fires events when that position changes. The README describes the current release as version 3, and points users of the older version 2 to a separate branch called v2-stable. It is written in TypeScript, ships with native types, has zero dependencies, and weighs around 6 kilobytes gzipped. The README is careful to set expectations: ScrollMagic does not animate anything by itself. It only gives you precise scroll-position data and events, which you then plug into your own animation, lazy loading, parallax effect, scroll-linked video, behavioural tracking, or anything else. For ready-made scroll animation, the README points readers at GSAP ScrollTrigger, Motion, and anime.js. It also notes that modern CSS has native scroll-driven animations, and positions itself as a complement that adds cross-browser support, callbacks, progress values, and state. Under the hood it is a wrapper around two browser APIs, IntersectionObserver and ResizeObserver, with shared observers, batched animation frames, and single-frame updates to keep performance steady. It works with any scroll container, vertical or horizontal scrolling, server-side rendering, and any framework, since it has no opinions about React, Vue, or vanilla JavaScript. A plugin system is mentioned for extending it. The core idea is that you define two zones: a container zone on the scroll container, and an element zone on the tracked element. A progress value moves from 0 to 1 as the element zone passes through the container zone, and the library fires enter, leave, and progress events along the way. The README gives two common configurations as mental models. Contain is the default when no element is set: progress runs while one fully contains the other, useful for scroll progress bars and parallax. Intersect is the default when an element is set: progress runs while the element overlaps the viewport, useful for enter and leave animations or class toggles. The README ends with a mapping table that shows how the native CSS view-timeline ranges (cover, contain, entry, exit) correspond to ScrollMagic option combinations, and a full options table covering element, elementStart and elementEnd insets, container, containerStart and containerEnd, vertical axis, and others. Installation is a single npm install scrollmagic@next, and a quick-start snippet shows attaching enter, leave, and progress handlers to a tracked element.

prompts (copy fr)

prompt 1
Install ScrollMagic v3 with npm and write a snippet that fires console logs on enter, leave, and progress for a hero section
prompt 2
Show me how to combine ScrollMagic v3 with GSAP to scrub a timeline as the user scrolls past an element
prompt 3
Explain the difference between the Contain and Intersect default configurations in ScrollMagic v3 with one example each
prompt 4
Give me a ScrollMagic v3 setup for a horizontal scroll container with custom elementStart and elementEnd insets
prompt 5
Help me migrate an existing ScrollMagic v2 project to v3 and identify the breaking changes

Frequently asked questions

what is scrollmagic fr?

Small zero-dependency TypeScript library that wraps IntersectionObserver and ResizeObserver to emit precise scroll-position events and progress values for any element.

What language is scrollmagic written in?

Mainly TypeScript. The stack also includes TypeScript, JavaScript, IntersectionObserver.

How hard is scrollmagic to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is scrollmagic for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.