Communitygithub.com

muhammedadnank/Antigravity-Skills

建立一個高級電影式登陸頁面,具備滑鼠拖曳影片英雄區塊與品牌驅動的敘事弧線章節。

Antigravity-Skills 是什麼?

這個技能會生成一個高級、品牌感知的登陸頁面,主要特色是滑鼠拖曳影片英雄區塊——頁面頂部的影片會隨著滑鼠左右移動而前後拖曳,創造出流暢且引人注目的互動效果。頁面下方則會安排4-5個完全不透明的章節,每個章節都有獨立的品牌識別(包含顏色、字體與版面配置),並引導訪客體驗一個完整的敘事弧線(例如:渴望 → 喜悅 → 懷舊 → 沉思 → 行動)。此技能支援多種語言(包含RTL語言如希伯來語和阿拉伯語),並會根據使用者提供的影片、Logo、產品圖片與品牌背景,自動提取色板、選擇字體,並使用ffmpeg將影片重新編碼為每幀都是關鍵幀的格式,以確保滑鼠拖曳的順暢度。它支援所有能執行Node.js與React的開發環境,並已針對Claude Code、Cursor與Codex等AI代理平台進行了最佳化。

相容平台✓Claude Code~Codex CLI✓Cursor✓Antigravity
npx skills add https://github.com/muhammedadnank/Antigravity-Skills/tree/HEAD/skills/cinematic-scrub-landing

在你喜歡的 AI 中提問

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

預覽

來自技能 README

帶有滑鼠拖曳影片和玻璃標題面板的英雄區塊
黃色
奶油色
深色
紅色

說明文件

電影式拖曳登陸頁面 — 黃金範本

建立一個高級、品牌感知的登陸頁面,其中英雄影片會回應滑鼠移動,而頁面其餘部分則引導訪客體驗一個五節奏的敘事弧線。使用者提供影片,並可選地提供Logo、產品照片與品牌背景——此技能負責處理色板提取、字體選擇、RTL/LTR、支架搭建、全關鍵幀影片重新編碼、滑鼠拖曳效果、章節庫與驗證。

為什麼這個技能存在

參考實作位於 https://github.com/hoodini/bamba — 一個以色列RTL零食「במבה」的網站,其中嬰兒影片會追蹤整個頁面的游標,而下方4個獨特的章節(明亮的黃色食譜、奶油色懷舊相簿、深色沉思定價、紅色行動結尾)則引導訪客體驗 渴望 → 喜悅 → 懷舊 → 沉思 → 行動。

帶有滑鼠拖曳影片和玻璃標題面板的英雄區塊

此技能中的每一條規則都源自於該建置。硬性規則章節中的要點都是經過實戰考驗的——它們會覆蓋通用的「良好程式碼」預設值。


章節畫廊(你正在建置的內容)

英雄區塊保持在頂部。在其下方,從庫中選取4個章節,並按照敘事弧線順序排列。每個章節都是完全不透明的(無影片透出),並擁有自己的品牌識別:

節奏類型參考資料
1 — 渴望英雄區塊(滑鼠拖曳影片)英雄區塊
2 — 喜悅太陽 — 明亮主要強調色漸層、漂浮主題SVG、巨大幽靈字體、統計卡片黃色
3 — 懷舊相簿 — 奶油色紙張、點狀微圖案、包含真實產品照片的拍立得Bento奶油色
4 — 沉思烘烤 — 深色帶放射狀強調色光芒、三張定價卡各有不同視覺處理深色
5 — 行動信號 — 全出血強烈強調色(紅/橘/綠)、巨大標題+CTA、玻璃容器面板紅色

對於技術/SaaS品牌,可視需要更換章節類型(請參閱下方的章節庫)——但始終以信號章節結尾。


如何使用此技能

  1. 將素材放入一個乾淨的工作目錄:

    • 英雄影片(任何容器格式 — .mp4, .mov, .webm)
    • Logo(強烈建議使用SVG;可接受含透明背景的PNG)
    • 1-3張產品/主題圖片(JPG/PNG,理想情況下是透明背景)
  2. 與使用者確認(簡短地 — 提出預設值,然後繼續):

    • 產品名稱 + 元標語
    • 語言代碼(決定RTL/LTR + 字體選擇)
    • 品牌背景 — 時代、受眾、情感核心、色板感覺
    • 可選:明確的色板十六進位碼、敘事弧線節奏
  3. 依序執行下方工作流程。 所有階段都是強制的。不要跳過ffmpeg重新編碼——這是讓拖曳感覺流暢的魔法。

  4. 在回報完成前進行驗證。 階段9有12項檢查。全部執行。


輸入 — 從使用者收集

PRODUCT_NAME: "<例如:במבה / Bamba / Hope the Cheetah / Acme CRM>"
TAGLINE: "<元訊息 — 例如 'it's not a snack, it's lifelong memories'>"
LANGUAGE: "<he | en | ar | es | fr | ja | ...>"
IS_RTL: "<true | false>"                                   # he/ar/fa = true; 其他全部為 false
HERO_VIDEO_FILE: "<cwd中的確切檔案名稱 — 例如 baby2.mp4>"
LOGO_FILE: "<確切檔案名稱 — 如果沒有則留空>"
PRODUCT_IMAGE_FILE: "<確切檔案名稱 — 如果沒有則留空>"
BRAND_CONTEXT: |
  <2-4個句子:它所喚起的時代、目標受眾是誰、情感核心、
  視覺識別(溫暖/冷色調/有趣/嚴肅)。驅動色板與主題。>
PALETTE: "<可選 — 如果要覆蓋,則為逗號分隔的十六進位碼>"
NARRATIVE_ARC: "<可選 — 5個情感節奏;如果留空,AI會提出>"

完整文字範本(包含相同的YAML區塊和提示主體)位於 references/GOLDEN_PROMPT.md — 當你無法直接使用技能執行環境時,將其貼入Claude並填入YAML。


階段 0 — 規劃設計(在寫程式碼之前輸出一個≤200字的簡報)

在編寫任何程式碼之前,輸出:

  1. 提取的5色色板: background(最深色墨水)、cream(溫暖的米白色文字 — 永遠不是 #FFFFFF)、accent(主要品牌色)、accent2(次要品牌色)、support(第三色調)。如果沒有提供 PALETTE,則從Logo + 產品圖片中提取。色板必須內部一致 — 全部暖色或全部冷色,絕不能混合。溫暖品牌(食物、自然、懷舊、動物)→ 不使用藍色、藍綠色、薄荷色、青色。冷色品牌(科技、金融、醫療、科幻)→ 除了極小面積的強調色外,不使用暖色調。

  2. 三種字體(展示用 / 正文 / 手寫強調色)根據語言:

    • he: Rubik(展示用) + Assistant(正文) + Suez One(強調色)
    • en: Anton(展示用) + Inter(正文) + Caveat(強調色)
    • ar: Cairo(展示用) + Tajawal(正文) + Reem Kufi(強調色)
    • es / fr / it / de: Anton 或 Bebas Neue(展示用) + Inter(正文) + Caveat(強調色)
    • ja: Noto Sans JP weight 900(展示用) + Noto Sans JP(正文) + Yusei Magic(強調色)
    • 其他:挑選三種符合該書寫系統的Google Fonts,並具有相同的 display-black / body-clean / handwritten-script 角色。
  3. 敘事弧線 — 5個情感節奏,對應到 BRAND_CONTEXT。將每個節奏配對到章節庫中的一個章節類型。

然後執行 — 無需請求確認。


階段 1 — 素材準備(魔術步驟)

1a. 驗證 ffmpeg

which ffmpeg     # 或:在 PowerShell 上使用 Get-Command ffmpeg

如果不存在,停止並告訴使用者安裝(brew install ffmpeg / Windows:http://ffmpeg.org)。

1b. 將英雄影片重新編碼為每幀都是關鍵幀

瀏覽器只能即時跳轉到關鍵幀 — 標準影片大約每250幀有一個關鍵幀,這會使滑鼠拖曳嚴重卡頓。這一個指令就是進階與業餘之間的差別:

ffmpeg -y -i <HERO_VIDEO_FILE> -g 1 -keyint_min 1 -c:v libx264 -preset slow -crf 20 -pix_fmt yuv420p -an hero.mp4

驗證輸出:hero.mp4 應該在 5-50 MB 之間。如果 > 50 MB,使用 -crf 25 重新執行;如果 > 80 MB,使用 -crf 28。移除音訊(-an)——英雄區塊是無聲的。

1c. 複製 Logo + 產品圖片

cp <LOGO_FILE>           public/logo.<ext>
cp <PRODUCT_IMAGE_FILE>  public/product.<ext>   # 如果有提供

階段 2 — 支架搭建

npm create vite@latest site -- --template react-ts
cd site
npm install
npm install lucide-react
npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -p
mkdir -p public
mv ../hero.mp4 public/hero.mp4
# 也將 logo + 產品圖片移動到 public/ 目錄下

階段 3 — Tailwind 設定

完全取代 tailwind.config.js。使用提取的色板與語言適配的字體:

/** @type {import('tailwindcss').Config} */
export default {
  content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
  theme: {
    extend: {
      colors: {
        background: '<墨水色/深色>',
        cream:      '<溫暖的米白色 — 永遠不是 #FFFFFF>',
        accent:     '<主要品牌色>',
        accent2:    '<次要色>',
        support:    '<第三色>',
      },
      fontFamily: {
        sans:    ['<正文字體>',         'system-ui', 'sans-serif'],
        display: ['<展示用字體>',      'sans-serif'],
        accent:  ['"<手寫字體>"', 'cursive'],
      },
    },
  },
  plugins: [],
}

階段 4 — index.html

完全取代。遵循 IS_RTL。始終包含指向Logo的favicon連結:

<!DOCTYPE html>
<html lang="<LANGUAGE>" dir="<rtl|ltr>">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/logo.svg" />
    <link rel="apple-touch-icon" href="/logo.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="<已選三種字體的 Google Fonts URL>" rel="stylesheet">
    <title><PRODUCT_NAME> — <TAGLINE></title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

階段 5 — index.css(設計系統)

完全取代。下方的每個工具類別都是承載性的。名稱假設是較早提取的暖色調色板;對於冷色品牌,將陰影色調中的「黃色」/「紅色」替換為實際的強調色。

必須包含:

  • html { scroll-behavior: smooth; } + section[id] { scroll-margin-top: 90px; } 以便定位的章節不會落在固定導覽列下方。
  • body 背景 = background 顏色(影片載入失敗時的備用)。游標 = crosshair。預設字體 = 正文 sans。
  • .liquid-glass / .liquid-glass-strong — backdrop-blur + saturate + 內光邊框 + 遮罩漸層邊緣高光。強度變體使用帶有 accent 色調的內光暈。
  • .glass-pill — 緊湊的圓角藥丸形,具有相同的玻璃效果,用於導覽項目和小徽章。
  • .cta-primary — 品牌CTA:linear-gradient(135deg, accent-light, accent, accent-shade) + 強調色光暈陰影,在懸停時強度增加 + translateY(-1px) 抬起效果。
  • .brand-mark — 當未提供SVG時,用於小型Logo標記的小方形/圓形。
  • .grid-bg — 微妙的1px網格與放射狀淡出遮罩,用於深色章節下方。
  • .reveal / .revealed — IntersectionObserver 滾動揭示:opacity 0 → 1 + translateY 28 → 0,持續時間0.9s,使用 cubic-bezier(0.16, 1, 0.3, 1)。
  • .scrim-top / .scrim-bottom — 僅用於英雄區塊的漸層覆蓋層。
  • 每個章節的背景,以感覺而非顏色命名:
    • .sun-section — 明亮主要強調色漸層 + 微妙的點狀紋理(「喜悅 / 打開袋子」節奏)。
    • .album-section — 溫暖的米白色紙張、放射狀強調色色調 + 點狀微圖案、邊緣遮罩淡出。
    • .roast-section — 深色,帶有放射狀強調色 + 對角角落中的accent2光芒 + 遮罩網格紋理。
    • .signal-section — 全出血強烈強調色(通常是紅/橘/綠色),用於行動結尾。
  • .polaroid — 白色卡片,內邊距 14px 14px 44px 14px,柔和的分層陰影,懸停時抬起至 translateY(-6px) rotate(0)。.polaroid-tape = 黃色/強調色膠帶條,絕對定位於頂部中央,旋轉 -4°,帶有虛線側邊提示。
  • .stamp — 強調色虛線邊框藥丸形,大寫,字距 0.18em。
  • .ribbon — 定價/熱門徽章,帶有 clip-path 三角形底部,深色投影。
  • .highlight-circle — 透過 ::after 創建的手繪感覺橢圓:圍繞內聯 <span> 旋轉 3px 強調色邊框。在大型標題中用於包圍最重要的單詞(每個標題最多一個)。
  • 裝飾性主題濾鏡:.peanut-svg / .<motif>-svg 帶有 drop-shadow。
  • 支援 prefers-reduced-motion: reduce — 在媒體查詢中停用揭示動畫 + 平滑滾動。

階段 6 — App.tsx 架構

架構是不可協商的。第一次就做對:

6a. 導入

import { useEffect, useRef, useState } from 'react';
import {
  Menu, X, ArrowLeft, ArrowRight, ArrowDown, ArrowUp, MousePointer2,
  // … 加上 4-8 個品牌主題圖示(Heart, Sparkles, Cookie, PawPrint, Cpu, Leaf, …)
} from 'lucide-react';

6b. 在 App.tsx 內部定義的可重用元件

  • useReveal<T>() — IntersectionObserver hook,回傳一個 ref;在首次相交時(threshold 0.15)添加 revealed 類別。
  • GlassCard — 帶有揭示 hook 的包裝器,可選的 strong prop,接受 className。
  • Motif — 一個裝飾性SVG元件,主題對應 BRAND_CONTEXT(食物用花生、動物用爪印、科技用電路、自然用葉子、飲料用水滴、能量用閃電)。以低透明度在深色/明亮章節的3-6個位置浮動。
  • ScrollToTopButton — 在RTL中固定於 bottom-6 left-6 / 在LTR中固定於 bottom-6 right-6。當 window.scrollY > window.innerHeight * 0.6 時出現。平滑滾動至頂部。簡短的語言適配標籤(「לראש」/「Top」/「أعلى」/「頂部」)。

6c. 滑鼠拖曳效果(核心)

const videoRef = useRef<HTMLVideoElement>(null);
const stateRef = useRef({ targetTime: 0, isSeeking: false });

useEffect(() => {
  const video = videoRef.current;
  if (!video) return;

  const handleLoaded = () => {
    const mid = video.duration / 2;
    video.currentTime = mid;
    stateRef.current.targetTime = mid;
  };

  const handleSeeked = () => {
    const s = stateRef.current;
    s.isSeeking = false;
    if (Math.abs(s.targetTime - video.currentTime) > 0.01) {
      s.isSeeking = true;
      video.currentTime = s.targetTime;
    }
  };

  const handleMouseMove = (e: MouseEvent) => {
    const s = stateRef.current;
    const d = video.duration;
    if (!d || isNaN(d)) return;
    const normalized = e.clientX / window.innerWidth;
    // 如果主體相對於游標「向後」移動,感覺不對,可以選擇
    // 使用 `1 - (e.clientX / window.innerWidth)` 代替 — 先詢問使用者。
    s.targetTime = Math.max(0, Math.min(d, normalized * d));
    if (!s.isSeeking) { s.isSeeking = true; video.currentTime = s.targetTime; }
  };

  video.addEventListener('loadedmetadata', handleLoaded);
  video.addEventListener('seeked', handleSeeked);
  window.addEventListener('mousemove', handleMouseMove);
  return () => {
    video.removeEventListener('loadedmetadata', handleLoaded);
    video.removeEventListener('seeked', handleSeeked);
    window.removeEventListener('mousemove', handleMouseMove);
  };
}, []);

isSeeking 守衛是關鍵的 — 沒有它,滑鼠移動的觸發速度會比瀏覽器解碼的速度快,導致搜尋佇列溢出和可見的卡頓。

6d. 可點擊的滾動監控導覽

const navItems: { label: string; target: string }[] = [
  { label: '<demo>',     target: 'top'     },
  { label: '<recipe>',   target: 'recipe' },
  { label: '<album>',    target: 'album'   },
  { label: '<pricing>',  target: 'pricing' },
  { label: '<cta>',      target: 'cta'     },
];

注意:由於內容長度限制,完整的 SKILL.md 文件已被截斷。技能的核心邏輯、章節庫、硬性規則與驗證步驟已全部翻譯。

Individual skills in this repo

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

muhammedadnank/Antigravity-Skills

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

muhammedadnank/Antigravity-Skills

Build a scroll-driven cinematic landing page from a short video. The user provides a 5–15 second video (often AI-generated); this skill extracts every frame at HD JPEG quality, then produces a single-hero HTML page where the user's scroll gesture scrubs the frames in place (the page itself never scrolls) and 5 dramatic text overlays crossfade in/out — Google Anton headlines, Caveat handwritten accents, locked body, virtual scroll. Use this skill whenever the user wants to "turn this video into a landing page", "make a scroll-scrub landing page", "build a parallax hero from this clip", "add a new landing page to the parasites showcase", "do the same as github/lion/hope for this new video", or any variant that pairs a short clip with dramatic scroll-triggered storytelling. Trigger even if the user only says "use my video for a landing page" — that is this skill.

muhammedadnank/Antigravity-Skills

Best practices for Remotion - Video creation in React

muhammedadnank/Antigravity-Skills

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

muhammedadnank/Antigravity-Skills

Turn any video into a cinematic scroll-driven landing page — Apple-style hero where scrolling progresses the visible frame through the video. Use when the user provides a video file and asks for "a landing page from this video", "scroll-frame website", "Apple-style scroll site", "hero that scrubs the video", "like the GitHub Copilot landing", or any equivalent. Extracts N evenly-spaced frames via ffmpeg, builds a self-contained HTML page with a sticky hero + JS scroll listener that swaps the visible frame as you scroll, plus headline, sections and CTA below. For YUV.AI projects, applies the yuv-design-system skill in Neon mode (pink/cyan/white, default for YUV.AI web) — Decks (purple/yellow) is reserved for slides only. For generic / non-YUV.AI projects, picks an appropriate palette per the source video. Output is one folder with `index.html` and a `frames/` directory — drop on any static host.

相關技能