Communitygithub.com

MengTo/Skills

建立電影級滾動驅動的登陸頁面,使用 Lenis 平滑滾動、GSAP ScrollTrigger、滾動連結動畫、逐字揭示、黏性卡片堆疊、視差背景、滾動擦洗轉場、頁尾揭示與沉浸式預載動畫。

Skills 是什麼?

這個技能提供了一套完整的工具與模式,用於打造高品質、以滾動為主軸的電影級登陸頁面。它專注於產生類似高級編輯刊物或創意工作室網站的視覺敘事體驗,透過 GSAP 和 Lenis 實現流暢的滾動驅動動畫。技能涵蓋了從預載畫面、英雄區視差、文字逐字揭示、區塊揭露、到黏性卡片堆疊和頁尾視差揭示等完整的頁面結構與動畫序列。它定義了明確的「運動語彙」,如滾動驅動敘事、滾動連結動畫、視差滾動和動力排版,並提供了詳細的程式碼範例、Motion Tokens 和建立順序。此技能適用於 Claude Code、Cursor 等 AI 代理平台,協助開發者分析或建構需要沉浸式滾動敘事、黏性專案堆疊、動態排版或分節式故事的專案,並特別強調尊重使用者減少動畫的偏好與行動裝置效能。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/MengTo/Skills/tree/HEAD/agent-skills/web-design/cinematic-scroll-storytelling

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

預覽

來自技能 README

Skills preview

說明文件

電影級滾動敘事

使用時機

  • 當頁面應呈現宛如高級編輯刊物般,隨著使用者滾動而展開的敘事體驗。
  • 使用者提及滾動驅動敘事、滾動連結動畫、黏性卡片堆疊、視差、分割文字、預載畫面或電影級進程。
  • 作品集、工作室、產品或登陸頁面需要分節式揭露,並帶有層次深度。
  • 實作可使用 GSAP、ScrollTrigger 和 Lenis。

效果語彙

  • 滾動驅動敘事:區塊在滾動時依序揭示。
  • 滾動連結動畫:進度直接與滾動綁定,使用 scrub。
  • 滾動觸發運動:當區塊進入視口時動畫開始。
  • 交錯揭示:單詞、行、卡片或元素以些微延遲進入。
  • 漸進揭示:透明度、縮放、模糊、裁剪或位置隨滾動進度變化。
  • 黏性卡片堆疊:黏性卡片分層、縮放,並在下一張卡片出現時退去。
  • 視差滾動:背景與前景圖層以不同速度移動。
  • 滾動擦洗:動畫透過 scrub: true 或 scrub: 1 跟隨滾動條。
  • 動力排版:遮罩的分割文字移動,通常是逐字或逐行。
  • 預載畫面:開場載入螢幕、進度條與過渡動畫。

目標感受

  • 豪華編輯式網站。
  • 高端創意工作室作品集。
  • Apple 級別的動畫精緻度。
  • 現代 Awwwards 互動語言。
  • 沉浸式電影級登陸頁面。

避免:

  • 彈跳、彈性或有彈簧感的運動。
  • 劇烈的縮放跳動。
  • 花俏的遊戲風格效果。
  • 太多同時進行的滾動效果。
  • 使頁面難以閱讀的滾動劫持。

核心技術棧

npm i gsap lenis
import Lenis from "lenis";
import "lenis/dist/lenis.css";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";

gsap.registerPlugin(ScrollTrigger);

const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;

if (!reduceMotion) {
  const lenis = new Lenis({
    lerp: 0.08,
    smoothWheel: true,
    wheelMultiplier: 0.9,
  });

  lenis.on("scroll", ScrollTrigger.update);

  gsap.ticker.add((time) => {
    lenis.raf(time * 1000);
  });

  gsap.ticker.lagSmoothing(0);
}

window.addEventListener("load", () => ScrollTrigger.refresh());

運動標記

  • 進入緩動函式:power3.out 或 power4.out。
  • 擦洗場景:ease: "none" 搭配 scrub: 0.8 到 1.4。
  • 文字揭示持續時間:0.8s 到 1.1s。
  • 卡片揭示持續時間:0.9s 到 1.2s。
  • 單詞交錯:0.035s 到 0.07s。
  • 行交錯:0.08s 到 0.14s。
  • 卡片交錯:0.06s 到 0.1s。
  • 揭示偏移:y: 24 到 48。
  • 模糊:4px 到 10px,然後 0px。
  • 黏性卡片縮放深度:1 到 0.92。

頁面結構

  1. 預載畫面:黑屏、進度條、品牌/標題、淡入過渡。
  2. 英雄區:圖片視差、遮罩標題揭示、微妙的滾動提示。
  3. 介紹:逐字動力排版。
  4. 故事區塊:滾動觸發的淡入、模糊進入與裁剪揭示。
  5. 近期專案:黏性卡片堆疊,帶有縮放與層次深度。
  6. 圖庫或證明:滾動擦洗的水平或漸進揭示。
  7. 頁尾:視差揭示或緩慢向上轉交。

標記範例

<div class="preloader" data-preloader>
  <div class="preloader__bar" data-preloader-bar></div>
</div>

<main>
  <section class="hero" data-parallax-section>
    <img data-parallax-layer data-speed="-0.18" src="/hero.jpg" alt="">
    <h1 data-split-reveal>以電影般的克制展開設計。</h1>
  </section>

  <section data-story-section>
    <p data-split-reveal="words">每個區塊都帶著安靜的意圖抵達。</p>
  </section>

  <section class="project-stack" data-sticky-stack>
    <article data-stack-card>專案一</article>
    <article data-stack-card>專案二</article>
    <article data-stack-card>專案三</article>
  </section>

  <footer data-footer-parallax>...</footer>
</main>

預載畫面序列

使用預載畫面設定電影基調,然後轉交給英雄區揭示。

function initPreloader() {
  const loader = document.querySelector("[data-preloader]");
  const bar = document.querySelector("[data-preloader-bar]");
  if (!loader) return Promise.resolve();

  if (reduceMotion) {
    loader.remove();
    return Promise.resolve();
  }

  return new Promise((resolve) => {
    const tl = gsap.timeline({
      defaults: { ease: "power3.out" },
      onComplete: () => {
        loader.remove();
        resolve();
      },
    });

    tl.fromTo(bar, { scaleX: 0, transformOrigin: "left" }, { scaleX: 1, duration: 1.1 })
      .to(loader, { yPercent: -100, duration: 0.9, ease: "power4.inOut" }, "+=0.15");
  });
}

分割文字揭示

使用遮罩的溢出容器。避免分割包含連結或有意義行內標記的文字。

function splitWords(element) {
  if (element.dataset.splitReady === "true") return;

  const text = element.textContent || "";
  const parts = text.split(/(\s+)/);
  element.textContent = "";
  element.setAttribute("aria-label", text.trim());

  parts.forEach((part) => {
    if (!part.trim()) {
      element.appendChild(document.createTextNode(part));
      return;
    }

    const mask = document.createElement("span");
    const word = document.createElement("span");
    mask.className = "split-word-mask";
    word.className = "split-word";
    word.textContent = part;
    mask.setAttribute("aria-hidden", "true");
    mask.appendChild(word);
    element.appendChild(mask);
  });

  element.dataset.splitReady = "true";
}

function initSplitReveals() {
  if (reduceMotion) {
    gsap.set("[data-split-reveal]", { autoAlpha: 1 });
    return;
  }

  gsap.utils.toArray("[data-split-reveal]").forEach((element) => {
    splitWords(element);
    const words = element.querySelectorAll(".split-word");

    gsap.fromTo(
      words,
      { yPercent: 110, autoAlpha: 0, filter: "blur(8px)" },
      {
        yPercent: 0,
        autoAlpha: 1,
        filter: "blur(0px)",
        duration: 0.95,
        ease: "power4.out",
        stagger: 0.05,
        scrollTrigger: {
          trigger: element,
          start: "top 82%",
          once: true,
        },
      }
    );
  });
}
.split-word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.split-word {
  display: inline-block;
  will-change: transform, opacity, filter;
}

滾動觸發揭示

用於一般區塊。它們應播放一次,感覺從容不迫,而非抽搐。

function initSectionReveals() {
  if (reduceMotion) {
    gsap.set("[data-story-section], [data-reveal-item]", { autoAlpha: 1, clearProps: "all" });
    return;
  }

  gsap.utils.toArray("[data-story-section]").forEach((section) => {
    const items = section.querySelectorAll("[data-reveal-item]");
    const targets = items.length ? items : section.children;

    gsap.fromTo(
      targets,
      { y: 36, autoAlpha: 0, filter: "blur(8px)" },
      {
        y: 0,
        autoAlpha: 1,
        filter: "blur(0px)",
        duration: 1,
        ease: "power4.out",
        stagger: 0.08,
        scrollTrigger: {
          trigger: section,
          start: "top 82%",
          once: true,
        },
      }
    );
  });
}

滾動連結進程

使用擦洗時間軸來實現電影級進程。保持擦洗動畫為線性,讓滾動位置決定時間。

function initProgressionScenes() {
  if (reduceMotion) return;

  gsap.utils.toArray("[data-progress-scene]").forEach((scene) => {
    const media = scene.querySelector("[data-progress-media]");
    const copy = scene.querySelectorAll("[data-progress-copy]");

    gsap.timeline({
      scrollTrigger: {
        trigger: scene,
        start: "top top",
        end: "+=140%",
        scrub: 1.1,
        pin: true,
        anticipatePin: 1,
      },
    })
      .fromTo(media, { scale: 1.08 }, { scale: 1, ease: "none" })
      .fromTo(copy, { autoAlpha: 0, y: 40 }, { autoAlpha: 1, y: 0, stagger: 0.15, ease: "none" }, 0.15);
  });
}

黏性卡片堆疊

使用 position: sticky 進行佈局,並使用 ScrollTrigger 實現分層縮放/深度。較早的卡片應在後續卡片到達時退去。

[data-sticky-stack] {
  position: relative;
}

[data-stack-card] {
  position: sticky;
  top: 12vh;
  transform-origin: center top;
  will-change: transform, opacity;
}
function initStickyCardStack() {
  if (reduceMotion) return;

  gsap.utils.toArray("[data-sticky-stack]").forEach((stack) => {
    const cards = gsap.utils.toArray(stack.querySelectorAll("[data-stack-card]"));

    cards.forEach((card, index) => {
      const nextCard = cards[index + 1];
      if (!nextCard) return;

      gsap.to(card, {
        scale: 0.92 + index * 0.015,
        autoAlpha: 0.72,
        y: -24,
        ease: "none",
        scrollTrigger: {
          trigger: nextCard,
          start: "top 78%",
          end: "top 24%",
          scrub: true,
          invalidateOnRefresh: true,
        },
      });
    });
  });
}

視差

為英雄區圖片、背景圖層和頁尾揭示使用視差效果。保持移動距離小。

function initParallax() {
  if (reduceMotion) return;

  gsap.utils.toArray("[data-parallax-layer]").forEach((layer) => {
    const speed = Number(layer.dataset.speed || -0.16);
    const section = layer.closest("[data-parallax-section]") || layer;

    gsap.to(layer, {
      y: () => window.innerHeight * speed,
      ease: "none",
      scrollTrigger: {
        trigger: section,
        start: "top bottom",
        end: "bottom top",
        scrub: 1,
        invalidateOnRefresh: true,
      },
    });
  });
}

頁尾視差揭示:

function initFooterReveal() {
  if (reduceMotion) return;

  const footer = document.querySelector("[data-footer-parallax]");
  if (!footer) return;

  gsap.fromTo(
    footer,
    { yPercent: -12, autoAlpha: 0.85 },
    {
      yPercent: 0,
      autoAlpha: 1,
      ease: "none",
      scrollTrigger: {
        trigger: footer,
        start: "top bottom",
        end: "top 45%",
        scrub: 1,
      },
    }
  );
}

建立順序

  1. 先建立靜態頁面。
  2. 加入預載畫面與英雄區進入動畫。
  3. 加入分割文字揭示。
  4. 加入逐區塊揭示。
  5. 加入黏性卡片堆疊進程。
  6. 加入視差圖層。
  7. 僅在故事需要的地方加入擦洗固定場景。
  8. 加入減少動畫與觸控的備用方案。
  9. 在桌面與行動裝置上進行瀏覽器品質檢查。

提示模板

建立一個電影級滾動驅動的登陸頁面,具備流暢的 Lenis 滾動、GSAP ScrollTrigger 動畫、交錯文字揭示、黏性卡片堆疊進程、視差背景、滾動擦洗轉場、逐節故事敘述,以及沉浸式預載動畫。使用分層深度、縮放轉場、漸進透明度變化以及流暢的視口觸發運動,打造高級編輯體驗。

品質檢查清單

  • 停用 JavaScript 時內容仍可讀。
  • 偏好減少動畫的使用者看到靜態內容,且無平滑滾動層。
  • 滾動觸發的揭示只播放一次。
  • 滾動連結場景有意識地使用 scrub。
  • 黏性卡片不會重疊頁尾或卡住頁面。
  • 視差移動保持細微,不損害可讀性。
  • 即使圖片載入緩慢,預載畫面也能可靠地結束。
  • ScrollTrigger.refresh() 在圖片/字型/版面偏移之後執行。
  • 行動裝置有簡化的固定效果,或在效能下降時不進行固定。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

MengTo/Skills

Create polished 60 fps 4:3 4K browser screen-recording style videos from Codex in-app browser captures, with browser-only crop, natural macOS cursor styling, deliberate click choreography, zoom-follow framing, ffprobe/thumbnail verification, and optional native recording compatibility checks. Use when the user asks to record or re-record browser actions, show cursor clicks and zooms, make Dribbble/UI inspiration or product demo recordings, or asks whether Codex, Playwright, or an MCP can produce a natural browser demo video.

MengTo/Skills

Generate ElevenLabs text-to-speech audio from scripts or inline text using local voice profiles. Use when the user asks for ElevenLabs, text-to-speech, TTS, narration, voiceover, speech audio, or voice generation; load voice names, voice ids, emails, owners, and account-specific defaults only from local config outside the skill.

MengTo/Skills

Profile, audit, and optimize frontend page performance with emphasis on animation work, memory-leak risks, long-session slowdowns, CSS animations, canvas/WebGL requestAnimationFrame loops, marquees, skeletons, GSAP/Three/Matter effects, timers, listeners, and observers. Use when the user asks to make animations performant, pause offscreen animations, look for memory leaks, profile pages that slow the computer over time, fix janky scrolling, reduce CPU/GPU use, or repeat the "only play in view" optimization on React/Vite/Next/frontend pages using Codex Browser.

MengTo/Skills

Turn a reference video into a super detailed recreation or inspiration prompt. Use when the user provides, mentions, uploads, links, or points to a video and asks to analyze the design, UI, animations, transitions, scroll interactions, typography, colors, assets, WebGL/Three.js, storytelling, section-by-section behavior, or to create a prompt/article that recreates the page, app, interaction, or motion system.

MengTo/Skills

Create an on-scroll animation trigger using IntersectionObserver with Tailwind-friendly animation classes and keyframes. Use when asked for scroll-reveal, animate-on-scroll, or sequencing element animations when they enter the viewport.

MengTo/Skills

Use when designing or implementing product-grade web motion like Stripe, Linear, Apple, and Vercel. Covers motion principles, easing/duration defaults, choreography patterns, scroll/hover interactions, performance, accessibility (reduced motion), and implementation guidance.

MengTo/Skills

Create premium cinematic web motion systems with GSAP, ScrollTrigger, and Lenis. Use for luxury editorial websites, creative studio portfolios, Awwwards-style interactions, smooth scroll reveals, staggered text, parallax, pinned sections, magnetic hover states, custom cursors, and mouse-reactive layered movement.

MengTo/Skills

Use when designing or rewriting a high-converting SaaS pricing page (structure, plan design, copywriting, SEO/AEO, FAQs, layout patterns, experiments). Includes checklists, templates, and common pitfalls.

MengTo/Skills

Use when creating or refining WebGL-heavy landing pages and you need to steer toward a specific visual outcome (premium, technical, playful, cinematic) while balancing conversion clarity, performance, and implementation complexity.

相關技能