Communitygithub.com

nicolas2601/router-skills

Apple/Stripe/Sony Bravia 風格的高級登陸頁面完整模板,包含 9 個已定義的區塊。強制使用 Vite + React 18 + TypeScript + Tailwind v4 + shadcn/ui + Framer Motion + lucide-react + @fontsource 技術棧。觸發 cinematic 高級登陸頁面、Apple 風格、滾動擦除影片、Hero Canvas、Awwwards 級登陸頁面。

router-skills 是什麼?

這是一個專為 AI 代理(例如 Claude Code、Cursor、Codex)設計的規範性模板技能,用於生成 Apple/Stripe/Sony Bravia 風格的高級登陸頁面。它強制規定了嚴格的技術棧,包括 Vite、React 18、TypeScript、Tailwind v4、shadcn/ui、Framer Motion 和 lucide-react。該技能定義了 9 個獨特的區塊,例如帶有 liquid-glass 效果的浮動 navbar、使用 canvas 實現的 scroll-scrub hero、不對稱的 bento 服務網格、影片背景的統計數據、雙向跑馬燈的推薦以及帶有 sticky 標題的雙欄 FAQ。它包含在 index.css 中的設計 token、liquid-glass 工具類和 5 個動畫原語。為了防止產生無效或低品質的輸出,內建了 15 條反廢料防護規則,涵蓋了顏色、陰影、排版和無障礙設計。該技能還包括了用於效能檢查的預交付驗證腳本、用於從影片中提取幀的 FFmpeg 管線,以及對超過 Vercel hobby 方案 25 MB 限制的建議。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/nicolas2601/router-skills/tree/HEAD/skills/cinematic-landing-template

在你喜歡的 AI 中提問

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

說明文件

Cinematic Landing 模板

適用於高級登陸頁面的規範性模板,帶有 scroll-scrub canvas hero。靈感來自 Apple AirPods Pro、Stripe、Sony Bravia。

強制技術棧(請勿更換)

npm create vite@latest . -- --template react-ts
npm install
npm install -D tailwindcss@next @tailwindcss/vite @tailwindcss/postcss autoprefixer
npm install motion lucide-react
npm install @fontsource/{display-font} @fontsource/{body-font}
npx shadcn@latest init -d
npx shadcn@latest add button accordion

檔案結構

src/
  App.tsx
  main.tsx
  index.css                  # 設計 token + Tailwind @theme + liquid-glass 工具類
  components/
    ScrubSequence.tsx        # canvas 幀渲染器(關鍵)
    BlurText.tsx             # 單詞交錯標題(關鍵)
    Navbar.tsx               # 浮動 liquid-glass 藥丸
    Hero.tsx                 # scroll-scrub canvas + 標題 + CTA
    ServicesBento.tsx        # 6 卡不對稱 bento
    Pourquoi.tsx             # 4 欄 why-us 網格
    Process.tsx              # 3-4 步驟編號水平流程
    Stats.tsx                # 影片背景 + 4 個帶計數動畫的統計數據
    Testimonials.tsx         # 2 行相反方向的跑馬燈
    Faq.tsx                  # 2 欄佈局(sticky 標題 + 手風琴)
    CtaFooter.tsx            # 電影級影片背景 + CTA + 底部欄
    ui/
      button.tsx             # 包含 hero、heroGlass、heroSolid 變體
      accordion.tsx
  lib/
    utils.ts
    constants.ts             # FRAME_COUNT、FRAMES_PATH、FRAME_EXT
public/
  frames/                    # frame_0001.jpg ... frame_NNNN.jpg

9 個區塊 — 強制模式

1. Navbar(浮動 liquid-glass 藥丸)

  • fixed top-4 left-1/2 -translate-x-1/2 z-50,帶有 liquid-glass rounded-full px-2 py-2
  • 3 個區域:logo+brand(左)| 導航連結置中(md+)| CTA(右)
  • 滾動 > 40px:top-4 → top-2 + backdrop-blur-xl
  • 手機版:漢堡選單 + 全屏 liquid-glass sheet

2. Hero(scroll-scrub canvas)

  • <section ref={scrollRef} className="relative h-[250vh]">(250vh 為幀序列提供滾動空間)
  • <div className="sticky top-0 h-screen overflow-hidden"> 用於固定
  • Canvas 絕對定位 inset-0 z-0
  • 徑向漸層暗角 z-1
  • 指向下一區塊的底部淡出 z-2
  • 內容(徽章 + BlurText H1 + 副標題 + CTA + 合作夥伴跑馬燈)z-10

3. ServicesBento(不對稱 6 卡)

  • 網格 md:grid-cols-3 gap-5
  • 卡 0:高 row-span-2
  • 卡 1-2:小
  • 卡 3:寬 col-span-2
  • 卡 4:小
  • 卡 5:全寬 col-span-3
  • 每張卡:liquid-glass rounded-2xl + 圖示使用 liquid-glass-strong rounded-full size-11 + display heading + 38ch 內文 + 右上角 ArrowUpRight

4. Pourquoi(4 欄 why-us)

  • 網格 lg:grid-cols-4 gap-5 mt-16
  • 每張卡:liquid-glass + 圖示 + display 標題 + 30ch 內文 + 底部強調線

5. Process(編號水平流程)

  • md:grid-cols-4 gap-0(gap-0 因為連接器填滿間隙)
  • 巨大數字 text-[140px] text-primary/25 重疊
  • 水平連接器:absolute top-20 -right-0 h-px w-full bg-gradient-to-r from-border via-border to-transparent

6. Stats(影片背景 + 計數動畫)

  • 影片背景 filter saturate(0) 降低飽和度
  • 頂部和底部 200px 漸層淡出
  • 中央卡片 liquid-glass rounded-3xl p-14
  • 4 個統計數據:數值 font-display italic text-7xl + 標籤 uppercase tracking-wide text-sm
  • 當進入視口時,使用 motion 從 0 開始動畫計數

7. Testimonials(2 行跑馬燈)

  • 第 1 行:animate-[marquee_28s_linear_infinite]
  • 第 2 行:animate-[marquee-rev_32s_linear_infinite](相反方向)
  • 遮罩:[mask-image:linear-gradient(to_right,transparent,black_8%,black_92%,transparent)]
  • 懸停暫停:hover:[animation-play-state:paused]

8. FAQ(2 欄佈局)

  • 網格 md:grid-cols-[0.9fr_1.1fr] gap-16
  • 左側:sticky md:sticky md:top-24,包含徽章 + display heading + 段落 + 按鈕
  • 右側:shadcn Accordion,項目已設定樣式

9. CTA + Footer

  • 影片背景 filter brightness(0.55)(此處不使用 saturate-0,與 Stats 區別)
  • 標題 font-display italic text-[180px](此處不使用 uppercase — italic 是另一種風格)
  • Footer:border-top + 版權 + footer 連結

設計 Token(index.css)

@import "@fontsource/{display-font}/400.css";
@import "@fontsource/{display-font}/700.css";
@import "@fontsource/{body-font}/400.css";
@import "tailwindcss";

:root {
  /* 原始調色盤 HSL 三元組(不使用 hsl() 包裝以在 Tailwind 中支援 alpha) */
  --ink:    20 15% 9%;
  --cream:  40 30% 90%;
  --ochre:  32 55% 65%;
  --terra:  14 55% 31%;

  /* 語意 */
  --background: var(--ink);
  --foreground: var(--cream);
  --primary: var(--ochre);
  --secondary: var(--terra);
  --muted: 240 4% 16%;
  --muted-foreground: 40 6% 72%;
  --border: 40 30% 90% / 0.18;
  --ring: var(--ochre);
  --radius: 0.75rem;

  /* 排版 */
  --font-display: "Oswald", "Impact", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;

  /* 佈局 */
  --gutter: clamp(20px, 4.2vw, 56px);
  --max: 1440px;
}

@theme {
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-primary: hsl(var(--primary));
  /* ... 其餘語意 token */
  --animate-marquee: marquee 28s linear infinite;
  --animate-marquee-rev: marquee-rev 32s linear infinite;
}

@keyframes marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }
@keyframes marquee-rev { from { transform: translateX(-50%) } to { transform: translateX(0) } }

Liquid-glass 工具類(@layer components)

.liquid-glass {
  background: rgba(255,255,255,0.01);
  background-blend-mode: luminosity;
  backdrop-filter: blur(4px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 20%,
    rgba(255,255,255,0)    40%, rgba(255,255,255,0)    60%,
    rgba(255,255,255,0.15) 80%, rgba(255,255,255,0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.liquid-glass-strong { /* 同上但 blur(50px) + 更強 box-shadow */ }

動畫 — 5 個原語(請勿發明新的)

  1. BlurText(標題):單詞交錯 0.07 秒,每個單詞持續時間 0.7 秒,緩動函數 [0.22, 1, 0.36, 1]
  2. Fade-up-on-view(副標題、CTA):initial={{opacity:0, y:16, filter:"blur(8px)"}},whileInView={{opacity:1, y:0, filter:"blur(0)"}},viewport={{once:true, amount:0.3}}
  3. Scroll-scrub canvas(僅 hero):Apple AirPods Pro 模式。參見技能 scroll-scrub-canvas。
  4. Marquee(合作夥伴、推薦):28 秒/32 秒相反方向,漸層遮罩邊緣,懸停暫停
  5. Liquid-glass ::before border(卡片、藥丸、按鈕):切勿替換為常規 CSS border

反廢料防護規則(15 條 — 提交前請閱讀)

  1. 任何地方都不得使用 emoji(文案、卡片、按鈕均不可)
  2. 不得使用紫/粉預設漸層(調色盤為暖色:ochre + terra + cream + ink)
  3. 卡片不得使用 shadow-2xl(深度 = backdrop blur,無投影)
  4. 按鈕不要用 rounded-3xl → 按鈕用 rounded-full,卡片用 rounded-2xl
  5. 不得留下 lorem ipsum 佔位符(使用 [TODO: {{PLACEHOLDER}}] 標記)
  6. 正文段落不要用 text-center(hero 和 CTA 除外 — 它們是獨立區域)
  7. 標題:font-display uppercase tracking-tight 或 font-display italic(同一元素上不可兩者同時使用)
  8. 每個區塊:徽章 + 標題 + 副標題模式(hero 和 footer 除外)
  9. 僅使用 lucide-react 圖示(不使用 heroicons、Material 或自訂 SVG,除非使用者提供)
  10. hero 不要用 <video> — hero 是 canvas。<video> 僅用於 Stats 和 CTA 背景。
  11. 不要用 motion.div 搭配 transition={{ duration: > 0.9 }}
  12. 不要有 console.log、註解掉的程式碼、空檔案或未使用的 import
  13. 文案使用 {{LANG}} — 不要自動翻譯佔位符
  14. 響應式:1440 桌面版 canvas,375px 手機版(iPhone SE),無水平滾動
  15. 無障礙設計:focus-visible:ring-2 ring-ring offset-2 offset-background,canvas aria-hidden,sr-only siblings 描述影片

交付前驗證

npm run dev   # 啟動無報錯
npm run build # 0 個 TS 錯誤,0 個 Vite 錯誤

# 視覺檢查:
# - Hero 首次繪製 < 300ms(優先預加載 frame_0001)
# - Scrub 無卡頓 > 50ms
# - Marquee 循環無縫(複製陣列,中點不可見)
# - FAQ 手風琴高度變化流暢
# - Navbar 在滾動 > 40px 時從 top-4 變為 top-2
# - 375px 無水平溢出

# 控制台:
# - 0 個 React 警告
# - 0 個幀 URL 404 錯誤

# 效能:
# - Lighthouse 效能 ≥ 85
# - LCP < 2.5s(使用 <link rel="preload"> 預加載 frame_0001)

幀提取管線

mkdir -p input public/frames

ffmpeg -i input/source.mp4 \
  -vf "fps=30,scale='min(1920,iw)':'-2':flags=lanczos" \
  -q:v 3 \
  public/frames/frame_%04d.jpg

ls public/frames | wc -l  # 貼上到 FRAME_COUNT

可選的 WebP(約小 40%):

for f in public/frames/*.jpg; do
  cwebp -q 82 "$f" -o "${f%.jpg}.webp" && rm "$f"
done

如果總容量 > 20MB 且部署在 Vercel hobby 方案(25 MB 限制):發出警告並建議使用外部 CDN。

資源

相關技能