auto-save 2026-05-13 15:33 (~4)
This commit is contained in:
@@ -317,8 +317,8 @@ export default function Home() {
|
||||
<>
|
||||
<div className="canvas-bg" />
|
||||
<main className="relative h-screen w-screen overflow-hidden flex">
|
||||
{/* 主题切换 — 左下角 */}
|
||||
<div className="absolute bottom-3 left-3 z-30 pointer-events-auto">
|
||||
{/* 主题切换 — 左下角 Controls 上方(错开) */}
|
||||
<div className="absolute z-30 pointer-events-auto" style={{ bottom: 180, left: 12 }}>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -479,19 +479,25 @@ export function KeyframeNode({ data, selected }: any) {
|
||||
)}
|
||||
</NodeShell>
|
||||
|
||||
{/* Portal hover 预览 — 固定视口右下角,不遮挡 */}
|
||||
{/* Portal hover 预览 — 缩略图正上方展开(DAG 画布上方空旷) */}
|
||||
{mounted && hover && jobId && (() => {
|
||||
const hf = frames.find((x) => x.index === hover.idx)
|
||||
if (!hf) return null
|
||||
const vidAspect = d.job && d.job.height > 0 ? d.job.height / d.job.width : 16 / 9
|
||||
const w = 280
|
||||
const h = w * vidAspect
|
||||
const gap = 12
|
||||
// 高度优先:不超过缩略图上方可用空间,也不超过视口 80vh
|
||||
const maxH = Math.max(160, Math.min(window.innerHeight * 0.8, hover.rect.top - gap - 12))
|
||||
const maxW = Math.min(window.innerWidth * 0.45, 480)
|
||||
let h = maxH, w = h / vidAspect
|
||||
if (w > maxW) { w = maxW; h = w * vidAspect }
|
||||
const centerX = hover.rect.left + hover.rect.width / 2
|
||||
const left = Math.max(12, Math.min(window.innerWidth - w - 12, centerX - w / 2))
|
||||
const top = hover.rect.top - h - gap
|
||||
return createPortal(
|
||||
<div
|
||||
className="fixed z-[120] pointer-events-none"
|
||||
style={{
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left, top,
|
||||
animation: "drawer-in 0.18s cubic-bezier(0.32, 0.72, 0, 1)",
|
||||
}}
|
||||
>
|
||||
@@ -717,21 +723,26 @@ export function ImageGenNode({ data, selected }: any) {
|
||||
)}
|
||||
</NodeShell>
|
||||
|
||||
{/* Portal hover 预览 — 固定视口右下角,不遮挡 */}
|
||||
{/* Portal hover 预览 — 缩略图正上方展开 */}
|
||||
{mounted && hover && job && (() => {
|
||||
const [fi, ei] = hover.key.split("_")
|
||||
const frameIdx = parseInt(fi, 10)
|
||||
const p = elementCrops.find((x) => x.frameIdx === frameIdx && x.elementId === ei)
|
||||
if (!p) return null
|
||||
const vidAspect = job.height > 0 ? job.height / job.width : 16 / 9
|
||||
const w = 280
|
||||
const h = w * vidAspect
|
||||
const gap = 12
|
||||
const maxH = Math.max(160, Math.min(window.innerHeight * 0.8, hover.rect.top - gap - 12))
|
||||
const maxW = Math.min(window.innerWidth * 0.45, 480)
|
||||
let h = maxH, w = h / vidAspect
|
||||
if (w > maxW) { w = maxW; h = w * vidAspect }
|
||||
const centerX = hover.rect.left + hover.rect.width / 2
|
||||
const left = Math.max(12, Math.min(window.innerWidth - w - 12, centerX - w / 2))
|
||||
const top = hover.rect.top - h - gap
|
||||
return createPortal(
|
||||
<div
|
||||
className="fixed z-[120] pointer-events-none"
|
||||
style={{
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left, top,
|
||||
animation: "drawer-in 0.18s cubic-bezier(0.32, 0.72, 0, 1)",
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -213,17 +213,23 @@ export function StoryboardBar({ job, selectedFrames, focusedFrame, onFocusFrame,
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Hover 预览 · 固定视口右下角,不遮挡 */}
|
||||
{/* Hover 预览 · 浮在缩略图侧面(右侧优先 / 不够则左侧) */}
|
||||
{mounted && hover && (() => {
|
||||
const vidAspect = job.height > 0 ? job.height / job.width : 16 / 9
|
||||
const w = 280
|
||||
const w = 320
|
||||
const h = w * vidAspect
|
||||
const gap = 16
|
||||
let left = hover.rect.right + gap
|
||||
if (left + w > window.innerWidth - 12) left = hover.rect.left - w - gap
|
||||
if (left < 12) left = 12
|
||||
let top = hover.rect.top + hover.rect.height / 2 - h / 2
|
||||
if (top < 12) top = 12
|
||||
if (top + h > window.innerHeight - 12) top = window.innerHeight - h - 12
|
||||
return createPortal(
|
||||
<div
|
||||
className="fixed z-[120] pointer-events-none"
|
||||
style={{
|
||||
right: 20,
|
||||
bottom: 20,
|
||||
left, top,
|
||||
animation: "drawer-in 0.18s cubic-bezier(0.32, 0.72, 0, 1)",
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user