feat: replace video placeholder icons with interactive video elements in preview components
This commit is contained in:
parent
d6546aeba6
commit
3519e1307b
2 changed files with 35 additions and 26 deletions
|
|
@ -466,19 +466,23 @@ export default function AddPage() {
|
|||
key={`${item.url}-${index}`}
|
||||
className={`group relative block cursor-pointer overflow-hidden border bg-white/20 transition ${selected[index] ? "border-foreground/35" : "border-border"}`}
|
||||
>
|
||||
<img
|
||||
src={item.url}
|
||||
alt={`preview ${index + 1}`}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className={`aspect-4/5 w-full object-cover transition ${selected[index] ? "opacity-100" : "opacity-35 grayscale-20"}`}
|
||||
/>
|
||||
{item.type === "video" && (
|
||||
<div className="absolute inset-0 flex items-center justify-center bg-black/10">
|
||||
<svg className="h-10 w-10 text-white/80 drop-shadow-md" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fillRule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clipRule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
{item.type === "video" ? (
|
||||
<video
|
||||
src={item.url}
|
||||
autoPlay
|
||||
muted
|
||||
loop
|
||||
playsInline
|
||||
className={`aspect-4/5 w-full object-cover transition ${selected[index] ? "opacity-100" : "opacity-35 grayscale-20"}`}
|
||||
/>
|
||||
) : (
|
||||
<img
|
||||
src={item.url}
|
||||
alt={`preview ${index + 1}`}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className={`aspect-4/5 w-full object-cover transition ${selected[index] ? "opacity-100" : "opacity-35 grayscale-20"}`}
|
||||
/>
|
||||
)}
|
||||
<div className="absolute left-2 top-2 border border-border/60 bg-background/80 px-2 py-1 text-xs backdrop-blur">
|
||||
<input
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue