From e3b18eba3917347ff02ecb47a49f4e5acc35dac9 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 25 Aug 2026 12:50:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A2=84=E8=A7=88=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E6=89=8B=E6=9C=BA=E9=A3=8E=E6=A0=BC=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E6=94=B9=E9=80=A0=20=E2=80=94=209:16=E7=AB=96=E5=B1=8F?= =?UTF-8?q?=E5=A4=96=E6=A1=86+=E6=AF=9B=E7=8E=BB=E7=92=83=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=9D=A1+=E7=B2=BE=E8=87=B4=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - generate.css: 右侧栏 320px→400px,改为 align-items:center 水平居中手机框 - FrontendPreviewPlayer: 容器改为 aspectRatio 9/16 + maxWidth 360px - borderRadius 28px + boxShadow 营造手机外框质感 - 中央播放按钮 72px 圆形毛玻璃,hover 缩放效果 - 控制条毛玻璃效果(backdropFilter blur),白色进度条 - 片段指示器移至右上角胶囊形状 - 空状态/错误状态也在 9:16 手机框内居中显示 - 视频保持 objectFit:contain,竖屏填满横屏居中黑边 --- .../components/FrontendPreviewPlayer.tsx | 173 ++++++++++++------ apps/web/src/pages/generate/generate.css | 6 +- 2 files changed, 119 insertions(+), 60 deletions(-) diff --git a/apps/web/src/pages/generate/components/FrontendPreviewPlayer.tsx b/apps/web/src/pages/generate/components/FrontendPreviewPlayer.tsx index 74dcec059..33c2f72e7 100644 --- a/apps/web/src/pages/generate/components/FrontendPreviewPlayer.tsx +++ b/apps/web/src/pages/generate/components/FrontendPreviewPlayer.tsx @@ -277,20 +277,29 @@ const FrontendPreviewPlayer: React.FC = ({ if (!ready || !assets.length) { return (
- -

准备预览素材...

-

加载素材后即可预览播放

+ +

+ 准备预览素材... +

+

+ 加载素材后即可预览播放 +

) } @@ -300,31 +309,48 @@ const FrontendPreviewPlayer: React.FC = ({ const showDecodeError = forceVideoFallback && canvasState.hasDecodeError return (
{isBuffering ? ( <> - -

加载中...

+ +

加载中...

) : showDecodeError ? ( <> - -

+ +

视频解码失败

{canvasState.errorMessage || "当前浏览器不支持该视频编码格式,请刷新重试"}

@@ -332,10 +358,14 @@ const FrontendPreviewPlayer: React.FC = ({ ) : ( <> -

暂无可播放素材

-

请先在左侧选择素材

+

+ 暂无可播放素材 +

+

+ 请先在左侧选择素材 +

)}
@@ -347,11 +377,13 @@ const FrontendPreviewPlayer: React.FC = ({ style={{ position: "relative", width: "100%", - height: "100%", - minHeight: 400, - background: "#000", - borderRadius: 8, + maxWidth: 360, + aspectRatio: "9 / 16", + background: "#0a0a0a", + borderRadius: 28, overflow: "hidden", + boxShadow: + "0 4px 6px -1px rgba(0,0,0,0.3), 0 20px 50px -12px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.06)", }} > {/* ── Canvas 渲染层(WebCodecs 路径) ── */} @@ -447,54 +479,69 @@ const FrontendPreviewPlayer: React.FC = ({ )} - {/* 播放按钮 */} + {/* 中央播放按钮 */} {!isPlaying && ( )} - {/* 片段指示器 */} + {/* 片段指示器 — 右上角胶囊 */}
- {`片段 ${videoCurrentSegIdx + 1}/${segments.length}`} + {`${videoCurrentSegIdx + 1} / ${segments.length}`}
- {/* 控制条 */} + {/* 控制条 — 手机风格毛玻璃 */}
= ({ right: 0, display: "flex", alignItems: "center", - gap: 8, - padding: "8px 12px", - background: "linear-gradient(transparent, rgba(0,0,0,0.6))", + gap: 10, + padding: "12px 16px 16px", + background: "linear-gradient(transparent, rgba(0,0,0,0.7))", + backdropFilter: "blur(4px)", + WebkitBackdropFilter: "blur(4px)", zIndex: 10, }} >