本文へスキップ
Skillpedia
モーションとアニメーション7.2k · #13463

scroll-scrubbed-visual-sequence

できること

このスキルは、製品の組み立てや物体の回転などの視覚的な変化を、ページのスクロール位置に結びつけます。信頼できる代替表示を備えた、スクロール連動のストーリーが欲しいデザイナーや開発者向けです。

使う場面

  • ✓読者がページを下にスクロールすると、製品が組み立てられたり回転したりしてほしいとき。
  • ✓訪問者がどこまでスクロールしたかで、ヒーローの状態が変わるべきとき。
  • ✓ネイティブのスクロールで、両方向に動く図や写真の並びが必要なとき。

スキルのリンク

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/scroll-scrubbed-visual-sequence/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/scroll-scrubbed-visual-sequence/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のページの製品動画を、訪問者が下にスクロールすると順方向に、上にスクロールすると逆方向に再生されるようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、スクロール位置から一つの進行の値を定義し、それを選んだ描画方法で動かします。描画方法は動画、画像、キャンバス、SVGのいずれかです。スクロールが正確なフレームを制御するので、タイマーやホイールの動きが状態を決めることはありません。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Scroll-Scrubbed Visual Sequence

Turn one visual transformation into a responsive scroll instrument. Keep the page usable without motion and keep the renderer replaceable.

Define the sequence

Write the visual states before coding:

const sequence = {
  scrollVh: 280,
  frameCount: 96,
  fit: "contain",
  posterFrame: 0,
  reducedMotionFrame: 95,
  copyStops: [0, 0.42, 0.78]
};

Use one normalized value for every renderer:

const progress = Math.min(1, Math.max(0,
  (viewportTop - sectionTop) / (sectionHeight - viewportHeight)
));

Never make wheel delta, elapsed time, or autoplay the source of truth. Native scroll position must determine the exact visual state in both directions.

Choose the renderer

  • Use video when the sequence is continuous, photographic, or expensive to render live. Encode frequent keyframes, preload metadata, reserve the aspect ratio, and coalesce currentTime writes in requestAnimationFrame.
  • Use an image sequence when exact art-directed frames matter. Preload the current frame first, then nearby frames; never block first paint on the whole set.
  • Use canvas for procedural drawing or compositing. Cap device pixel ratio at 2 and redraw only when progress changes.
  • Use SVG or DOM for diagrams, product cards, interface states, and accessible text. Drive transforms, opacity, clip paths, and CSS variables instead of layout-heavy properties.
  • Use WebGL only when depth, lighting, or a real 3D camera materially strengthens the idea. Provide a static poster and dispose resources.

Build the scroll stage

  1. Keep the section in normal document flow and set its height from scrollVh.
  2. Put the visual in a position: sticky stage sized to the viewport.
  3. Keep copy and controls in a separate layer. Do not bake essential text into frames.
  4. Map progress to the renderer with no implicit easing. Add optional smoothing after correctness is proven.
  5. Refresh measurements after fonts and intrinsic media sizes settle.
  6. Release the sticky stage cleanly before the next section and keep the footer reachable.

Use GSAP ScrollTrigger when the project already uses GSAP or needs exact pin, refresh, and timeline coordination:

ScrollTrigger.create({
  trigger: section,
  start: "top top",
  end: () => `+=${innerHeight * 2.8}`,
  pin: stage,
  scrub: true,
  invalidateOnRefresh: true,
  onUpdate: ({ progress }) => render(progress)
});

For a dependency-free implementation, measure the section on scroll and resize, then schedule one render per animation frame.

Handle media safely

  • Keep a poster visible until the first real frame paints.
  • Clamp frame indexes to 0...frameCount - 1.
  • Cancel stale image requests and never queue every seek during fast scrolling.
  • Use object-fit and an explicit focal point so the subject survives mobile crops.
  • Pause decoding, rendering, and observation while the section is offscreen or the document is hidden.
  • Clean up ScrollTriggers, observers, listeners, animation frames, Blob URLs, and renderer resources on route change or unmount.

Preserve access and control

  • Keep headings, copy, captions, and the CTA in semantic HTML.
  • Do not trap scrolling, block keyboard navigation, or require precise pointer input.
  • Under prefers-reduced-motion: reduce, remove pinning and scrubbing, render the selected static frame, and restore ordinary document flow.
  • If the sequence communicates ordered information, expose the same states as text or a list.

Tune deliberately

Expose scroll distance, renderer, frame count, poster frame, media fit, focal point, copy stops, overlay strength, smoothing, and reduced-motion state as configuration. Avoid magic numbers distributed across event handlers.

Verify

Check forward and reverse scrolling, fast flicks, resize while active, 390/768/1024/1440 widths, unloaded frames, blocked video, reduced motion, keyboard order, route cleanup, and console errors. The same scroll position must always reproduce the same state.

Use demo/index.html as the working reference and demo/PROMPT.md to recreate or remix it. Keep REFERENCES.md as the links-only implementation source list.

よくある質問

どの描画方法を選べばよいですか?

滑らかな写真の並びには動画、正確なフレームには画像、描画にはキャンバス、図や文字にはSVGかDOMを勧めています。

スクロールを乗っ取りますか?

いいえ。ネイティブのページスクロールを使うので、動きがなくてもページは使えます。

すべてのフレームを一度に読み込みますか?

いいえ。画像の並びは、まず現在のフレームを読み込み、その近くのフレームを読み込みます。

詳細

作者による元の説明

Build reversible scroll-controlled visual transformations with a pinned or sticky stage, normalized progress, and video, image-sequence, canvas, SVG, or DOM renderers. Use for hero transformations, product assembly, interface state walkthroughs, object rotation, diagrams, or photo sequences that must move forward and backward with native scrolling.

repo: MengTo/Skills

人気

GitHubのスター
7.2k
ランキング
#13463
ライセンス
MIT
更新日
2026/11/1

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル