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がスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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
currentTimewrites inrequestAnimationFrame. - 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
- Keep the section in normal document flow and set its height from
scrollVh. - Put the visual in a
position: stickystage sized to the viewport. - Keep copy and controls in a separate layer. Do not bake essential text into frames.
- Map progress to the renderer with no implicit easing. Add optional smoothing after correctness is proven.
- Refresh measurements after fonts and intrinsic media sizes settle.
- 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-fitand 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
コメント
- …
このリポジトリの他のスキル
3d-cloth-material
7.2kThree.js で、糸の織り、柔らかい光沢、自然な襞、裾、縫い目を持つ、本物の織物らしい布を作るようエージェントを支援します。
3d-falling-leaves
7.2k3D のシーンに、回転し、風に流され、カメラの動きに合わせて再利用される、本物らしい落ち葉を加えるようエージェントを支援します。
3d-four-seasons
7.2k3D のシーンに、春、夏、秋、冬の見た目を加え、シーン全体を作り直さずに、茂み、光、空、雪を変えるようエージェントを支援します。
3d-high-poly-models
7.2k滑らかな形と自然な縁をもつ、詳細な3Dモデルを作り、その後、Web で快適に動く軽いバージョンを準備するようエージェントを支援します。
似ているスキル
blender-motion-state-inspection
280k3Dアニメーションの細部を確認できるようにします。ポーズ、動き、キャラクターの位置合わせをチェックするのに役立ちます。
manim-video
280kエージェントがアニメーション付きの解説動画を作成するのを支援します。Manimを使い、技術的な概念を分かりやすく示すグラフや図を生成します。
remotion-video-creation
280kReactとライブラリの Remotion を使って、エージェントが動画を作成するためのガイドです。アニメーション、音声、字幕などの視覚要素に関するベストプラクティスを扱います。