Skip to content

AI video skill for Claude Code & Codex — cinematic, editable product promos with Remotion: 124 shot recipe cards, 150 motion previews, beat sync, sound design, Motion Workbench & JianYing (CapCut CN) export.

feat: full-screen motion-wall landing + category sidebar in library

Wei Yihao6e63005d69d0
diff --git a/gallery/app.js b/gallery/app.js
index 4f6ff3e..411bf9d 100644
--- a/gallery/app.js
+++ b/gallery/app.js
@@ -337,6 +337,7 @@ async function loadLibrary({silent = false} = {}) {
elements.cardCount.textContent = library.stats.cardCount;
elements.styleCount.textContent = library.stats.styleCount;
elements.previewCount.textContent = library.stats.previewCount;
+ renderCategoryCounts();
setSyncStatus('ready', text('synced'));
if (changed) {
render();
@@ -358,6 +359,25 @@ async function loadLibrary({silent = false} = {}) {
}
}
+function renderCategoryCounts() {
+ if (!state.library) return;
+ const counts = {all: state.library.cards.length};
+ state.library.cards.forEach((card) => {
+ counts[card.category] = (counts[card.category] || 0) + 1;
+ });
+ elements.filters.querySelectorAll('[data-filter]').forEach((button) => {
+ const key = button.dataset.filter;
+ if (key === 'missing') return;
+ let badge = button.querySelector('.count');
+ if (!badge) {
+ badge = document.createElement('span');
+ badge.className = 'count';
+ button.append(badge);
+ }
+ badge.textContent = counts[key] ?? 0;
+ });
+}
+
elements.searchInput.addEventListener('input', (event) => {
state.query = event.target.value.trim();
render();
diff --git a/gallery/index.html b/gallery/index.html
index 010686e..fb2d51c 100644
--- a/gallery/index.html
+++ b/gallery/index.html
@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="color-scheme" content="dark light">
+ <meta name="color-scheme" content="dark">
<meta name="google-site-verification" content="Qu8vMAC99goV9xnwf_0ZlGGimtmj24TWFNVUiTz2mhM">
<meta name="description" content="video-shotcraft is an AI agent skill for Claude Code &amp; Codex that makes cinematic product promo videos with Remotion. 106 shot recipe cards organized by function, tuned demos, and a production-ready template.">
<link rel="canonical" href="https://vincentwei1021.github.io/video-shotcraft/">
@@ -37,181 +37,313 @@
"author": {"@type": "Person", "name": "Wei Yihao", "url": "https://github.com/Vincentwei1021"}
}
</script>
- <script>
- try {
- const choice = localStorage.getItem('video-shot-gallery-theme') || 'system';
- const theme = choice === 'system'
- ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
- : choice;
- document.documentElement.dataset.theme = theme;
- document.documentElement.dataset.themeChoice = choice;
- document.documentElement.style.colorScheme = theme;
- } catch {}
- </script>
- <link rel="stylesheet" href="./styles.css">
+ <style>
+ :root {
+ --bg: #0e0e0c;
+ --text: #f0ede5;
+ --muted: #b5b0a5;
+ --line: rgba(240, 237, 229, 0.16);
+ --accent: #d3923c;
+ --accent-ink: #241607;
+ font-family: "Avenir Next", Avenir, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
+ font-synthesis: none;
+ text-rendering: optimizeLegibility;
+ }
+ * { box-sizing: border-box; }
+ html, body { height: 100%; }
+ body {
+ margin: 0;
+ background: var(--bg);
+ color: var(--text);
+ overflow: hidden;
+ }
+ button, a { -webkit-tap-highlight-color: transparent; }
+
+ /* ---- full-screen motion wall ---- */
+ .wall {
+ position: fixed;
+ inset: -2vh -2vw;
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ grid-template-rows: repeat(3, 1fr);
+ gap: 10px;
+ z-index: 0;
+ pointer-events: none;
+ }
+ .wall-tile {
+ position: relative;
+ overflow: hidden;
+ border-radius: 10px;
+ background: #14130f;
+ }
+ .wall-tile video {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ opacity: 0;
+ transition: opacity 900ms ease;
+ }
+ .wall-tile video.is-on { opacity: 1; }
+
+ /* dim + vignette so type stays readable */
+ .scrim {
+ position: fixed;
+ inset: 0;
+ z-index: 1;
+ pointer-events: none;
+ background:
+ radial-gradient(ellipse at center, rgba(14, 14, 12, 0.55) 0%, rgba(14, 14, 12, 0.78) 68%, rgba(14, 14, 12, 0.92) 100%),
+ linear-gradient(180deg, rgba(14, 14, 12, 0.72) 0%, rgba(14, 14, 12, 0.38) 30%, rgba(14, 14, 12, 0.38) 70%, rgba(14, 14, 12, 0.82) 100%);
+ }
+
+ /* ---- top bar ---- */
+ .topbar {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 1.1rem clamp(16px, 3vw, 40px);
+ }
+ .brand {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.6rem;
+ color: var(--text);
+ text-decoration: none;
+ font-weight: 750;
+ letter-spacing: 0.12em;
+ font-size: 0.9rem;
+ }
+ .brand-mark {
+ width: 14px;
+ height: 14px;
+ border-radius: 50%;
+ background: var(--accent);
+ box-shadow: 0 0 14px rgba(211, 146, 60, 0.55);
+ }
+ .language-switch {
+ display: inline-flex;
+ border: 1px solid var(--line);
+ border-radius: 999px;
+ overflow: hidden;
+ backdrop-filter: blur(8px);
+ -webkit-backdrop-filter: blur(8px);
+ background: rgba(14, 14, 12, 0.35);
+ }
+ .language-switch button {
+ border: 0;
+ background: transparent;
+ color: var(--muted);
+ font: inherit;
+ font-size: 0.8rem;
+ padding: 0.38rem 0.85rem;
+ cursor: pointer;
+ }
+ .language-switch button.is-active { color: var(--text); font-weight: 700; background: rgba(240, 237, 229, 0.1); }
+
+ /* ---- hero ---- */
+ .hero {
+ position: relative;
+ z-index: 2;
+ height: 100dvh;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ padding: 0 24px;
+ }
+ .hero-kicker {
+ margin: 0 0 1.3rem;
+ font-size: clamp(0.72rem, 1.1vw, 0.85rem);
+ font-weight: 700;
+ letter-spacing: 0.22em;
+ text-transform: uppercase;
+ color: var(--accent);
+ text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
+ }
+ .hero h1 {
+ margin: 0;
+ font-size: clamp(2.2rem, 5.6vw, 4.2rem);
+ line-height: 1.14;
+ letter-spacing: -0.02em;
+ font-weight: 800;
+ max-width: 21ch;
+ text-shadow: 0 4px 40px rgba(0, 0, 0, 0.9), 0 1px 10px rgba(0, 0, 0, 0.7);
+ }
+ .hero h1 em {
+ font-style: normal;
+ color: var(--accent);
+ }
+ .hero-sub {
+ margin: 1.5rem 0 0;
+ max-width: 56ch;
+ font-size: clamp(0.95rem, 1.5vw, 1.15rem);
+ line-height: 1.7;
+ color: var(--text);
+ opacity: 0.82;
+ text-shadow: 0 2px 20px rgba(0, 0, 0, 0.85);
+ }
+ .hero-actions {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 1rem;
+ margin-top: 2.6rem;
+ }
+ .button-primary,
+ .button-github {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.6rem;
+ padding: 1rem 2.2rem;
+ border-radius: 999px;
+ font-weight: 750;
+ font-size: clamp(1rem, 1.4vw, 1.12rem);
+ text-decoration: none;
+ transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
+ }
+ .button-primary {
+ background: var(--accent);
+ color: var(--accent-ink);
+ box-shadow: 0 10px 38px rgba(211, 146, 60, 0.4);
+ }
+ .button-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(211, 146, 60, 0.55); }
+ .button-github {
+ border: 1px solid rgba(240, 237, 229, 0.35);
+ color: var(--text);
+ background: rgba(14, 14, 12, 0.5);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ }
+ .button-github:hover { transform: translateY(-2px); background: rgba(240, 237, 229, 0.12); }
+ .button-github svg { width: 20px; height: 20px; fill: currentColor; }
+ .star-glyph { color: var(--accent); }
+
+ .hero-stats {
+ display: flex;
+ gap: clamp(1.4rem, 4vw, 3rem);
+ margin: 3rem 0 0;
+ padding: 0;
+ list-style: none;
+ font-size: 0.85rem;
+ color: var(--muted);
+ text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
+ }
+ .hero-stats strong {
+ display: block;
+ font-size: clamp(1.3rem, 2.4vw, 1.8rem);
+ font-weight: 800;
+ color: var(--text);
+ font-variant-numeric: tabular-nums;
+ letter-spacing: -0.02em;
+ }
+
+ .hero-foot {
+ position: fixed;
+ bottom: 1.1rem;
+ left: 0;
+ right: 0;
+ z-index: 2;
+ text-align: center;
+ font-size: 0.72rem;
+ letter-spacing: 0.08em;
+ color: rgba(181, 176, 165, 0.7);
+ }
+ .hero-foot a { color: inherit; text-decoration: none; }
+ .hero-foot a:hover { color: var(--text); }
+
+ @media (max-width: 900px) {
+ .wall { grid-template-columns: repeat(3, 1fr); }
+ }
+ @media (max-width: 620px) {
+ .wall { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
+ .hero-actions { flex-direction: column; width: 100%; max-width: 340px; }
+ .button-primary, .button-github { justify-content: center; }
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .wall-tile video { transition: none; }
+ }
+ </style>
</head>
-<body class="landing">
+<body>
+ <div class="wall" id="wall" aria-hidden="true"></div>
+ <div class="scrim" aria-hidden="true"></div>
+
<header class="topbar">
<a class="brand" href="./" aria-label="video-shotcraft home">
<span class="brand-mark" aria-hidden="true"></span>
<span>VIDEO SHOTCRAFT</span>
</a>
- <div class="topbar-actions">
- <div class="theme-switch" id="themeSwitch" role="group" aria-label="Page theme">
- <button type="button" data-theme="system" aria-pressed="true">Auto</button>
- <button type="button" data-theme="light" aria-pressed="false">Light</button>
- <button type="button" data-theme="dark" aria-pressed="false">Dark</button>
- </div>
- <div class="language-switch" id="languageSwitch" role="group" aria-label="Language">
- <button type="button" data-language="zh" aria-pressed="false">中文</button>
- <button type="button" data-language="en" aria-pressed="true">EN</button>
- </div>
- <a class="topbar-github" href="https://github.com/Vincentwei1021/video-shotcraft" target="_blank" rel="noreferrer">GitHub</a>
+ <div class="language-switch" id="languageSwitch" role="group" aria-label="Language">
+ <button type="button" data-language="zh" aria-pressed="false">中文</button>
+ <button type="button" data-language="en" aria-pressed="true">EN</button>
</div>
</header>
- <main>
- <section class="hero" aria-labelledby="heroTitle">
- <p class="hero-kicker" data-l10n="kicker">An agent skill for Claude Code &amp; Codex</p>
- <h1 id="heroTitle" data-l10n="heroTitle">Cinematic product videos,<br>crafted by your agent.</h1>
- <p class="hero-sub" data-l10n="heroSub">Hand your product to Claude Code or Codex — video-shotcraft turns it into a motion studio: storyboarding, Remotion animation, 2.5D camera work over real page screenshots, beat-synced pacing, and film-grade sound design.</p>
- <div class="hero-actions">
- <a class="button-primary" href="./library.html" data-l10n="ctaLibrary">Browse the shot library</a>
- <a class="button-secondary" href="https://github.com/Vincentwei1021/video-shotcraft#readme" target="_blank" rel="noreferrer" data-l10n="ctaReadme">Read the docs</a>
- </div>
- <dl class="hero-stats" aria-label="Library statistics">
- <div><dt data-l10n="statCards">Shot recipe cards</dt><dd id="statCards">106</dd></div>
- <div><dt data-l10n="statStyles">Styles</dt><dd id="statStyles">164</dd></div>
- <div><dt data-l10n="statSamples">Motion previews</dt><dd id="statSamples">163</dd></div>
- <div><dt data-l10n="statTemplate">Ready-made template</dt><dd>36.2s</dd></div>
- </dl>
- </section>
-
- <section class="showcase" aria-labelledby="showcaseTitle">
- <h2 id="showcaseTitle" data-l10n="showcaseTitle">Made with this skill</h2>
- <p class="section-sub" data-l10n="showcaseSub">This 38-second introduction film was produced end-to-end by an agent using the library's own methodology — storyboard, shot implementation, and sound design included.</p>
- <div class="showcase-frame">
- <iframe src="https://www.youtube-nocookie.com/embed/gcVvRM_P3SM" title="video-shotcraft showcase" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
- </div>
- </section>
-
- <section class="categories" aria-labelledby="categoriesTitle">
- <h2 id="categoriesTitle" data-l10n="categoriesTitle">A shot for every job</h2>
- <p class="section-sub" data-l10n="categoriesSub">Every recipe card is filed by function, so you (and your agent) can go straight to the kind of motion the scene needs.</p>
- <div class="category-grid" id="categoryGrid"></div>
- </section>
-
- <section class="how" aria-labelledby="howTitle">
- <h2 id="howTitle" data-l10n="howTitle">How it works</h2>
- <ol class="how-steps">
- <li>
- <h3 data-l10n="step1Title">Install the skill</h3>
- <p data-l10n="step1Body">Tell your agent to install it, or run <code>npx skills add Vincentwei1021/video-shotcraft</code>.</p>
- </li>
- <li>
- <h3 data-l10n="step2Title">Pick your shots</h3>
- <p data-l10n="step2Body">Browse the library, select the cards you like, and copy their names — or let the agent pick along the energy curve.</p>
- </li>
- <li>
- <h3 data-l10n="step3Title">Ask for the video</h3>
- <p data-l10n="step3Body">"Make a promo for my product with video-shotcraft." The agent handles screenshots, animation, pacing, and SFX.</p>
- </li>
- </ol>
- <div class="install-block">
- <code id="installCommand">帮我安装这个 skill:https://github.com/Vincentwei1021/video-shotcraft</code>
- <button type="button" id="copyInstall" data-l10n="copy">Copy</button>
- </div>
- </section>
+ <main class="hero">
+ <p class="hero-kicker" data-l10n="kicker">An agent skill for Claude Code &amp; Codex</p>
+ <h1 data-l10n="heroTitle">106 cinematic shot recipes.<br><em>One prompt</em> to a finished promo.</h1>
+ <p class="hero-sub" data-l10n="heroSub">Every motion you see behind this page is a tuned, ready-to-use shot recipe card — your agent picks the shots, animates real product screenshots with Remotion, syncs the beats, and delivers the film.</p>
+ <div class="hero-actions">
+ <a class="button-primary" href="./library.html" data-l10n="ctaLibrary">Browse all motions</a>
+ <a class="button-github" href="https://github.com/Vincentwei1021/video-shotcraft" target="_blank" rel="noreferrer">
+ <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.42 7.42 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>
+ <span data-l10n="ctaStar">Star on GitHub</span>
+ <span class="star-glyph" aria-hidden="true">★</span>
+ </a>
+ </div>
+ <ul class="hero-stats" aria-label="Library statistics">
+ <li><strong id="statCards">106</strong><span data-l10n="statCards">recipe cards</span></li>
+ <li><strong id="statStyles">162</strong><span data-l10n="statStyles">styles</span></li>
+ <li><strong id="statSamples">161</strong><span data-l10n="statSamples">motion previews</span></li>
+ <li><strong>36.2s</strong><span data-l10n="statTemplate">ready template</span></li>
+ </ul>
</main>
- <footer class="landing-footer">
- <span data-l10n="footerLicense">Apache-2.0 · Built with Remotion</span>
- <a href="https://github.com/Vincentwei1021/video-shotcraft" target="_blank" rel="noreferrer">github.com/Vincentwei1021/video-shotcraft</a>
+ <footer class="hero-foot">
+ <span data-l10n="footer">Apache-2.0 · Built with Remotion · </span><a href="https://github.com/Vincentwei1021/video-shotcraft" target="_blank" rel="noreferrer">github.com/Vincentwei1021/video-shotcraft</a>
</footer>
- <div class="toast" id="toast" role="status" aria-live="polite"></div>
-
<script>
const L10N = {
en: {
kicker: 'An agent skill for Claude Code & Codex',
- heroTitle: 'Cinematic product videos,<br>crafted by your agent.',
- heroSub: 'Hand your product to Claude Code or Codex — video-shotcraft turns it into a motion studio: storyboarding, Remotion animation, 2.5D camera work over real page screenshots, beat-synced pacing, and film-grade sound design.',
- ctaLibrary: 'Browse the shot library',
- ctaReadme: 'Read the docs',
- statCards: 'Shot recipe cards',
- statStyles: 'Styles',
- statSamples: 'Motion previews',
- statTemplate: 'Ready-made template',
- showcaseTitle: 'Made with this skill',
- showcaseSub: "This 38-second introduction film was produced end-to-end by an agent using the library's own methodology — storyboard, shot implementation, and sound design included.",
- categoriesTitle: 'A shot for every job',
- categoriesSub: 'Every recipe card is filed by function, so you (and your agent) can go straight to the kind of motion the scene needs.',
- howTitle: 'How it works',
- step1Title: 'Install the skill',
- step1Body: 'Tell your agent to install it, or run <code>npx skills add Vincentwei1021/video-shotcraft</code>.',
- step2Title: 'Pick your shots',
- step2Body: 'Browse the library, select the cards you like, and copy their names — or let the agent pick along the energy curve.',
- step3Title: 'Ask for the video',
- step3Body: '"Make a promo for my product with video-shotcraft." The agent handles screenshots, animation, pacing, and SFX.',
- copy: 'Copy',
- copied: 'Copied',
- footerLicense: 'Apache-2.0 · Built with Remotion',
- installCommand: 'Install this skill for me: https://github.com/Vincentwei1021/video-shotcraft',
- cardsUnit: 'cards',
+ heroTitle: '106 cinematic shot recipes.<br><em>One prompt</em> to a finished promo.',
+ heroSub: 'Every motion you see behind this page is a tuned, ready-to-use shot recipe card — your agent picks the shots, animates real product screenshots with Remotion, syncs the beats, and delivers the film.',
+ ctaLibrary: 'Browse all motions',
+ ctaStar: 'Star on GitHub',
+ statCards: 'recipe cards',
+ statStyles: 'styles',
+ statSamples: 'motion previews',
+ statTemplate: 'ready template',
+ footer: 'Apache-2.0 · Built with Remotion · ',
},
zh: {
kicker: '一个 Claude Code / Codex 的 agent skill',
- heroTitle: '电影感产品视频,<br>交给你的 agent 制作。',
- heroSub: '把你的产品交给 Claude Code 或 Codex —— video-shotcraft 会把它变成一间动效工作室:分镜、Remotion 动画、真实页面截图上的 2.5D 运镜、节奏卡点和电影级声音设计。',
- ctaLibrary: '浏览镜头库',
- ctaReadme: '阅读文档',
+ heroTitle: '106 张镜头配方卡,<br>宣传片<em>一句话直出</em>。',
+ heroSub: '你身后滚动的每一个动效,都是一张调校好、即取即用的镜头配方卡——agent 负责选镜头、用 Remotion 给真实产品截图做动画、卡上节奏,交付成片。',
+ ctaLibrary: '浏览全部动效',
+ ctaStar: '去 GitHub 点星',
statCards: '镜头配方卡',
statStyles: '式',
statSamples: '动态样片',
statTemplate: '现成模板',
- showcaseTitle: '用这个 skill 做的',
- showcaseSub: '这支 38 秒介绍片从分镜、镜头实现到声音设计,全部由 agent 按库内方法论完成。',
- categoriesTitle: '每种场景都有对应的镜头',
- categoriesSub: '所有配方卡按功能归档——你和你的 agent 都能直奔某一类动效。',
- howTitle: '怎么用',
- step1Title: '安装 skill',
- step1Body: '让你的 agent 安装它,或运行 <code>npx skills add Vincentwei1021/video-shotcraft</code>。',
- step2Title: '挑选镜头',
- step2Body: '在镜头库里浏览、多选并复制卡名——也可以让 agent 按能量曲线自动选。',
- step3Title: '提出需求',
- step3Body: '“用 video-shotcraft 给我的产品做一支宣传片。” 截图、动画、节奏和音效都由 agent 完成。',
- copy: '复制',
- copied: '已复制',
- footerLicense: 'Apache-2.0 · 基于 Remotion 构建',
- installCommand: '帮我安装这个 skill:https://github.com/Vincentwei1021/video-shotcraft',
- cardsUnit: '张',
+ footer: 'Apache-2.0 · 基于 Remotion 构建 · ',
},
};
- const CATEGORY_ORDER = [
- 'opening', 'typography', 'ui-entrance', 'camera', 'data',
- 'interaction', 'transition', 'rhythm', 'effects', 'outro',
- ];
- const CATEGORY_META = {
- opening: {icon: '◐'}, typography: {icon: 'Aa'}, 'ui-entrance': {icon: '▤'},
- camera: {icon: '⌖'}, data: {icon: '▁▄▇'}, interaction: {icon: '✦'},
- transition: {icon: '⇄'}, rhythm: {icon: '♩'}, effects: {icon: '☀'}, outro: {icon: '◼'},
- };
-
const state = {
language: (() => {
try { return localStorage.getItem('video-shot-gallery-language') === 'zh' ? 'zh' : 'en'; } catch { return 'en'; }
})(),
- theme: (() => {
- try {
- const value = localStorage.getItem('video-shot-gallery-theme');
- return ['system', 'light', 'dark'].includes(value) ? value : 'system';
- } catch { return 'system'; }
- })(),
- library: null,
};
-
const t = (key) => L10N[state.language][key] || L10N.en[key] || key;
function applyLanguage() {
@@ -219,47 +351,11 @@
document.querySelectorAll('[data-l10n]').forEach((node) => {
node.innerHTML = t(node.dataset.l10n);
});
- document.querySelector('#installCommand').textContent = t('installCommand');
document.querySelectorAll('#languageSwitch [data-language]').forEach((button) => {
const active = button.dataset.language === state.language;
button.classList.toggle('is-active', active);
button.setAttribute('aria-pressed', String(active));
});
- renderCategories();
- }
-
- function applyTheme() {
- const resolved = state.theme === 'system'
- ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
- : state.theme;
- document.documentElement.dataset.theme = resolved;
- document.documentElement.dataset.themeChoice = state.theme;
- document.documentElement.style.colorScheme = resolved;
- document.querySelectorAll('#themeSwitch [data-theme]').forEach((button) => {
- const active = button.dataset.theme === state.theme;
- button.classList.toggle('is-active', active);
- button.setAttribute('aria-pressed', String(active));
- });
- }
-
- function renderCategories() {
- const grid = document.querySelector('#categoryGrid');
- if (!state.library) { grid.innerHTML = ''; return; }
- const counts = {};
- state.library.cards.forEach((card) => {
- counts[card.category] = (counts[card.category] || 0) + 1;
- });
- grid.innerHTML = CATEGORY_ORDER.map((key) => {
- const labels = state.library.categories?.[key] || {};
- const label = labels[state.language] || labels.en || key;
- const count = counts[key] || 0;
- return `
- <a class="category-tile" href="./library.html?cat=${key}">
- <span class="category-icon" aria-hidden="true">${CATEGORY_META[key].icon}</span>
- <strong>${label}</strong>
- <span class="category-count">${count} ${t('cardsUnit')}</span>
- </a>`;
- }).join('');
}
document.querySelector('#languageSwitch').addEventListener('click', (event) => {
@@ -270,41 +366,82 @@
applyLanguage();
});
- document.querySelector('#themeSwitch').addEventListener('click', (event) => {
- const button = event.target.closest('[data-theme]');
- if (!button || button.dataset.theme === state.theme) return;
- state.theme = button.dataset.theme;
- try { localStorage.setItem('video-shot-gallery-theme', state.theme); } catch {}
- applyTheme();
- });
+ /* ---- random motion wall ---- */
+ const wall = document.querySelector('#wall');
+ const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
+ const TILES = window.matchMedia('(max-width: 620px)').matches ? 8 : 12;
+ let pool = [];
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
- if (state.theme === 'system') applyTheme();
- });
+ const shuffle = (list) => {
+ for (let i = list.length - 1; i > 0; i -= 1) {
+ const j = Math.floor(Math.random() * (i + 1));
+ [list[i], list[j]] = [list[j], list[i]];
+ }
+ return list;
+ };
- document.querySelector('#copyInstall').addEventListener('click', async () => {
- const value = document.querySelector('#installCommand').textContent;
- const toast = document.querySelector('#toast');
- try {
- await navigator.clipboard.writeText(value);
- toast.textContent = `${t('copied')}: ${value.slice(0, 48)}…`;
- toast.classList.add('is-visible');
- setTimeout(() => toast.classList.remove('is-visible'), 2200);
- } catch {}
- });
+ function mountVideo(tile, url) {
+ const video = document.createElement('video');
+ video.muted = true;
+ video.loop = true;
+ video.playsInline = true;
+ video.preload = 'auto';
+ video.src = url;
+ tile.append(video);
+ const start = () => {
+ video.classList.add('is-on');
+ if (!reduceMotion) video.play().catch(() => {});
+ };
+ if (video.readyState >= 2) start();
+ else video.addEventListener('loadeddata', start, {once: true});
+ return video;
+ }
+
+ function swapTile(tile) {
+ if (!pool.length) return;
+ const url = pool.shift();
+ pool.push(url);
+ const old = tile.querySelectorAll('video');
+ const fresh = mountVideo(tile, url);
+ fresh.addEventListener('loadeddata', () => {
+ old.forEach((v) => {
+ v.classList.remove('is-on');
+ setTimeout(() => v.remove(), 1000);
+ });
+ }, {once: true});
+ }
fetch('./api/library.json', {cache: 'no-store'})
.then((response) => response.json())
.then((library) => {
- state.library = library;
document.querySelector('#statCards').textContent = library.stats.cardCount;
document.querySelector('#statStyles').textContent = library.stats.styleCount;
document.querySelector('#statSamples').textContent = library.stats.previewCount;
- renderCategories();
+
+ pool = shuffle(library.cards
+ .flatMap((card) => card.styles)
+ .filter((style) => style.media && style.media.type === 'mp4')
+ .map((style) => style.media.url));
+ if (!pool.length) return;
+
+ for (let i = 0; i < TILES; i += 1) {
+ const tile = document.createElement('div');
+ tile.className = 'wall-tile';
+ wall.append(tile);
+ }
+ const tiles = [...wall.children];
+ // stagger initial mounts so the page doesn't fire 12 requests at once
+ tiles.forEach((tile, index) => {
+ setTimeout(() => swapTile(tile), index * 260);
+ });
+ if (!reduceMotion) {
+ setInterval(() => {
+ swapTile(tiles[Math.floor(Math.random() * tiles.length)]);
+ }, 3200);
+ }
})
.catch(() => {});
- applyTheme();
applyLanguage();
</script>
</body>
diff --git a/gallery/library.html b/gallery/library.html
index b37241b..03953c8 100644
--- a/gallery/library.html
+++ b/gallery/library.html
@@ -76,44 +76,49 @@
</div>
</header>
- <main>
- <section class="intro" aria-labelledby="pageTitle">
- <div class="intro-copy">
- <h1 id="pageTitle">Shot Recipes &amp; Motion Samples</h1>
- <p class="intro-description" data-i18n="intro">video-shotcraft is an AI agent skill for Claude Code and Codex that makes cinematic product promo videos with Remotion. Browse production shot recipes and switch between their motion samples.</p>
- </div>
+ <main class="library-layout">
+ <aside class="sidebar" aria-label="Categories">
+ <p class="sidebar-heading" data-i18n="categoriesHeading">Categories</p>
+ <nav class="category-nav" id="filters" data-i18n-aria-label="filtersLabel" aria-label="Filter by category">
+ <button class="category-link is-active" type="button" data-filter="all"><span data-i18n="all">All shots</span></button>
+ <button class="category-link" type="button" data-filter="opening"><span data-i18n="catOpening">Opening &amp; Brand</span></button>
+ <button class="category-link" type="button" data-filter="typography"><span data-i18n="catTypography">Typography</span></button>
+ <button class="category-link" type="button" data-filter="ui-entrance"><span data-i18n="catUiEntrance">UI Entrance</span></button>
+ <button class="category-link" type="button" data-filter="camera"><span data-i18n="catCamera">Camera</span></button>
+ <button class="category-link" type="button" data-filter="data"><span data-i18n="catData">Data</span></button>
+ <button class="category-link" type="button" data-filter="interaction"><span data-i18n="catInteraction">Interaction</span></button>
+ <button class="category-link" type="button" data-filter="transition"><span data-i18n="catTransition">Transitions</span></button>
+ <button class="category-link" type="button" data-filter="rhythm"><span data-i18n="catRhythm">Rhythm</span></button>
+ <button class="category-link" type="button" data-filter="effects"><span data-i18n="catEffects">Light &amp; Emphasis</span></button>
+ <button class="category-link" type="button" data-filter="outro"><span data-i18n="catOutro">Outro</span></button>
+ <button class="category-link" type="button" data-filter="missing"><span data-i18n="missing">Missing</span></button>
+ </nav>
+ </aside>
- <dl class="stats" aria-label="Shot library statistics" data-i18n-aria-label="statsLabel">
- <div><dt data-i18n="cards">Cards</dt><dd id="cardCount">106</dd></div>
- <div><dt data-i18n="styles">Styles</dt><dd id="styleCount">162</dd></div>
- <div><dt data-i18n="samples">Samples</dt><dd id="previewCount">161</dd></div>
- </dl>
- </section>
+ <div class="library-main">
+ <section class="intro" aria-labelledby="pageTitle">
+ <div class="intro-copy">
+ <h1 id="pageTitle">Shot Recipes &amp; Motion Samples</h1>
+ <p class="intro-description" data-i18n="intro">video-shotcraft is an AI agent skill for Claude Code and Codex that makes cinematic product promo videos with Remotion. Browse production shot recipes and switch between their motion samples.</p>
+ </div>
- <section class="controls" aria-label="Filter shots" data-i18n-aria-label="controlsLabel">
- <label class="search-field" for="searchInput">
- <span class="search-icon" aria-hidden="true"></span>
- <span class="sr-only" data-i18n="searchLabel">Search shot cards</span>
- <input id="searchInput" type="search" autocomplete="off" placeholder="Search names, use cases, and styles…">
- <kbd>⌘ K</kbd>
- </label>
- <div class="filter-row" id="filters" role="group" aria-label="Filter by category" data-i18n-aria-label="filtersLabel">
- <button class="filter-button is-active" type="button" data-filter="all" data-i18n="all">All</button>
- <button class="filter-button" type="button" data-filter="opening" data-i18n="catOpening">Opening &amp; Brand</button>
- <button class="filter-button" type="button" data-filter="typography" data-i18n="catTypography">Typography</button>
- <button class="filter-button" type="button" data-filter="ui-entrance" data-i18n="catUiEntrance">UI Entrance</button>
- <button class="filter-button" type="button" data-filter="camera" data-i18n="catCamera">Camera</button>
- <button class="filter-button" type="button" data-filter="data" data-i18n="catData">Data</button>
- <button class="filter-button" type="button" data-filter="interaction" data-i18n="catInteraction">Interaction</button>
- <button class="filter-button" type="button" data-filter="transition" data-i18n="catTransition">Transitions</button>
- <button class="filter-button" type="button" data-filter="rhythm" data-i18n="catRhythm">Rhythm</button>
- <button class="filter-button" type="button" data-filter="effects" data-i18n="catEffects">Light &amp; Emphasis</button>
- <button class="filter-button" type="button" data-filter="outro" data-i18n="catOutro">Outro</button>
- <button class="filter-button" type="button" data-filter="missing" data-i18n="missing">Missing</button>
- </div>
- </section>
+ <dl class="stats" aria-label="Shot library statistics" data-i18n-aria-label="statsLabel">
+ <div><dt data-i18n="cards">Cards</dt><dd id="cardCount">106</dd></div>
+ <div><dt data-i18n="styles">Styles</dt><dd id="styleCount">162</dd></div>
+ <div><dt data-i18n="samples">Samples</dt><dd id="previewCount">161</dd></div>
+ </dl>
+ </section>
- <section class="library" id="library" aria-live="polite" aria-busy="true">
+ <section class="controls" aria-label="Filter shots" data-i18n-aria-label="controlsLabel">
+ <label class="search-field" for="searchInput">
+ <span class="search-icon" aria-hidden="true"></span>
+ <span class="sr-only" data-i18n="searchLabel">Search shot cards</span>
+ <input id="searchInput" type="search" autocomplete="off" placeholder="Search names, use cases, and styles…">
+ <kbd>⌘ K</kbd>
+ </label>
+ </section>
+
+ <section class="library" id="library" aria-live="polite" aria-busy="true">
<!-- seo:cards:start -->
<article class="shot-card" id="ai-stream-response">
<h2>ai-stream-response</h2>
@@ -646,12 +651,13 @@
<p>Styles: word-relay-filmstrip</p>
</article>
<!-- seo:cards:end -->
- </section>
+ </section>
- <section class="empty-state" id="emptyState" hidden>
- <p data-i18n="empty">No shots match the current filters.</p>
- <button type="button" id="clearFilters" data-i18n="clear">Clear filters</button>
- </section>
+ <section class="empty-state" id="emptyState" hidden>
+ <p data-i18n="empty">No shots match the current filters.</p>
+ <button type="button" id="clearFilters" data-i18n="clear">Clear filters</button>
+ </section>
+ </div>
</main>
<template id="loadingTemplate">
diff --git a/gallery/styles.css b/gallery/styles.css
index 45783da..daeb87a 100644
--- a/gallery/styles.css
+++ b/gallery/styles.css
@@ -174,6 +174,66 @@ main {
padding-bottom: 6rem;
}
+/* ---------- library layout: category sidebar + content ---------- */
+
+.library-layout {
+ display: grid;
+ grid-template-columns: 220px minmax(0, 1fr);
+ gap: 2.5rem;
+ align-items: start;
+}
+
+.sidebar {
+ position: sticky;
+ top: 90px;
+ padding-top: 3.5rem;
+}
+
+.sidebar-heading {
+ margin: 0 0 0.9rem;
+ padding-left: 1rem;
+ font-size: 0.68rem;
+ font-weight: 700;
+ letter-spacing: 0.16em;
+ text-transform: uppercase;
+ color: var(--faint);
+}
+
+.category-nav {
+ display: flex;
+ flex-direction: column;
+ gap: 0.15rem;
+}
+
+.category-link {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.6rem;
+ padding: 0.6rem 1rem;
+ border: 0;
+ border-radius: 999px;
+ background: transparent;
+ color: var(--muted);
+ font-size: 0.88rem;
+ text-align: left;
+ cursor: pointer;
+ transition: color 140ms ease, background 140ms ease;
+}
+.category-link:hover { color: var(--text); background: var(--surface-soft); }
+.category-link.is-active {
+ color: var(--bg);
+ background: var(--text);
+ font-weight: 700;
+}
+.category-link .count {
+ font-size: 0.72rem;
+ font-variant-numeric: tabular-nums;
+ opacity: 0.55;
+}
+
+.library-main { min-width: 0; }
+
.intro {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
@@ -216,7 +276,7 @@ h1 {
top: 70px;
z-index: 8;
display: grid;
- grid-template-columns: minmax(260px, 1fr) auto;
+ grid-template-columns: minmax(0, 1fr);
gap: 0.75rem;
align-items: center;
margin-bottom: 1.25rem;
@@ -639,272 +699,38 @@ kbd { padding: 0.2rem 0.34rem; border: 1px solid var(--line); border-radius: 5px
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.75); } }
@keyframes shimmer { to { background-position-x: -220%; } }
-/* ---------- Landing page ---------- */
-
-.landing main {
- display: block;
-}
-
-.topbar-github {
- font-size: 0.86rem;
- font-weight: 600;
- text-decoration: none;
- color: var(--muted);
- border: 1px solid var(--line);
- border-radius: 999px;
- padding: 0.34rem 0.85rem;
- transition: color 140ms ease, border-color 140ms ease;
-}
-.topbar-github:hover { color: var(--text); border-color: var(--accent); }
-
-.hero {
- padding: 4.5rem 0 3rem;
- max-width: 880px;
-}
-
-.hero-kicker {
- margin: 0 0 1rem;
- font-size: 0.85rem;
- font-weight: 700;
- letter-spacing: 0.14em;
- text-transform: uppercase;
- color: var(--accent);
-}
-
-.hero h1 {
- margin: 0;
- font-size: clamp(2.3rem, 5.4vw, 3.6rem);
- line-height: 1.12;
- letter-spacing: -0.025em;
-}
-
-.hero-sub {
- margin: 1.4rem 0 0;
- max-width: 640px;
- font-size: 1.06rem;
- line-height: 1.65;
- color: var(--muted);
-}
-
-.hero-actions {
- display: flex;
- flex-wrap: wrap;
- gap: 0.8rem;
- margin-top: 2rem;
-}
-
-.button-primary,
-.button-secondary {
- display: inline-flex;
- align-items: center;
- padding: 0.72rem 1.5rem;
- border-radius: 999px;
- font-weight: 700;
- font-size: 0.98rem;
- text-decoration: none;
- transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
-}
-
-.button-primary {
- background: var(--accent);
- color: var(--accent-contrast);
- box-shadow: 0 6px 20px var(--accent-soft);
-}
-.button-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px var(--accent-soft); }
-
-.button-secondary {
- border: 1px solid var(--line);
- color: var(--text);
- background: var(--surface);
-}
-.button-secondary:hover { border-color: var(--accent); }
-
-.hero-stats {
- display: flex;
- flex-wrap: wrap;
- gap: 2.4rem;
- margin: 2.8rem 0 0;
- padding: 0;
-}
-.hero-stats div { display: flex; flex-direction: column-reverse; gap: 0.25rem; }
-.hero-stats dd {
- margin: 0;
- font-size: 1.9rem;
- font-weight: 750;
- font-variant-numeric: tabular-nums;
- letter-spacing: -0.02em;
-}
-.hero-stats dt { font-size: 0.85rem; color: var(--muted); }
-
-.showcase,
-.categories,
-.how {
- padding: 2.6rem 0;
- border-top: 1px solid var(--line);
-}
-
-.showcase h2,
-.categories h2,
-.how h2 {
- margin: 0;
- font-size: 1.65rem;
- letter-spacing: -0.02em;
-}
-
-.section-sub {
- margin: 0.6rem 0 1.8rem;
- max-width: 620px;
- color: var(--muted);
- line-height: 1.6;
-}
-
-.showcase-frame {
- position: relative;
- aspect-ratio: 16 / 9;
- max-width: 960px;
- border-radius: var(--radius);
- overflow: hidden;
- border: 1px solid var(--line);
- background: var(--preview-bg);
- box-shadow: var(--shadow);
-}
-.showcase-frame iframe {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- border: 0;
-}
-
-.category-grid {
- display: grid;
- grid-template-columns: repeat(5, minmax(0, 1fr));
- gap: 0.9rem;
-}
-
-.category-tile {
- display: flex;
- flex-direction: column;
- gap: 0.4rem;
- padding: 1.1rem 1.2rem;
- border: 1px solid var(--line);
- border-radius: var(--radius);
- background: var(--surface);
- text-decoration: none;
- transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
-}
-.category-tile:hover {
- border-color: var(--accent);
- transform: translateY(-2px);
- box-shadow: var(--shadow);
-}
-.category-icon {
- font-size: 1.15rem;
- color: var(--accent);
- line-height: 1;
-}
-.category-tile strong { font-size: 0.98rem; letter-spacing: -0.01em; }
-.category-count { font-size: 0.82rem; color: var(--faint); font-variant-numeric: tabular-nums; }
-.how-steps {
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 1rem;
- margin: 0;
- padding: 0;
- list-style: none;
- counter-reset: step;
-}
-.how-steps li {
- counter-increment: step;
- border: 1px solid var(--line);
- border-radius: var(--radius);
- background: var(--surface);
- padding: 1.2rem 1.3rem;
-}
-.how-steps li::before {
- content: counter(step, decimal-leading-zero);
- display: block;
- font-size: 0.8rem;
- font-weight: 700;
- color: var(--accent);
- letter-spacing: 0.1em;
- margin-bottom: 0.6rem;
-}
-.how-steps h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }
-.how-steps p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 0.93rem; }
-.how-steps code,
-.install-block code {
- font-family: "SFMono-Regular", Consolas, monospace;
- font-size: 0.85em;
- background: var(--surface-soft);
- border-radius: 6px;
- padding: 0.1em 0.4em;
-}
-
-.install-block {
- display: flex;
- align-items: center;
- gap: 0.9rem;
- margin-top: 1.4rem;
- padding: 0.9rem 1.1rem;
- border: 1px dashed var(--line);
- border-radius: var(--radius);
- background: var(--surface-soft);
-}
-.install-block code {
- flex: 1;
- background: none;
- padding: 0;
- overflow-x: auto;
- white-space: nowrap;
-}
-.install-block button {
- border: 1px solid var(--line);
- background: var(--surface);
- color: var(--text);
- border-radius: 999px;
- padding: 0.4rem 1rem;
- font-weight: 600;
- cursor: pointer;
-}
-.install-block button:hover { border-color: var(--accent); }
-
-.landing-footer {
- width: min(100% - 48px, 1560px);
- margin: 0 auto;
- padding: 2rem 0 2.6rem;
- border-top: 1px solid var(--line);
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- gap: 0.6rem;
- color: var(--faint);
- font-size: 0.88rem;
+@media (max-width: 1400px) {
+ .library { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
-.landing-footer a { color: var(--muted); text-decoration: none; }
-.landing-footer a:hover { color: var(--text); }
@media (max-width: 1100px) {
- .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
-}
-
-@media (max-width: 760px) {
- .hero { padding-top: 3rem; }
- .hero-stats { gap: 1.6rem; }
- .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
- .how-steps { grid-template-columns: 1fr; }
- .install-block { flex-direction: column; align-items: stretch; }
-}
-
-@media (max-width: 1240px) {
- .library { grid-template-columns: repeat(3, minmax(0, 1fr)); }
+ .library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
- .intro { grid-template-columns: 1fr; gap: 1.5rem; }
+ .library-layout { grid-template-columns: 1fr; gap: 0; }
+ .sidebar {
+ position: sticky;
+ top: 58px;
+ z-index: 9;
+ padding: 0.6rem 0;
+ background: var(--bg-translucent);
+ backdrop-filter: blur(14px);
+ -webkit-backdrop-filter: blur(14px);
+ }
+ .sidebar-heading { display: none; }
+ .category-nav {
+ flex-direction: row;
+ overflow-x: auto;
+ scrollbar-width: none;
+ gap: 0.25rem;
+ }
+ .category-nav::-webkit-scrollbar { display: none; }
+ .category-link { flex-shrink: 0; padding: 0.5rem 0.85rem; font-size: 0.8rem; }
+ .intro { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.5rem; }
.stats { width: fit-content; }
- .controls { grid-template-columns: 1fr; }
+ .controls { top: 116px; }
.library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@@ -914,10 +740,10 @@ kbd { padding: 0.2rem 0.34rem; border: 1px solid var(--line); border-radius: 5px
.topbar-actions { gap: 0.55rem; }
.theme-switch button { padding-inline: 0.42rem; }
.sync-status span:last-child { display: none; }
- .intro { padding: 2.5rem 0 1.5rem; }
+ .intro { padding: 1.5rem 0 1.5rem; }
h1 { font-size: 2.15rem; }
.stats { width: 100%; justify-content: space-between; }
- .controls { top: 66px; }
+ .controls { top: 112px; }
kbd { display: none; }
.library { grid-template-columns: 1fr; }
.card-body { min-height: 232px; }
diff --git a/gallery/translations.js b/gallery/translations.js
index dc15340..5c2398b 100644
--- a/gallery/translations.js
+++ b/gallery/translations.js
@@ -10,7 +10,8 @@ window.GALLERY_I18N = {
samples: '有样片',
searchLabel: '搜索镜头卡',
searchPlaceholder: '搜索中文名、英文名、用途、式…',
- all: '全部',
+ all: '全部镜头',
+ categoriesHeading: '分类',
high: '高能量',
medium: '中能量',
low: '低能量',
@@ -69,7 +70,8 @@ window.GALLERY_I18N = {
samples: 'Samples',
searchLabel: 'Search shot cards',
searchPlaceholder: 'Search names, use cases, and styles…',
- all: 'All',
+ all: 'All shots',
+ categoriesHeading: 'Categories',
high: 'High energy',
medium: 'Medium',
low: 'Low energy',