Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.
Recent videos open at every window width
Bowen Xuef74e1fe8dc0a
diff --git a/web/studio.css b/web/studio.cssindex 9935c12..ed8cf5f 100644--- a/web/studio.css+++ b/web/studio.css@@ -172,23 +172,36 @@@media(min-width:681px){.fv-studio .fv-controls{display:flex;flex-direction:column}.fv-studio .fv-controls>.fv-runbar{margin-top:auto}}@media(max-width:900px){.fv-studio{width:calc(100vw - 24px);height:calc(100dvh - 24px)}.fv-studio .fv-body{grid-template-columns:360px minmax(0,1fr)}.fv-studio .fv-preview-column{padding:22px 18px}.fv-studio .fv-controls{padding:22px 18px 0}.fv-studio .fv-header{padding:0 18px}.fv-studio .fv-stats{grid-template-columns:1fr 1fr}.fv-studio .fv-title{display:none}.fv-studio .fv-header{grid-template-columns:1fr auto}}@media(max-width:680px){.fv-studio{width:calc(100vw - 16px);height:calc(100dvh - 16px);border-radius:var(--fv-r-md);overflow:auto}.fv-studio .fv-header{height:65px;position:sticky;top:0;background:var(--fv-bg);z-index:3}.fv-studio .fv-body{display:flex;flex-direction:column;height:auto}.fv-studio .fv-controls{overflow:visible;border-right:0;border-bottom:1px solid var(--fv-border)}.fv-studio .fv-preview-column{min-height:420px}.fv-studio .fv-preview-space{height:min(65dvh,600px);min-height:260px;flex:none}.fv-studio .fv-runbar{position:static}.fv-studio .fv-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.fv-studio .fv-stat strong{font-size:var(--fv-body)}}-/* Recent videos only use space on wide windows; a zero third track restores the filled layout. */-.fv-studio .fv-recent,.fv-studio .fv-recent-toggle{display:none}+/* Recent videos take a column on wide windows; a zero third track restores the filled layout.+ Narrower windows open the same list as a panel over the preview, so the settings keep their width. */+.fv-studio .fv-recent{display:none}+.fv-studio .fv-preview-tools .fv-recent-toggle{display:inline-flex;width:var(--fv-h-sm);padding:5px}+.fv-studio .fv-recent-toggle:is([aria-pressed=true],[aria-expanded=true]){color:var(--fv-accent);border-color:var(--fv-accent);background:var(--fv-selected)}+.fv-recent-head{min-height:32px;box-sizing:content-box;padding:26px 20px 12px;font-size:var(--fv-body);font-weight:var(--fv-medium);white-space:nowrap}+.fv-recent-list{flex:1;min-height:0;overflow:auto;padding:0 10px 16px;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin;scrollbar-color:var(--fv-border) transparent;overscroll-behavior:contain}+.fv-studio .fv-recent-card{display:grid;grid-template-columns:112px minmax(0,1fr);grid-template-rows:auto auto;column-gap:12px;row-gap:2px;align-items:center;justify-content:stretch;flex:none;padding:6px;min-height:0;border:1px solid transparent;border-radius:var(--fv-r-md);background:transparent;text-align:left;font-weight:var(--fv-regular)}+.fv-recent-card .fv-library-picture{grid-row:1/3;width:112px;aspect-ratio:16/10}+.fv-recent-card>span{align-self:end;font-size:12px;color:var(--fv-ink)}+.fv-recent-card>small{align-self:start;font-size:11px;color:var(--fv-muted);font-variant-numeric:tabular-nums}@media(min-width:1680px){.fv-studio:not(.fv-library) .fv-body{grid-template-columns:460px minmax(0,1fr) 0;transition:grid-template-columns 200ms ease}.fv-studio:not(.fv-library) .fv-body[data-recent=true]{grid-template-columns:440px minmax(0,1fr) 296px}.fv-studio .fv-recent{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;border-left:1px solid var(--fv-border);background:color-mix(in srgb,var(--fv-bg) 70%,#000)}.fv-studio .fv-body[data-recent=false] .fv-recent{visibility:hidden;border-left-width:0}- .fv-studio .fv-preview-tools .fv-recent-toggle{display:inline-flex;width:var(--fv-h-sm);padding:5px}- .fv-studio .fv-recent-toggle[aria-pressed=true]{color:var(--fv-accent);border-color:var(--fv-accent);background:var(--fv-selected)}/* fitPreview follows the animated grid; a second size transition would delay the picture. */.fv-studio .fv-body.fv-recent-resizing .fv-stage{transition:none}- .fv-recent-head{min-height:32px;box-sizing:content-box;padding:26px 20px 12px;font-size:var(--fv-body);font-weight:var(--fv-medium);white-space:nowrap}- .fv-recent-list{flex:1;min-height:0;overflow:auto;padding:0 10px 16px;display:flex;flex-direction:column;gap:2px;scrollbar-width:thin;scrollbar-color:var(--fv-border) transparent;overscroll-behavior:contain}- .fv-studio .fv-recent-card{display:grid;grid-template-columns:112px minmax(0,1fr);grid-template-rows:auto auto;column-gap:12px;row-gap:2px;align-items:center;justify-content:stretch;flex:none;padding:6px;min-height:0;border:1px solid transparent;border-radius:var(--fv-r-md);background:transparent;text-align:left;font-weight:var(--fv-regular)}- .fv-recent-card .fv-library-picture{grid-row:1/3;width:112px;aspect-ratio:16/10}- .fv-recent-card>span{align-self:end;font-size:12px;color:var(--fv-ink)}- .fv-recent-card>small{align-self:start;font-size:11px;color:var(--fv-muted);font-variant-numeric:tabular-nums}+}+@media(max-width:1679px){+ .fv-studio:not(.fv-library) .fv-body{position:relative}+ .fv-studio .fv-body[data-recent-panel=true] .fv-recent{display:flex;flex-direction:column;position:absolute;z-index:5;top:var(--fv-recent-top,72px);right:var(--fv-recent-right,24px);bottom:16px;width:min(320px,calc(100% - 16px));overflow:hidden;border:1px solid var(--fv-border);border-radius:var(--fv-r-md);background:var(--fv-card);box-shadow:0 14px 45px #0006;animation:fv-preview-appear .16s ease}+ .fv-studio .fv-recent:focus{outline:none}+ .fv-studio .fv-recent .fv-recent-head{min-height:0;padding:14px 16px 10px}+ .fv-studio .fv-recent .fv-recent-list{padding:0 8px 10px}+ .fv-studio .fv-recent .fv-recent-card:not([aria-pressed=true]):hover{background:var(--fv-hover)}+}+@media(max-width:680px){+ /* Below the sticky header, which stays in place when the window scrolls. */+ .fv-studio .fv-body[data-recent-panel=true] .fv-recent{z-index:2;left:var(--fv-recent-right,12px);width:auto;bottom:auto;height:min(70dvh,560px)}}@media(min-width:2200px){.fv-studio:not(.fv-library) .fv-body[data-recent=true]{grid-template-columns:460px minmax(0,1fr) 320px}}@media(prefers-reduced-motion:reduce){.fv-studio *,.fv-studio *::before,.fv-studio *::after{transition:none!important;animation:none!important}}diff --git a/web/studio.js b/web/studio.jsindex 1ff0478..925b9cf 100644--- a/web/studio.js+++ b/web/studio.js@@ -2122,7 +2122,8 @@ export function openStudio(node, {extendFrom = null} = {}) {cleanup.push(listenDialogKey(dialog, 'keydown', escape));cleanup.push(isolateDialogKeys(dialog, event => routeDialogKey(event, dialog)));- dialog.addEventListener('cancel', e => { e.preventDefault(); closeDialog(dialog); });+ // Escape first closes the recent videos panel of a narrower window, then the studio.+ dialog.addEventListener('cancel', e => { e.preventDefault(); if (!recent.dismiss()) closeDialog(dialog); });dialog.onclose = () => { disposed = true; blockOriginal('extend', false); blockOriginal('preview', false); for (const f of cleanup) f(); stage.querySelector('video')?.pause(); dialog.remove(); if (current?.dialog === dialog) { current = null; viewChanged('nodes', node); } };capabilityView = createCapabilityView({node, api, t, getState: () => ({ratio,custom: selected === 'custom', steps: Number(baseSteps.value), twoPass: twoPass.checked,diff --git a/web/studio_recent.js b/web/studio_recent.jsindex a9de9ab..f1ded0f 100644--- a/web/studio_recent.js+++ b/web/studio_recent.js@@ -18,24 +18,68 @@ export function createRecentVideos(t, {body, onSelect}) {element.append(heading, list);const toggle = el('button', null, 'fv-recent-toggle'); toggle.type = 'button';toggle.append(icon('sidebar')); toggle.setAttribute('aria-controls', element.id);- let expanded = true, selected = null, disposed = false, request = null, resizeTimer = null;+ element.tabIndex = -1;+ // Wide windows give the list its own column, remembered across visits. Narrower windows show it+ // as a panel over the preview; it starts closed each time, so a saved column never covers the picture.+ const wide = window.matchMedia('(min-width:1680px)');+ let expanded = true, open = false, selected = null, disposed = false, request = null, resizeTimer = null;const cards = new Map();try { expanded = localStorage.getItem(KEY) !== 'false'; } catch {}function visibility() {+ const shown = wide.matches ? expanded : open;body.dataset.recent = String(expanded);- toggle.setAttribute('aria-pressed', String(expanded));- const label = expanded ? t('Hide recent videos', '收起最近作品') : t('Show recent videos', '显示最近作品');+ body.dataset.recentPanel = String(!wide.matches && open);+ // The column is a pressed state of the layout; the panel is a disclosure that opens and closes.+ toggle.setAttribute(wide.matches ? 'aria-pressed' : 'aria-expanded', String(shown));+ toggle.removeAttribute(wide.matches ? 'aria-expanded' : 'aria-pressed');+ const label = shown ? t('Hide recent videos', '收起最近作品') : t('Show recent videos', '显示最近作品');toggle.title = label; toggle.setAttribute('aria-label', label);- element.inert = !expanded; element.setAttribute('aria-hidden', String(!expanded));+ element.inert = !shown; element.setAttribute('aria-hidden', String(!shown));}visibility();+ // The panel hangs below the preview's tools, its right edge in line with theirs.+ function place() {+ const tools = toggle.parentElement?.getBoundingClientRect(), frame = body.getBoundingClientRect();+ if (!tools) return;+ body.style.setProperty('--fv-recent-top', `${Math.max(8, Math.round(tools.bottom - frame.top + 8))}px`);+ body.style.setProperty('--fv-recent-right', `${Math.max(8, Math.round(frame.right - tools.right))}px`);+ }+ function showPanel() {+ if (open || wide.matches) return;+ place(); open = true; visibility();+ const card = cards.get(selected) || cards.values().next().value;+ (card || element).focus({preventScroll: true});+ card?.scrollIntoView({block: 'nearest'});+ element.scrollIntoView({block: 'nearest'});+ }+ // Returns whether a panel was open. Escape and a chosen video hand focus back to the button.+ function hidePanel({restoreFocus = false} = {}) {+ if (!open) return false;+ open = false; visibility();+ if (restoreFocus) toggle.focus({preventScroll: true});+ return true;+ }toggle.onclick = () => {+ if (!wide.matches) { if (open) hidePanel(); else showPanel(); return; }// Let fitPreview follow the 200 ms grid change without a second size transition.clearTimeout(resizeTimer); body.classList.add('fv-recent-resizing');resizeTimer = setTimeout(() => body.classList.remove('fv-recent-resizing'), 250);expanded = !expanded; visibility();try { localStorage.setItem(KEY, String(expanded)); } catch {}};+ // A press anywhere else, or focus moving elsewhere, closes the panel without taking focus.+ const outside = event => {+ if (open && !element.contains(event.target) && !toggle.contains(event.target)) hidePanel();+ };+ element.addEventListener('focusout', event => {+ const next = event.relatedTarget;+ if (open && next && !element.contains(next) && next !== toggle) hidePanel();+ });+ document.addEventListener('pointerdown', outside, true);+ const layout = () => { open = false; visibility(); };+ const resized = () => { if (open) place(); };+ wide.addEventListener('change', layout);+ window.addEventListener('resize', resized);const thumbnails = new IntersectionObserver(entries => {for (const {target, isIntersecting} of entries) if (isIntersecting) {target.src = target.dataset.src; thumbnails.unobserve(target);@@ -59,7 +103,7 @@ export function createRecentVideos(t, {body, onSelect}) {const card = el('button', null, 'fv-recent-card'); card.type = 'button';const date = videoTimestamp(row, t), dimensions = videoDimensions(row);card.setAttribute('aria-label', `${date} · ${dimensions}`);- card.onclick = () => onSelect(row);+ card.onclick = () => { onSelect(row); hidePanel({restoreFocus: true}); };const picture = el('div', null, 'fv-library-picture');const image = el('img'); image.alt = ''; image.decoding = 'async';image.dataset.src = videoThumbnailURL(row);@@ -91,8 +135,10 @@ export function createRecentVideos(t, {body, onSelect}) {window.addEventListener('freevideo-result', completed);window.addEventListener('freevideo-library-deleted', deleted);window.addEventListener('freevideo-library-restored', refresh);- return {element, toggle, refresh, setSelected, dispose() {+ return {element, toggle, refresh, setSelected, dismiss: () => hidePanel({restoreFocus: true}), dispose() {disposed = true; request?.abort(); thumbnails.disconnect();+ document.removeEventListener('pointerdown', outside, true);+ wide.removeEventListener('change', layout); window.removeEventListener('resize', resized);clearTimeout(resizeTimer); body.classList.remove('fv-recent-resizing');window.removeEventListener('freevideo-result', completed);window.removeEventListener('freevideo-library-deleted', deleted);