diff --git a/src/app/work/page.tsx b/src/app/work/page.tsx new file mode 100644 index 0000000..8758d02 --- /dev/null +++ b/src/app/work/page.tsx @@ -0,0 +1,182 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarLayoutFloatingOverlay from "@/components/navbar/NavbarLayoutFloatingOverlay/NavbarLayoutFloatingOverlay"; +import { useEffect, useRef, useState } from "react"; +import { Play } from "lucide-react"; + +interface Clip { + id: string; + src: string; + type: "video" | "image"; + title: string; +} + +const clips: Clip[] = [ + { + id: "1", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3Ab38TzdGBnNuMLrvS5uTUM2zMr/uploaded-1772881146961-mr1xedhd.jpg", type: "image", title: "Viral Clip 1"}, + { + id: "2", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3Ab38TzdGBnNuMLrvS5uTUM2zMr/uploaded-1772881146961-h65hjshx.jpg", type: "image", title: "Viral Clip 2"}, + { + id: "3", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3Ab38TzdGBnNuMLrvS5uTUM2zMr/uploaded-1772881750051-0ym5nbmx.jpg", type: "image", title: "Viral Clip 3"}, + { + id: "4", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3Ab38TzdGBnNuMLrvS5uTUM2zMr/uploaded-1772881146961-1pjxjkc4.jpg", type: "image", title: "Viral Clip 4"}, + { + id: "5", src: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3Ab38TzdGBnNuMLrvS5uTUM2zMr/uploaded-1772881146961-mr1xedhd.jpg", type: "image", title: "Viral Clip 5"}, +]; + +export default function WorkPage() { + const scrollContainerRef = useRef(null); + const [playingId, setPlayingId] = useState(null); + + useEffect(() => { + const scrollContainer = scrollContainerRef.current; + if (!scrollContainer) return; + + let scrollPosition = 0; + const scrollSpeed = 1; + const containerWidth = scrollContainer.scrollWidth; + const viewportWidth = scrollContainer.clientWidth; + + const scroll = () => { + scrollPosition += scrollSpeed; + if (scrollPosition >= containerWidth - viewportWidth) { + scrollPosition = 0; + } + scrollContainer.scrollLeft = scrollPosition; + }; + + const interval = setInterval(scroll, 30); + return () => clearInterval(interval); + }, []); + + const handleClipClick = (clipId: string) => { + setPlayingId(playingId === clipId ? null : clipId); + }; + + return ( + + + +
+
+
+

+ My Work +

+

+ Scroll through my latest viral clips and shortform content +

+
+ + {/* Horizontal Scrolling Container */} +
+
+ {/* Duplicate clips to create infinite loop effect */} + {[...clips, ...clips].map((clip, index) => ( +
handleClipClick(clip.id)} + > + {/* Clip Container */} +
+ {/* Image/Video */} + {clip.type === "image" ? ( + {clip.title} + ) : ( +
+ + {/* Title */} +
+

+ {clip.title} +

+
+
+ ))} +
+
+ + {/* Info text */} +
+

+ 👆 Scroll horizontally • Click any clip to play +

+
+
+
+
+ ); +}