feat(projects): video de rolagem na capa dos cards, carregado so quando o card aparece
video autoplay muted loop playsinline preload=none com poster; as fontes entram via IntersectionObserver e o video pausa fora da tela. Com prefers-reduced-motion aparece so o poster. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
ca9c0604b8
commit
a67892613b
6 files changed
+276
-2
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import Image from "next/image";
|
||||
import { getProjectVideo } from "@/lib/project-videos";
|
||||
import { ProjectVideo } from "./ProjectVideo";
|
||||
|
||||
type CoverProject = { id: string; title: string };
|
||||
|
||||
@@ -31,8 +33,17 @@ export function ProjectCover({
|
||||
project: CoverProject;
|
||||
priority?: boolean;
|
||||
}) {
|
||||
const video = getProjectVideo(project.id);
|
||||
const src = SCREENSHOTS[project.id];
|
||||
|
||||
if (video) {
|
||||
return (
|
||||
<div className="ds-cover">
|
||||
<ProjectVideo video={video} title={project.title} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (src) {
|
||||
return (
|
||||
<div className="ds-cover">
|
||||
|
||||
Reference in new issue
Block a user