diff --git a/components/canvas/LiblibVideoCanvasReplica.tsx b/components/canvas/LiblibVideoCanvasReplica.tsx index 9b19f47f7..964c0558f 100644 --- a/components/canvas/LiblibVideoCanvasReplica.tsx +++ b/components/canvas/LiblibVideoCanvasReplica.tsx @@ -3730,24 +3730,60 @@ function SceneToolbarPopover({ onSelect?: (option?: string) => void; }) { const [lightingPrompt, setLightingPrompt] = useState(""); - const quickOptions: Record, string[]> = { - crop: ["4 宫格切分", "9 宫格切分", "16 宫格切分", "25 宫格切分"], - grid: ["2 x 2", "3 x 3", "4 x 4", "自定义宫格"], - hd: ["2倍高清", "4倍高清"], + const [customGridOpen, setCustomGridOpen] = useState(false); + const popoverOffset: Record, number> = { + crop: 170, + grid: -38, + hd: 70, + lighting: -145, + orbit: -245, + panorama: -360, + }; + const officialPopoverStyle = { + left: anchor ? anchor.centerX + popoverOffset[menu] : `calc(50% + ${popoverOffset[menu]}px)`, + top: anchor ? anchor.topY - (24 * anchor.zoom + 10) + 8 : 168, + }; + const popoverSurfaceStyle = { + background: "rgba(31, 31, 31, 0.92)", + border: "0.5px solid #363636", + borderRadius: 12, + boxShadow: "0 4px 10px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12)", + WebkitBackdropFilter: "blur(16px)", + backdropFilter: "blur(16px)", + }; + const quickOptions: Record<"orbit" | "panorama", string[]> = { orbit: ["正侧背三视角", "八方向参考", "环绕镜头"], panorama: ["全景", "半身", "近景"], }; + const nineGridOptions = [ + "多机位九宫格", + "剧情推演四宫格", + "25宫格连贯分镜", + "电影级光影校正", + "角色三视图生成", + "画面推演 - 3秒后", + "画面推演 - 5秒前", + ]; + const hdToolOptions: Array<{ key: string; label: string; active?: boolean }> = [ + { key: "upscale", label: "高清", active: true }, + { key: "outpaint", label: "扩图" }, + { key: "repaint", label: "重绘" }, + { key: "erase", label: "擦除" }, + { key: "removeBg", label: "抠图" }, + { key: "crop", label: "裁剪" }, + ]; + const cropOptions = [ + { type: 4, label: "4宫格 (2×2)" }, + { type: 9, label: "9宫格 (3×3)" }, + { type: 16, label: "16宫格 (4×4)" }, + { type: 25, label: "25宫格 (5×5)" }, + ]; if (menu === "lighting") { return (
打光
@@ -3770,19 +3806,117 @@ function SceneToolbarPopover({ ); } + if (menu === "grid") { + return ( +
+ {nineGridOptions.map((option) => ( + + ))} +
+ ); + } + + if (menu === "hd") { + return ( +
+ {hdToolOptions.map((option) => ( + + ))} +
+ ); + } + + if (menu === "crop") { + return ( +
+ {cropOptions.map((option) => ( + + ))} +
+
setCustomGridOpen(true)} onMouseLeave={() => setCustomGridOpen(false)}> + + {customGridOpen ? ( +
setCustomGridOpen(true)} + onMouseLeave={() => setCustomGridOpen(false)} + style={popoverSurfaceStyle} + > + onSelect?.(`${rows} x ${columns}`)} /> +
+ ) : null} +
+
+ ); + } + return (
{quickOptions[menu].map((option) => (
+
+ ); +} + function SceneToolIcon({ kind }: { kind: "panorama" | "orbit" | "lighting" | "grid" | "hd" | "crop" }) { if (kind === "panorama") { return 720;