auto-save 2026-05-14 03:09 (~3)
This commit is contained in:
@@ -86,9 +86,10 @@ export function HoverPreview({
|
||||
return Math.min(1, maxWidth / naturalSize.width, maxHeight / naturalSize.height)
|
||||
}, [naturalSize, viewport.height, viewport.width])
|
||||
|
||||
const metadataText = naturalSize
|
||||
? `原始 ${naturalSize.width}×${naturalSize.height} · ${actualSize ? "1:1" : `Fit ${Math.round((fitScale ?? 1) * 100)}%`}`
|
||||
: actualSize ? "1:1" : "Fit"
|
||||
const dimensionText = naturalSize ? `${naturalSize.width} × ${naturalSize.height}` : "读取中"
|
||||
const scaleText = naturalSize
|
||||
? actualSize ? "1:1 原寸" : `Fit ${Math.round((fitScale ?? 1) * 100)}%`
|
||||
: actualSize ? "1:1 原寸" : "Fit"
|
||||
|
||||
const visibilityCls = shown
|
||||
? pinned ? "opacity-100 pointer-events-auto" : "opacity-100 pointer-events-none"
|
||||
@@ -124,8 +125,18 @@ export function HoverPreview({
|
||||
<div className={`relative rounded-lg overflow-hidden border-2 bg-black shadow-2xl ${pinned ? "ring-2 ring-violet-400/70" : ""} ${borderClass}`}
|
||||
style={previewFrameStyle}>
|
||||
{shown && (
|
||||
<div className="absolute left-1.5 top-1.5 z-10 rounded-md bg-black/75 px-2 py-1 text-[10px] font-mono leading-none text-white shadow-lg backdrop-blur">
|
||||
{metadataText}
|
||||
<div className="absolute left-2 top-2 z-10 overflow-hidden rounded-lg border border-white/25 bg-black/88 text-white shadow-[0_10px_30px_rgba(0,0,0,0.42)] backdrop-blur">
|
||||
<div className="border-b border-white/12 bg-white/10 px-2.5 py-1 text-[9.5px] font-semibold leading-none text-white/72">
|
||||
原始尺寸
|
||||
</div>
|
||||
<div className="flex items-baseline gap-2 px-2.5 py-1.5">
|
||||
<span className="font-mono text-[15px] font-bold leading-none text-white">
|
||||
{dimensionText}
|
||||
</span>
|
||||
<span className="rounded bg-violet-500/28 px-1.5 py-0.5 text-[10px] font-semibold leading-none text-violet-100">
|
||||
{scaleText}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{videoSrc ? (
|
||||
|
||||
Reference in New Issue
Block a user