auto-save 2026-05-14 01:40 (+4, ~2)

This commit is contained in:
2026-05-14 01:40:24 +08:00
parent 9f706f796b
commit d04ec565a4
6 changed files with 961 additions and 9 deletions

View File

@@ -18,8 +18,6 @@ interface Props {
label?: string
caption?: string
borderClass?: string
maxW?: string // 默认 "min(70vw, 1200px)"
maxH?: string // 默认 "min(70vh, 800px)"
pinned?: boolean
onClose?: () => void
}
@@ -28,8 +26,6 @@ export function HoverPreview({
imgSrc, videoSrc, poster, aspect,
label, caption,
borderClass = "border-violet-300/55",
maxW = "min(70vw, 1200px)",
maxH = "min(70vh, 800px)",
pinned = false,
onClose,
}: Props) {
@@ -46,14 +42,13 @@ export function HoverPreview({
transformOrigin: "bottom center",
}}
>
<div className={`relative rounded-lg overflow-hidden border-2 bg-black shadow-2xl ${pinned ? "ring-2 ring-violet-400/70" : ""} ${borderClass}`}>
<div className={`relative rounded-lg overflow-hidden border-2 bg-black shadow-2xl ${pinned ? "ring-2 ring-violet-400/70" : ""} ${borderClass}`}
style={{ width: "max-content" }}>
{videoSrc ? (
<video src={videoSrc} poster={poster} muted loop playsInline autoPlay
className="block object-contain"
style={{ maxWidth: maxW, maxHeight: maxH }} />
className="block" style={{ maxWidth: "none" }} />
) : imgSrc ? (
<img src={imgSrc} alt="" className="block object-contain"
style={{ maxWidth: maxW, maxHeight: maxH }} />
<img src={imgSrc} alt="" className="block" style={{ maxWidth: "none" }} />
) : (
<div className="w-40 h-40 bg-black/40" />
)}