mengto/skills

scroll-scrubbed-visual-sequence

Build reversible scroll-controlled visual transformations with a pinned or sticky stage, normalized progress, and video, image-sequence, canvas, SVG, or DOM renderers.

Zobacz źródło
Oryginalny dokument Skill

Treść z repozytorium z zachowaniem nagłówków, przykładów, kodu, tabel, linków i obrazów.

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:

js
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:

js
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:

js
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.

z tego samego repozytorium

Więcej Skills

Wszystkie Skills
mengto
Społeczność

cinematic-scroll-storytelling

Create cinematic scroll-driven landing pages with Lenis smooth scrolling, GSAP ScrollTrigger, scroll-linked progression, staggered text reveals, sticky card stacks, parallax backgrounds, scroll-scrubbed transitions, footer reveals, and immersive preloaders. Use when analyzing or building premium editorial scroll experiences, sticky project stacks, kinetic typography, or section-by-section storytelling.

instalacje
2
GitHub Stars
6,8 tys.
Aktualizacja
6 paź
mengto
Społeczność

landing-page

Use when designing or rewriting a high-converting landing page (single-offer page) for SaaS/apps/services. Covers structure, layout patterns, conversion strategies, copywriting, SEO/AEO, and common pitfalls.

instalacje
2
GitHub Stars
6,8 tys.
Aktualizacja
6 paź
mengto
Społeczność

scroll-world-storytelling

Turn an article, case study, brand narrative, product journey, or long-form story into a cinematic scroll-driven landing page using one of three renderers: scrubbed video, a real-time Three.js world, or semantic HTML/SVG data and typography. Use when the user asks for a scroll world, fly-through landing page, article-to-website transformation, animated planet, data scrollytelling, video-scrubbed page, connected visual journey, or story-led alternative to ordinary stacked sections.

instalacje
2
GitHub Stars
6,8 tys.
Aktualizacja
6 paź
mengto
Społeczność

no-ai-design-slop

Prevent and remove generic AI-generated design defaults, incoherent visual choices, and established UI defects while creating, revising, or reviewing websites, apps, screenshots, mockups, and design code. Use as a passive quality gate during UI work or for an explicit anti-slop cleanup; preserve the chosen art direction instead of forcing a neutral redesign.

instalacje
2
GitHub Stars
6,8 tys.
Aktualizacja
6 paź