Skip to content

Commit 088e7ba

Browse files
committed
feat(web): adjust hero video timing to start at 3s and end after full playback
1 parent 35a9819 commit 088e7ba

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

web/src/components/sections/Hero.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ export default function Hero() {
88
const [isVideoVisible, setIsVideoVisible] = useState(false);
99

1010
useEffect(() => {
11-
const timer = setTimeout(() => {
11+
// Show the video after 3 seconds (allowing it to initialize and hide controls)
12+
const showTimer = setTimeout(() => {
1213
setIsVideoVisible(true);
13-
}, 6000);
14-
return () => clearTimeout(timer);
14+
}, 3000);
15+
16+
// Hide the video and return to static image after the video ends (3s delay + 89s video duration = 92s)
17+
const hideTimer = setTimeout(() => {
18+
setIsVideoVisible(false);
19+
}, 92000);
20+
21+
return () => {
22+
clearTimeout(showTimer);
23+
clearTimeout(hideTimer);
24+
};
1525
}, []);
1626

1727
return (
@@ -45,7 +55,7 @@ export default function Hero() {
4555
}}
4656
/>
4757
<iframe
48-
src="https://www.youtube.com/embed/OXt-yg_7qdk?autoplay=1&mute=1&loop=1&playlist=OXt-yg_7qdk&controls=0&modestbranding=1&disablekb=1&playsinline=1&rel=0"
58+
src="https://www.youtube.com/embed/OXt-yg_7qdk?autoplay=1&mute=1&controls=0&modestbranding=1&disablekb=1&playsinline=1&rel=0"
4959
title="Patternflow Demo Video"
5060
frameBorder="0"
5161
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"

0 commit comments

Comments
 (0)