feat: add 3s scroll-pause video auto-play to homepage Signature Menu + update Menu page to 3s
- Duplicated mobile scroll-pause logic (3s timeout) to homepage Signature Menu (using .signature-card + .relative.h-48 structure, with video support added to signatureDishes). - Updated both /menu and homepage Signature Menu from 2s to 3s pause before playing video on scroll stop. - Added onMouse handlers for desktop hover consistency on signature cards. - Maintains posters while scrolling, plays video after 3s pause on item. - Desktop hover behavior preserved. - Builds cleanly.
This commit is contained in:
+2
-2
@@ -68,7 +68,7 @@ export default function MenuPage() {
|
||||
window.scrollTo({ top: 220, behavior: "smooth" });
|
||||
};
|
||||
|
||||
// Mobile video auto-play on scroll pause (2s)
|
||||
// Mobile video auto-play on scroll pause (3s)
|
||||
useEffect(() => {
|
||||
const updateMobile = () => setIsMobile(window.innerWidth < 768);
|
||||
updateMobile();
|
||||
@@ -149,7 +149,7 @@ export default function MenuPage() {
|
||||
if (focusedId) {
|
||||
playMobileVideo(focusedId);
|
||||
}
|
||||
}, 2000);
|
||||
}, 3000);
|
||||
};
|
||||
window.addEventListener("scroll", onScrollOrTouch, { passive: true });
|
||||
window.addEventListener("touchmove", onScrollOrTouch, { passive: true });
|
||||
|
||||
Reference in New Issue
Block a user