Animation skill · Web

Scroll effects

Reveals, sticky stories and progress driven by scroll.

Give this skill to your AI agent

Run this in your project. Claude Code picks it up from .claude/skills; for other agents, paste the file into their rules.

mkdir -p .claude/skills/scroll-effects && curl -fsSL https://kitesmotion.com/skills/scroll-effects/SKILL.md -o .claude/skills/scroll-effects/SKILL.md
Download SKILL.md

Scroll effects should help people follow a story or keep context. They must never block scrolling or hide content.

Prefer CSS scroll-driven animations

They run off the main thread and need no JavaScript.

css@supports (animation-timeline: view()) {
  .reveal {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
  • view() tracks an element crossing the viewport; scroll() tracks a scroller's progress.
  • Use animation-range to decide exactly when an effect starts and ends.
  • Use linear easing; the scroll position is the easing.

Common recipes

  • Reading progress bar: scaleX from 0 to 1 on animation-timeline: scroll(root).
  • Shrinking header: scale the avatar and title down over the first 120-200px of scroll.
  • Sticky story: a position: sticky stage inside a tall section; swap content with ranges.
  • Parallax: move background layers at 10-30% of scroll speed, never the text.

JavaScript fallback

Use IntersectionObserver for one-off reveals and GSAP ScrollTrigger or Framer Motion useScroll only when CSS cannot do it. Throttle work to requestAnimationFrame.

Rules

  • Content must be readable with animations disabled; animate from a visible state when possible.
  • Never hijack or smooth the native scroll by default.
  • Avoid scroll-linked effects on long forms and data pages.
  • Reduced motion: show the final state immediately.

More skills