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.
TypeScript agent-skillsai-agentsai-videoclaude-codeclaude-code-skillsclaude-skillscodexmotion-designmotion-graphicsproduct-videopromo-videoremotionvideo-generationvideo-production
polish(gallery): 侧栏关注区改分隔线面板,顶栏主题/语言改双胶囊单键切换 (#57)
Yihao63bce76a6aaa
diff --git a/gallery/app.js b/gallery/app.jsindex 4a3db0e..a1d34e6 100644--- a/gallery/app.js+++ b/gallery/app.js@@ -45,13 +45,15 @@ const elements = {clearFilters: document.querySelector('#clearFilters'),emptyState: document.querySelector('#emptyState'),filters: document.querySelector('#filters'),- languageSwitch: document.querySelector('#languageSwitch'),+ languageToggle: document.querySelector('#languageToggle'),+ languageToggleLabel: document.querySelector('#languageToggleLabel'),library: document.querySelector('#library'),pageTitle: document.querySelector('#pageTitle'),previewCount: document.querySelector('#previewCount'),searchInput: document.querySelector('#searchInput'),styleCount: document.querySelector('#styleCount'),- themeSwitch: document.querySelector('#themeSwitch'),+ themeToggle: document.querySelector('#themeToggle'),+ themeToggleLabel: document.querySelector('#themeToggleLabel'),toast: document.querySelector('#toast'),selectionBar: document.querySelector('#selectionBar'),selectionCount: document.querySelector('#selectionCount'),@@ -104,18 +106,17 @@ function resolveTheme(choice = state.theme) {return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';}+// 单键切换:标签/图标写的是"点了会变成什么"。state.theme 初值 system,+// 首次点击才落到显式 light/dark,所以没点过的用户仍跟随系统。function applyTheme() {const resolved = resolveTheme();document.documentElement.dataset.theme = resolved;document.documentElement.dataset.themeChoice = state.theme;document.documentElement.style.colorScheme = resolved;- elements.themeSwitch.setAttribute('aria-label', text('themeLabel'));- elements.themeSwitch.querySelectorAll('[data-theme]').forEach((button) => {- const active = button.dataset.theme === state.theme;- button.classList.toggle('is-active', active);- button.setAttribute('aria-pressed', String(active));- button.textContent = text(`theme${button.dataset.theme[0].toUpperCase()}${button.dataset.theme.slice(1)}`);- });+ const next = resolved === 'dark' ? 'light' : 'dark';+ elements.themeToggle.dataset.next = next;+ elements.themeToggle.setAttribute('aria-label', text(next === 'dark' ? 'themeToDark' : 'themeToLight'));+ elements.themeToggleLabel.textContent = text(next === 'dark' ? 'themeDark' : 'themeLight');}function applyLanguage() {@@ -129,12 +130,8 @@ function applyLanguage() {node.setAttribute('aria-label', text(node.dataset.i18nAriaLabel));});elements.searchInput.placeholder = text('searchPlaceholder');- elements.languageSwitch.setAttribute('aria-label', state.language === 'zh' ? '语言' : 'Language');- elements.languageSwitch.querySelectorAll('[data-language]').forEach((button) => {- const active = button.dataset.language === state.language;- button.classList.toggle('is-active', active);- button.setAttribute('aria-pressed', String(active));- });+ elements.languageToggleLabel.textContent = state.language === 'zh' ? 'EN' : '中文';+ elements.languageToggle.setAttribute('aria-label', text('languageToggle'));applyTheme();updateSelectionBar();}@@ -427,10 +424,8 @@ elements.filters.addEventListener('click', (event) => {render();});-elements.languageSwitch.addEventListener('click', (event) => {- const button = event.target.closest('[data-language]');- if (!button || button.dataset.language === state.language) return;- state.language = button.dataset.language;+elements.languageToggle.addEventListener('click', () => {+ state.language = state.language === 'zh' ? 'en' : 'zh';try {localStorage.setItem('video-shot-gallery-language', state.language);} catch {}@@ -438,10 +433,8 @@ elements.languageSwitch.addEventListener('click', (event) => {render();});-elements.themeSwitch.addEventListener('click', (event) => {- const button = event.target.closest('[data-theme]');- if (!button || button.dataset.theme === state.theme) return;- state.theme = button.dataset.theme;+elements.themeToggle.addEventListener('click', () => {+ state.theme = elements.themeToggle.dataset.next === 'dark' ? 'dark' : 'light';try {localStorage.setItem('video-shot-gallery-theme', state.theme);} catch {}diff --git a/gallery/index.html b/gallery/index.htmlindex 22d0cc3..74f2f4d 100644--- a/gallery/index.html+++ b/gallery/index.html@@ -132,26 +132,34 @@height: 42px;object-fit: contain;}- .language-switch {+ /* 单键切换,标签写"点了会变成什么",与 library/showcase 顶栏同一套交互 */+ .language-toggle {display: inline-flex;+ align-items: center;+ gap: 0.4rem;border: 1px solid var(--line);border-radius: 999px;- overflow: hidden;+ padding: 0.38rem 0.85rem;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;white-space: nowrap;cursor: pointer;+ transition: color 150ms ease, border-color 150ms ease;+ }+ .language-toggle:hover { color: var(--text); border-color: rgba(211, 146, 60, 0.65); }+ .language-toggle svg {+ width: 15px;+ height: 15px;+ fill: none;+ stroke: currentColor;+ stroke-width: 1.6;+ stroke-linecap: round;+ stroke-linejoin: round;}- .language-switch button.is-active { color: var(--text); font-weight: 700; background: rgba(240, 237, 229, 0.1); }.topbar-nav {display: inline-flex;align-items: center;@@ -406,10 +414,12 @@</a><nav class="topbar-nav" aria-label="Site"><a class="topbar-nav-link" href="./showcase.html" data-l10n="navShowcase">Showcase</a>- <span 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>- </span>+ <button class="language-toggle" id="languageToggle" type="button" aria-label="Switch to Chinese">+ <span aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><circle cx="12" cy="12" r="9.2"/><path d="M2.8 12h18.4M12 2.8c2.5 2.6 3.8 5.7 3.8 9.2S14.5 18.6 12 21.2c-2.5-2.6-3.8-5.7-3.8-9.2S9.5 5.4 12 2.8Z"/></svg>+ </span>+ <span id="languageToggleLabel">中文</span>+ </button></nav></header>@@ -480,17 +490,13 @@document.querySelectorAll('[data-l10n]').forEach((node) => {node.innerHTML = t(node.dataset.l10n);});- 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));- });+ document.querySelector('#languageToggleLabel').textContent = state.language === 'zh' ? 'EN' : '中文';+ document.querySelector('#languageToggle')+ .setAttribute('aria-label', state.language === 'zh' ? '切换到英文' : 'Switch to Chinese');}- document.querySelector('#languageSwitch').addEventListener('click', (event) => {- const button = event.target.closest('[data-language]');- if (!button || button.dataset.language === state.language) return;- state.language = button.dataset.language;+ document.querySelector('#languageToggle').addEventListener('click', () => {+ state.language = state.language === 'zh' ? 'en' : 'zh';try { localStorage.setItem('video-shot-gallery-language', state.language); } catch {}applyLanguage();});diff --git a/gallery/library.html b/gallery/library.htmlindex f880f25..3b05a0a 100644--- a/gallery/library.html+++ b/gallery/library.html@@ -62,15 +62,21 @@<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>+ <button class="topbar-toggle" id="themeToggle" type="button" aria-label="Switch to dark mode">+ <span class="topbar-toggle-icon icon-moon" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="M20.5 14.6A8.5 8.5 0 0 1 9.4 3.5a8.5 8.5 0 1 0 11.1 11.1Z"/></svg>+ </span>+ <span class="topbar-toggle-icon icon-sun" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><circle cx="12" cy="12" r="4.2"/><path d="M12 2.6v2.2M12 19.2v2.2M4.4 4.4l1.6 1.6M18 18l1.6 1.6M2.6 12h2.2M19.2 12h2.2M4.4 19.6 6 18M18 6l1.6-1.6"/></svg>+ </span>+ <span class="topbar-toggle-label" id="themeToggleLabel">Dark</span>+ </button>+ <button class="topbar-toggle" id="languageToggle" type="button" aria-label="Switch to Chinese">+ <span class="topbar-toggle-icon" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><circle cx="12" cy="12" r="9.2"/><path d="M2.8 12h18.4M12 2.8c2.5 2.6 3.8 5.7 3.8 9.2S14.5 18.6 12 21.2c-2.5-2.6-3.8-5.7-3.8-9.2S9.5 5.4 12 2.8Z"/></svg>+ </span>+ <span class="topbar-toggle-label" id="languageToggleLabel">中文</span>+ </button></div></header>@@ -96,30 +102,39 @@<span class="social-badge-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-5 0-9 2.5-9 5.5V22h18v-2.5C21 16.5 17 14 12 14Z"/></svg></span>- <span class="social-badge-name" data-i18n="followAuthor">Follow author</span>- <span class="follow-chevron" aria-hidden="true">⌃</span>+ <span class="social-badge-name" data-i18n="followMe">Follow me</span>+ <span class="follow-chevron" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="m5 9 7 7 7-7"/></svg>+ </span></button><div class="follow-platforms" id="followPlatforms" role="group" data-i18n-aria-label="followPlatformsLabel" aria-label="Choose a platform to follow Vincent">- <a class="social-badge" data-platform="x" href="https://x.com/VincentWei93" target="_blank" rel="noopener noreferrer" data-i18n-aria-label="followX" aria-label="Follow Vincent on X">- <span class="social-badge-mark" aria-hidden="true">+ <p class="follow-platforms-heading" data-i18n="followMeOn">Follow me on</p>+ <a class="follow-row" data-platform="x" href="https://x.com/VincentWei93" target="_blank" rel="noopener noreferrer" data-i18n-aria-label="followX" aria-label="Follow Vincent on X">+ <span class="follow-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"/></svg></span>- <span class="social-badge-name">X</span>- <span class="social-badge-action" data-i18n="followAction">Follow me</span>+ <span class="follow-name">X</span>+ <span class="link-arrow" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="M7 17 17 7M8.5 7H17v8.5"/></svg>+ </span></a>- <a class="social-badge" data-platform="douyin" href="https://www.douyin.com/user/MS4wLjABAAAAK1pkjBxilk2Oi_9h_vFyD-lTAu9CTlvhmOtkosDvvxg" target="_blank" rel="noopener noreferrer" data-i18n-aria-label="followDouyin" aria-label="Follow Vincent on Douyin">- <span class="social-badge-mark" aria-hidden="true">+ <a class="follow-row" data-platform="douyin" href="https://www.douyin.com/user/MS4wLjABAAAAK1pkjBxilk2Oi_9h_vFyD-lTAu9CTlvhmOtkosDvvxg" target="_blank" rel="noopener noreferrer" data-i18n-aria-label="followDouyin" aria-label="Follow Vincent on Douyin">+ <span class="follow-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"/></svg></span>- <span class="social-badge-name">抖音</span>- <span class="social-badge-action" data-i18n="followAction">Follow me</span>+ <span class="follow-name" data-i18n="douyinName">Douyin</span>+ <span class="link-arrow" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="M7 17 17 7M8.5 7H17v8.5"/></svg>+ </span></a>- <a class="social-badge" data-platform="xiaohongshu" href="https://xhslink.cn/m/At9iP2d5C1V" target="_blank" rel="noopener noreferrer" data-i18n-aria-label="followXiaohongshu" aria-label="Follow Vincent on Red Note">- <span class="social-badge-mark" aria-hidden="true">- <svg viewBox="0 0 24 24" focusable="false"><path d="M22.405 9.879c.002.016.01.02.07.019h.725a.797.797 0 0 0 .78-.972.794.794 0 0 0-.884-.618.795.795 0 0 0-.692.794c0 .101-.002.666.001.777zm-11.509 4.808c-.203.001-1.353.004-1.685.003a2.528 2.528 0 0 1-.766-.126.025.025 0 0 0-.03.014L7.7 16.127a.025.025 0 0 0 .01.032c.111.06.336.124.495.124.66.01 1.32.002 1.981 0 .01 0 .02-.006.023-.015l.712-1.545a.025.025 0 0 0-.024-.036zM.477 9.91c-.071 0-.076.002-.076.01a.834.834 0 0 0-.01.08c-.027.397-.038.495-.234 3.06-.012.24-.034.389-.135.607-.026.057-.033.042.003.112.046.092.681 1.523.787 1.74.008.015.011.02.017.02.008 0 .033-.026.047-.044.147-.187.268-.391.371-.606.306-.635.44-1.325.486-1.706.014-.11.021-.22.03-.33l.204-2.616.022-.293c.003-.029 0-.033-.03-.034zm7.203 3.757a1.427 1.427 0 0 1-.135-.607c-.004-.084-.031-.39-.235-3.06a.443.443 0 0 0-.01-.082c-.004-.011-.052-.008-.076-.008h-1.48c-.03.001-.034.005-.03.034l.021.293c.076.982.153 1.964.233 2.946.05.4.186 1.085.487 1.706.103.215.223.419.37.606.015.018.037.051.048.049.02-.003.742-1.642.804-1.765.036-.07.03-.055.003-.112zm3.861-.913h-.872a.126.126 0 0 1-.116-.178l1.178-2.625a.025.025 0 0 0-.023-.035l-1.318-.003a.148.148 0 0 1-.135-.21l.876-1.954a.025.025 0 0 0-.023-.035h-1.56c-.01 0-.02.006-.024.015l-.926 2.068c-.085.169-.314.634-.399.938a.534.534 0 0 0-.02.191.46.46 0 0 0 .23.378.981.981 0 0 0 .46.119h.59c.041 0-.688 1.482-.834 1.972a.53.53 0 0 0-.023.172.465.465 0 0 0 .23.398c.15.092.342.12.475.12l1.66-.001c.01 0 .02-.006.023-.015l.575-1.28a.025.025 0 0 0-.024-.035zm-6.93-4.937H3.1a.032.032 0 0 0-.034.033c0 1.048-.01 2.795-.01 6.829 0 .288-.269.262-.28.262h-.74c-.04.001-.044.004-.04.047.001.037.465 1.064.555 1.263.01.02.03.033.051.033.157.003.767.009.938-.014.153-.02.3-.06.438-.132.3-.156.49-.419.595-.765.052-.172.075-.353.075-.533.002-2.33 0-4.66-.007-6.991a.032.032 0 0 0-.032-.032zm11.784 6.896c0-.014-.01-.021-.024-.022h-1.465c-.048-.001-.049-.002-.05-.049v-4.66c0-.072-.005-.07.07-.07h.863c.08 0 .075.004.075-.074V8.393c0-.082.006-.076-.08-.076h-3.5c-.064 0-.075-.006-.075.073v1.445c0 .083-.006.077.08.077h.854c.075 0 .07-.004.07.07v4.624c0 .095.008.084-.085.084-.37 0-1.11-.002-1.304 0-.048.001-.06.03-.06.03l-.697 1.519s-.014.025-.008.036c.006.01.013.008.058.008 1.748.003 3.495.002 5.243.002.03-.001.034-.006.035-.033v-1.539zm4.177-3.43c0 .013-.007.023-.02.024-.346.006-.692.004-1.037.004-.014-.002-.022-.01-.022-.024-.005-.434-.007-.869-.01-1.303 0-.072-.006-.071.07-.07l.733-.003c.041 0 .081.002.12.015.093.025.16.107.165.204.006.431.002 1.153.001 1.153zm2.67.244a1.953 1.953 0 0 0-.883-.222h-.18c-.04-.001-.04-.003-.042-.04V10.21c0-.132-.007-.263-.025-.394a1.823 1.823 0 0 0-.153-.53 1.533 1.533 0 0 0-.677-.71 2.167 2.167 0 0 0-1-.258c-.153-.003-.567 0-.72 0-.07 0-.068.004-.068-.065V7.76c0-.031-.01-.041-.046-.039H17.93s-.016 0-.023.007c-.006.006-.008.012-.008.023v.546c-.008.036-.057.015-.082.022h-.95c-.022.002-.028.008-.03.032v1.481c0 .09-.004.082.082.082h.913c.082 0 .072.128.072.128V11.19s.003.117-.06.117h-1.482c-.068 0-.06.082-.06.082v1.445s-.01.068.064.068h1.457c.082 0 .076-.006.076.079v3.225c0 .088-.007.081.082.081h1.43c.09 0 .082.007.082-.08v-3.27c0-.029.006-.035.033-.035l2.323-.003c.098 0 .191.02.28.061a.46.46 0 0 1 .274.407c.008.395.003.79.003 1.185 0 .259-.107.367-.33.367h-1.218c-.023.002-.029.008-.028.033.184.437.374.871.57 1.303a.045.045 0 0 0 .04.026c.17.005.34.002.51.003.15-.002.517.004.666-.01a2.03 2.03 0 0 0 .408-.075c.59-.18.975-.698.976-1.313v-1.981c0-.128-.01-.254-.034-.38 0 .078-.029-.641-.724-.998z"/></svg>+ <a class="follow-row" data-platform="xiaohongshu" href="https://xhslink.cn/m/At9iP2d5C1V" target="_blank" rel="noopener noreferrer" data-i18n-aria-label="followXiaohongshu" aria-label="Follow Vincent on Xiaohongshu">+ <span class="follow-mark" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><rect width="24" height="24" rx="6" fill="#ff2442"/><path fill="#fff" transform="translate(3.35 3.3) scale(0.72)" d="M22.405 9.879c.002.016.01.02.07.019h.725a.797.797 0 0 0 .78-.972.794.794 0 0 0-.884-.618.795.795 0 0 0-.692.794c0 .101-.002.666.001.777zm-11.509 4.808c-.203.001-1.353.004-1.685.003a2.528 2.528 0 0 1-.766-.126.025.025 0 0 0-.03.014L7.7 16.127a.025.025 0 0 0 .01.032c.111.06.336.124.495.124.66.01 1.32.002 1.981 0 .01 0 .02-.006.023-.015l.712-1.545a.025.025 0 0 0-.024-.036zM.477 9.91c-.071 0-.076.002-.076.01a.834.834 0 0 0-.01.08c-.027.397-.038.495-.234 3.06-.012.24-.034.389-.135.607-.026.057-.033.042.003.112.046.092.681 1.523.787 1.74.008.015.011.02.017.02.008 0 .033-.026.047-.044.147-.187.268-.391.371-.606.306-.635.44-1.325.486-1.706.014-.11.021-.22.03-.33l.204-2.616.022-.293c.003-.029 0-.033-.03-.034zm7.203 3.757a1.427 1.427 0 0 1-.135-.607c-.004-.084-.031-.39-.235-3.06a.443.443 0 0 0-.01-.082c-.004-.011-.052-.008-.076-.008h-1.48c-.03.001-.034.005-.03.034l.021.293c.076.982.153 1.964.233 2.946.05.4.186 1.085.487 1.706.103.215.223.419.37.606.015.018.037.051.048.049.02-.003.742-1.642.804-1.765.036-.07.03-.055.003-.112zm3.861-.913h-.872a.126.126 0 0 1-.116-.178l1.178-2.625a.025.025 0 0 0-.023-.035l-1.318-.003a.148.148 0 0 1-.135-.21l.876-1.954a.025.025 0 0 0-.023-.035h-1.56c-.01 0-.02.006-.024.015l-.926 2.068c-.085.169-.314.634-.399.938a.534.534 0 0 0-.02.191.46.46 0 0 0 .23.378.981.981 0 0 0 .46.119h.59c.041 0-.688 1.482-.834 1.972a.53.53 0 0 0-.023.172.465.465 0 0 0 .23.398c.15.092.342.12.475.12l1.66-.001c.01 0 .02-.006.023-.015l.575-1.28a.025.025 0 0 0-.024-.035zm-6.93-4.937H3.1a.032.032 0 0 0-.034.033c0 1.048-.01 2.795-.01 6.829 0 .288-.269.262-.28.262h-.74c-.04.001-.044.004-.04.047.001.037.465 1.064.555 1.263.01.02.03.033.051.033.157.003.767.009.938-.014.153-.02.3-.06.438-.132.3-.156.49-.419.595-.765.052-.172.075-.353.075-.533.002-2.33 0-4.66-.007-6.991a.032.032 0 0 0-.032-.032zm11.784 6.896c0-.014-.01-.021-.024-.022h-1.465c-.048-.001-.049-.002-.05-.049v-4.66c0-.072-.005-.07.07-.07h.863c.08 0 .075.004.075-.074V8.393c0-.082.006-.076-.08-.076h-3.5c-.064 0-.075-.006-.075.073v1.445c0 .083-.006.077.08.077h.854c.075 0 .07-.004.07.07v4.624c0 .095.008.084-.085.084-.37 0-1.11-.002-1.304 0-.048.001-.06.03-.06.03l-.697 1.519s-.014.025-.008.036c.006.01.013.008.058.008 1.748.003 3.495.002 5.243.002.03-.001.034-.006.035-.033v-1.539zm4.177-3.43c0 .013-.007.023-.02.024-.346.006-.692.004-1.037.004-.014-.002-.022-.01-.022-.024-.005-.434-.007-.869-.01-1.303 0-.072-.006-.071.07-.07l.733-.003c.041 0 .081.002.12.015.093.025.16.107.165.204.006.431.002 1.153.001 1.153zm2.67.244a1.953 1.953 0 0 0-.883-.222h-.18c-.04-.001-.04-.003-.042-.04V10.21c0-.132-.007-.263-.025-.394a1.823 1.823 0 0 0-.153-.53 1.533 1.533 0 0 0-.677-.71 2.167 2.167 0 0 0-1-.258c-.153-.003-.567 0-.72 0-.07 0-.068.004-.068-.065V7.76c0-.031-.01-.041-.046-.039H17.93s-.016 0-.023.007c-.006.006-.008.012-.008.023v.546c-.008.036-.057.015-.082.022h-.95c-.022.002-.028.008-.03.032v1.481c0 .09-.004.082.082.082h.913c.082 0 .072.128.072.128V11.19s.003.117-.06.117h-1.482c-.068 0-.06.082-.06.082v1.445s-.01.068.064.068h1.457c.082 0 .076-.006.076.079v3.225c0 .088-.007.081.082.081h1.43c.09 0 .082.007.082-.08v-3.27c0-.029.006-.035.033-.035l2.323-.003c.098 0 .191.02.28.061a.46.46 0 0 1 .274.407c.008.395.003.79.003 1.185 0 .259-.107.367-.33.367h-1.218c-.023.002-.029.008-.028.033.184.437.374.871.57 1.303a.045.045 0 0 0 .04.026c.17.005.34.002.51.003.15-.002.517.004.666-.01a2.03 2.03 0 0 0 .408-.075c.59-.18.975-.698.976-1.313v-1.981c0-.128-.01-.254-.034-.38 0 .078-.029-.641-.724-.998z"/></svg>+ </span>+ <span class="follow-name" data-i18n="xiaohongshuName">RedNote</span>+ <span class="link-arrow" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="M7 17 17 7M8.5 7H17v8.5"/></svg></span>- <span class="social-badge-name" data-i18n="redNoteName">Red Note</span>- <span class="social-badge-action" data-i18n="followAction">Follow me</span></a></div></div>@@ -133,7 +148,10 @@<span class="social-badge-mark" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M8 5.5v13a1 1 0 0 0 1.52.86l10.5-6.5a1 1 0 0 0 0-1.72L9.52 4.64A1 1 0 0 0 8 5.5Z"/></svg></span>- <span class="social-badge-name" data-i18n="navShowcase">Showcase</span>+ <span class="social-badge-name" data-i18n="viewShowcase">View showcase</span>+ <span class="link-arrow" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="M7 17 17 7M8.5 7H17v8.5"/></svg>+ </span></a></div></aside>diff --git a/gallery/showcase.html b/gallery/showcase.htmlindex 5901bec..387b21e 100644--- a/gallery/showcase.html+++ b/gallery/showcase.html@@ -39,15 +39,21 @@</a><div class="topbar-actions"><a class="topbar-link" href="./library.html" data-i18n="navLibrary">Shot library</a>- <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>+ <button class="topbar-toggle" id="themeToggle" type="button" aria-label="Switch to dark mode">+ <span class="topbar-toggle-icon icon-moon" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><path d="M20.5 14.6A8.5 8.5 0 0 1 9.4 3.5a8.5 8.5 0 1 0 11.1 11.1Z"/></svg>+ </span>+ <span class="topbar-toggle-icon icon-sun" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><circle cx="12" cy="12" r="4.2"/><path d="M12 2.6v2.2M12 19.2v2.2M4.4 4.4l1.6 1.6M18 18l1.6 1.6M2.6 12h2.2M19.2 12h2.2M4.4 19.6 6 18M18 6l1.6-1.6"/></svg>+ </span>+ <span class="topbar-toggle-label" id="themeToggleLabel">Dark</span>+ </button>+ <button class="topbar-toggle" id="languageToggle" type="button" aria-label="Switch to Chinese">+ <span class="topbar-toggle-icon" aria-hidden="true">+ <svg viewBox="0 0 24 24" focusable="false"><circle cx="12" cy="12" r="9.2"/><path d="M2.8 12h18.4M12 2.8c2.5 2.6 3.8 5.7 3.8 9.2S14.5 18.6 12 21.2c-2.5-2.6-3.8-5.7-3.8-9.2S9.5 5.4 12 2.8Z"/></svg>+ </span>+ <span class="topbar-toggle-label" id="languageToggleLabel">中文</span>+ </button></div></header>diff --git a/gallery/showcase.js b/gallery/showcase.jsindex 6b9fb2c..1f24750 100644--- a/gallery/showcase.js+++ b/gallery/showcase.js@@ -16,6 +16,11 @@ const SHOWCASE_L10N = {cardsUsed: 'Shot cards',by: 'by',fullscreen: 'Fullscreen',+ themeDark: 'Dark',+ themeLight: 'Light',+ themeToDark: 'Switch to dark mode',+ themeToLight: 'Switch to light mode',+ languageToggle: 'Switch to Chinese',},zh: {documentTitle: '社区作品展示 | video-shotcraft',@@ -31,6 +36,11 @@ const SHOWCASE_L10N = {cardsUsed: '用到的镜头卡',by: '作者',fullscreen: '全屏播放',+ themeDark: '深色',+ themeLight: '浅色',+ themeToDark: '切换到深色模式',+ themeToLight: '切换到浅色模式',+ languageToggle: '切换到英文',},};@@ -50,8 +60,10 @@ const state = {const elements = {grid: document.querySelector('#showcase'),emptyState: document.querySelector('#emptyState'),- languageSwitch: document.querySelector('#languageSwitch'),- themeSwitch: document.querySelector('#themeSwitch'),+ languageToggle: document.querySelector('#languageToggle'),+ languageToggleLabel: document.querySelector('#languageToggleLabel'),+ themeToggle: document.querySelector('#themeToggle'),+ themeToggleLabel: document.querySelector('#themeToggleLabel'),};const text = (key) => SHOWCASE_L10N[state.language][key] || SHOWCASE_L10N.en[key] || key;@@ -74,11 +86,11 @@ function applyTheme() {document.documentElement.dataset.theme = resolved;document.documentElement.dataset.themeChoice = state.theme;document.documentElement.style.colorScheme = resolved;- elements.themeSwitch.querySelectorAll('[data-theme]').forEach((button) => {- const active = button.dataset.theme === state.theme;- button.classList.toggle('is-active', active);- button.setAttribute('aria-pressed', String(active));- });+ // 单键切换,标签写"点了会变成什么";没点过的用户仍跟随系统(state.theme = system)+ const next = resolved === 'dark' ? 'light' : 'dark';+ elements.themeToggle.dataset.next = next;+ elements.themeToggle.setAttribute('aria-label', text(next === 'dark' ? 'themeToDark' : 'themeToLight'));+ elements.themeToggleLabel.textContent = text(next === 'dark' ? 'themeDark' : 'themeLight');}function applyLanguage() {@@ -90,11 +102,8 @@ function applyLanguage() {document.querySelectorAll('[data-i18n-aria-label]').forEach((node) => {node.setAttribute('aria-label', text(node.dataset.i18nAriaLabel));});- elements.languageSwitch.querySelectorAll('[data-language]').forEach((button) => {- const active = button.dataset.language === state.language;- button.classList.toggle('is-active', active);- button.setAttribute('aria-pressed', String(active));- });+ elements.languageToggleLabel.textContent = state.language === 'zh' ? 'EN' : '中文';+ elements.languageToggle.setAttribute('aria-label', text('languageToggle'));applyTheme();}@@ -234,19 +243,15 @@ elements.grid.addEventListener('click', (event) => {if (expand) openFullscreen(expand.dataset.expandKey);});-elements.languageSwitch.addEventListener('click', (event) => {- const button = event.target.closest('[data-language]');- if (!button || button.dataset.language === state.language) return;- state.language = button.dataset.language;+elements.languageToggle.addEventListener('click', () => {+ state.language = state.language === 'zh' ? 'en' : 'zh';try { localStorage.setItem('video-shot-gallery-language', state.language); } catch {}applyLanguage();render();});-elements.themeSwitch.addEventListener('click', (event) => {- const button = event.target.closest('[data-theme]');- if (!button || button.dataset.theme === state.theme) return;- state.theme = button.dataset.theme;+elements.themeToggle.addEventListener('click', () => {+ state.theme = elements.themeToggle.dataset.next === 'dark' ? 'dark' : 'light';try { localStorage.setItem('video-shot-gallery-theme', state.theme); } catch {}applyTheme();});diff --git a/gallery/styles.css b/gallery/styles.cssindex 95992a0..26df176 100644--- a/gallery/styles.css+++ b/gallery/styles.css@@ -25,6 +25,9 @@--skeleton-a: #e4e1da;--skeleton-b: #ece9e2;--control-shadow: rgba(61, 53, 38, 0.08);+ /* 顶栏/侧栏控件的三态:静止 --surface,hover 变暖一档,按下再深一档 */+ --control-hover: #f1ece3;+ --control-active: #e7e0d3;--radius: 14px;--shadow: 0 8px 28px rgba(61, 53, 38, 0.06);font-family: "Avenir Next", Avenir, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;@@ -60,6 +63,8 @@--skeleton-a: #292820;--skeleton-b: #343229;--control-shadow: rgba(0, 0, 0, 0.32);+ --control-hover: #2b2a24;+ --control-active: #35332c;--shadow: 0 10px 32px rgba(0, 0, 0, 0.24);}@@ -147,43 +152,52 @@ a { color: inherit; }:root[data-theme="dark"] .brand-mark-light { display: none; }:root[data-theme="dark"] .brand-mark-dark { display: block; }-.topbar-actions,-.language-switch,-.theme-switch {+.topbar-actions {display: flex;align-items: center;+ gap: 0.5rem;}-.topbar-actions { gap: 0.55rem; }-.language-switch,-.theme-switch {- gap: 2px;- padding: 3px;+/* 主题与语言是同级操作:静止时同色同边框同阴影,只有 hover/按下才分化 */+.topbar-toggle {+ display: inline-flex;+ align-items: center;+ gap: 0.45rem;+ height: 36px;+ padding: 0 0.85rem;border: 1px solid var(--line);- border-radius: 9px;- background: var(--surface-soft);-}-.language-switch button,-.theme-switch button {- height: 30px;- padding: 0 0.65rem;- border: 0;- border-radius: 6px;- /* --muted (4.40:1) misses on --surface-soft; --faint is tuned to clear it */- color: var(--faint);- background: transparent;- font-size: 0.7rem;+ border-radius: 12px;+ background: var(--surface);+ color: var(--text);+ box-shadow: 0 2px 8px var(--control-shadow);+ font-size: 0.78rem;+ font-weight: 650;white-space: nowrap;+ text-decoration: none;cursor: pointer;+ transition: background 140ms ease, border-color 140ms ease;}-.theme-switch button { padding-inline: 0.55rem; }-.language-switch button.is-active,-.theme-switch button.is-active {- color: var(--text);- background: var(--surface);- box-shadow: 0 1px 4px var(--control-shadow);- font-weight: 700;+.topbar-toggle:hover { background: var(--control-hover); border-color: var(--faint); }+/* 按下再深一档;focus 环由全局 :focus-visible 给,不改变布局 */+.topbar-toggle:active { background: var(--control-active); }++.topbar-toggle-icon {+ display: inline-flex;+ flex: none;+}+.topbar-toggle-icon svg {+ width: 16px;+ height: 16px;+ fill: none;+ stroke: currentColor;+ stroke-width: 1.6;+ stroke-linecap: round;+ stroke-linejoin: round;}+/* 图标跟随生效主题切换,无需 JS */+.topbar-toggle .icon-sun { display: none; }+:root[data-theme="dark"] .topbar-toggle .icon-moon { display: none; }+:root[data-theme="dark"] .topbar-toggle .icon-sun { display: inline-flex; }main {width: min(1560px, calc(100% - 48px));@@ -274,7 +288,7 @@ main {.sidebar-social {display: flex;flex-direction: column;- gap: 0.45rem;+ gap: 0.4rem;margin-top: auto;padding: 2rem 0.75rem 0;}@@ -282,36 +296,34 @@ main {.social-badge {display: flex;align-items: center;- gap: 0.5rem;- min-height: 34px;- padding: 0.3rem 0.45rem;+ gap: 0.6rem;+ min-height: 40px;+ padding: 0.3rem 0.7rem;border: 1px solid var(--line);border-radius: 999px;- background: var(--surface-translucent);+ background: var(--surface);color: var(--text);text-decoration: none;box-shadow: 0 2px 9px var(--control-shadow);- transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;+ transition: border-color 140ms ease, background 140ms ease, color 140ms ease;}.follow-menu {position: relative;- width: min(100%, 184px);+ width: min(100%, 196px);margin-inline: auto;}/* 图标统一左对齐成一列:徽章整体居中时标签长短不一,图标会错位 */.sidebar-social > .social-badge {- width: min(100%, 184px);+ width: min(100%, 196px);margin-inline: auto;justify-content: flex-start;- padding-left: 0.55rem;}.follow-trigger {width: 100%;justify-content: flex-start;- padding-left: 0.55rem;position: relative;font: inherit;text-align: left;@@ -320,26 +332,45 @@ main {.follow-chevron {position: absolute;- right: 0.7rem;+ right: 0.75rem;+ display: inline-flex;color: var(--faint);- font-size: 0.78rem;- line-height: 1;transition: transform 160ms ease;}+.follow-chevron svg {+ width: 12px;+ height: 12px;+ fill: none;+ stroke: currentColor;+ stroke-width: 2.2;+ stroke-linecap: round;+ stroke-linejoin: round;+}++/* 展开态触发器反色实心:面板是白卡,触发器必须压得住它 */+.follow-menu:hover .follow-trigger,+.follow-menu.is-open .follow-trigger {+ background: var(--text);+ border-color: var(--text);+ color: var(--bg);+}+.follow-menu:hover .follow-chevron,+.follow-menu.is-open .follow-chevron {+ color: inherit;+ transform: rotate(180deg);+}.follow-platforms {position: absolute;z-index: 20;right: 0;- bottom: calc(100% + 0.5rem);+ bottom: calc(100% + 0.6rem);left: 0;- display: grid;- gap: 0.4rem;- padding: 0.45rem;+ padding: 0.55rem 0.45rem 0.4rem;border: 1px solid var(--line);- border-radius: 1rem;+ border-radius: 18px;background: var(--surface);- box-shadow: 0 12px 32px var(--control-shadow);+ box-shadow: 0 14px 34px var(--control-shadow);opacity: 0;visibility: hidden;pointer-events: none;@@ -348,12 +379,29 @@ main {transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease;}+/* 指向触发器的小尖角 */+.follow-platforms::before {+ position: absolute;+ bottom: -6px;+ left: 50%;+ width: 11px;+ height: 11px;+ margin-left: -5.5px;+ border-right: 1px solid var(--line);+ border-bottom: 1px solid var(--line);+ border-bottom-right-radius: 3px;+ background: var(--surface);+ transform: rotate(45deg);+ content: '';+}++/* 指针从触发器移到面板的空隙桥,不然中途 hover 断开面板会收起 */.follow-platforms::after {position: absolute;top: 100%;right: 0;left: 0;- height: 0.5rem;+ height: 0.6rem;content: '';}@@ -365,65 +413,94 @@ main {transform: translateY(0) scale(1);}-.follow-menu:hover .follow-chevron,-.follow-menu.is-open .follow-chevron {- transform: rotate(180deg);+.follow-platforms-heading {+ margin: 0.05rem 0 0.35rem;+ padding-left: 0.6rem;+ color: var(--faint);+ font-size: 0.6rem;+ font-weight: 750;+ letter-spacing: 0.14em;+ text-transform: uppercase;}-.social-badge:hover {- border-color: var(--faint);- background: var(--surface);- transform: translateY(-1px);+/* 面板内是分隔线列表,不是一堆小胶囊 */+.follow-row {+ display: flex;+ align-items: center;+ gap: 0.65rem;+ min-height: 44px;+ padding: 0 0.55rem;+ border-radius: 12px;+ color: var(--text);+ text-decoration: none;+ transition: background 140ms ease;}+.follow-row + .follow-row { border-top: 1px solid var(--line); }+.follow-row:hover { background: var(--surface-soft); }-.social-badge-mark {+.follow-mark {display: inline-grid;- width: 25px;- height: 25px;+ width: 26px;+ height: 26px;place-items: center;flex: none;- border-radius: 50%;- background: var(--text);- color: var(--bg);+ color: var(--text);}--.social-badge-mark svg {- width: 13px;- height: 13px;+.follow-mark svg {+ width: 22px;+ height: 22px;fill: currentColor;}+.follow-row[data-platform="douyin"] .follow-mark svg {+ filter: drop-shadow(-1px 0 #25f4ee) drop-shadow(1px 0 #fe2c55);+}-.social-badge[data-platform="xiaohongshu"] .social-badge-mark {- background: #ff2442;- color: #fff;+.follow-name {+ font-size: 0.86rem;+ font-weight: 700;+ white-space: nowrap;}-.social-badge[data-platform="xiaohongshu"] .social-badge-mark svg {- width: 17px;- height: 17px;+.social-badge:hover {+ border-color: var(--faint);+ background: var(--control-hover);}-.social-badge[data-platform="douyin"] .social-badge-mark {- background: #090909;- color: #fff;+.social-badge-mark {+ display: inline-grid;+ width: 26px;+ height: 26px;+ place-items: center;+ flex: none;+ color: inherit;}-.social-badge[data-platform="douyin"] .social-badge-mark svg {- filter: drop-shadow(-1px 0 #25f4ee) drop-shadow(1px 0 #fe2c55);+.social-badge-mark svg {+ width: 19px;+ height: 19px;+ fill: currentColor;}.social-badge-name {- font-size: 0.73rem;+ font-size: 0.8rem;font-weight: 750;white-space: nowrap;}-.social-badge-action {+/* 外链角标:跳站外/换页的动作给个指向,留在本页的(Star 是外链但语义是收藏)不给 */+.link-arrow {margin-left: auto;+ display: inline-flex;color: var(--faint);- font-size: 0.62rem;- font-weight: 650;- white-space: nowrap;+}+.link-arrow svg {+ width: 13px;+ height: 13px;+ fill: none;+ stroke: currentColor;+ stroke-width: 2;+ stroke-linecap: round;+ stroke-linejoin: round;}.library-main { min-width: 0; }@@ -439,7 +516,7 @@ main {h1, h2, p { overflow-wrap: anywhere; }h1 {margin: 0;- font-size: clamp(2rem, 3.4vw, 3.4rem);+ font-size: clamp(1.8rem, 3vw, 3rem);line-height: 1.02;letter-spacing: -0.045em;font-weight: 750;@@ -970,14 +1047,14 @@ kbd { padding: 0.2rem 0.34rem; border: 1px solid var(--line); border-radius: 5px@media (max-width: 620px) {main { width: min(100% - 24px, 1560px); }.topbar { padding: 0 12px; }- /* the enlarged desktop wordmark + theme/language switches overflow a+ /* the enlarged desktop wordmark + theme/language toggles overflow a390px bar; the mark stays big, the wordmark gives back its extra size */.brand { font-size: 0.72rem; letter-spacing: 0.1em; }.brand-mark { width: 26px; height: 26px; }- .topbar-actions { gap: 0.55rem; }- .theme-switch button { padding-inline: 0.42rem; }+ .topbar-actions { gap: 0.4rem; }+ .topbar-toggle { height: 34px; padding-inline: 0.6rem; font-size: 0.72rem; }.intro { padding: 1.5rem 0 1.5rem; }- h1 { font-size: 2.15rem; }+ h1 { font-size: 1.95rem; }.stats { width: 100%; justify-content: space-between; }.controls { top: 120px; }kbd { display: none; }@@ -1004,23 +1081,25 @@ kbd { padding: 0.2rem 0.34rem; border: 1px solid var(--line); border-radius: 5px/* ---------- showcase page ---------- */+/* 与顶栏两个 toggle 同一套壳,只是文本色更弱、hover 走强调色 */.topbar-link {display: inline-flex;align-items: center;- min-height: 36px;+ height: 36px;padding: 0 0.85rem;border: 1px solid var(--line);- border-radius: 9px;+ border-radius: 12px;color: var(--faint);- background: var(--surface-soft);- font-size: 0.74rem;+ background: var(--surface);+ box-shadow: 0 2px 8px var(--control-shadow);+ font-size: 0.76rem;font-weight: 700;- letter-spacing: 0.04em;+ letter-spacing: 0.03em;text-decoration: none;white-space: nowrap;- transition: color 150ms ease, border-color 150ms ease;+ transition: color 150ms ease, border-color 150ms ease, background 140ms ease;}-.topbar-link:hover { color: var(--accent-text); border-color: var(--accent); }+.topbar-link:hover { color: var(--accent-text); border-color: var(--accent); background: var(--control-hover); }.showcase-intro { align-items: center; }.showcase-submit {diff --git a/gallery/translations.js b/gallery/translations.jsindex 8c2a792..78a3c3f 100644--- a/gallery/translations.js+++ b/gallery/translations.js@@ -57,21 +57,23 @@ window.GALLERY_I18N = {filtersLabel: '按功能类别筛选',socialLinksLabel: '关注作者并为仓库加星',followHeading: '关注与支持 Vincent',- followAuthor: '关注作者',+ followMe: '关注我',+ followMeOn: '在这些平台关注我',followPlatformsLabel: '选择关注 Vincent 的平台',- followAction: '关注我',followX: '在 X 关注 Vincent',followXiaohongshu: '在小红书关注 Vincent',followDouyin: '在抖音关注 Vincent',- redNoteName: '小红书',+ douyinName: '抖音',+ xiaohongshuName: '小红书',starGitHub: '在 GitHub 为 video-shotcraft 加星',starAction: 'Star',starGitHubLabel: '收藏 GitHub',- themeLabel: '页面主题',- themeSystem: '系统',themeLight: '浅色',themeDark: '深色',- navShowcase: '社区作品展示',+ themeToLight: '切换到浅色模式',+ themeToDark: '切换到深色模式',+ languageToggle: '切换到英文',+ viewShowcase: '看社区作品',navShowcaseAria: '浏览社区作品展示',},en: {@@ -131,21 +133,23 @@ window.GALLERY_I18N = {filtersLabel: 'Filter by category',socialLinksLabel: 'Follow the author and star the repository',followHeading: 'Follow & support Vincent',- followAuthor: 'Follow author',+ followMe: 'Follow me',+ followMeOn: 'Follow me on',followPlatformsLabel: 'Choose a platform to follow Vincent',- followAction: 'Follow me',followX: 'Follow Vincent on X',- followXiaohongshu: 'Follow Vincent on Red Note',+ followXiaohongshu: 'Follow Vincent on RedNote',followDouyin: 'Follow Vincent on Douyin',- redNoteName: 'Red Note',+ douyinName: 'Douyin',+ xiaohongshuName: 'RedNote',starGitHub: 'Star video-shotcraft on GitHub',starAction: 'Star',starGitHubLabel: 'Star on GitHub',- themeLabel: 'Page theme',- themeSystem: 'Auto',themeLight: 'Light',themeDark: 'Dark',- navShowcase: 'Showcase',+ themeToLight: 'Switch to light mode',+ themeToDark: 'Switch to dark mode',+ languageToggle: 'Switch to Chinese',+ viewShowcase: 'View showcase',navShowcaseAria: 'Browse community showcase videos',},},