diff --git a/src/components/sections/Hero.tsx b/src/components/sections/Hero.tsx index 23e9b76..6802444 100644 --- a/src/components/sections/Hero.tsx +++ b/src/components/sections/Hero.tsx @@ -6,6 +6,8 @@ import { FloatingHearts } from "@/components/ui/FloatingHearts"; import { HeroLogo } from "@/components/ui/HeroLogo"; import type { SiteContent } from "@/types/content"; +const VIDEOS = ["/video/ira.mp4", "/video/nadezda.mp4", "/video/nastya-2.mp4"]; + interface HeroProps { data: SiteContent["hero"]; } @@ -15,10 +17,9 @@ export function Hero({ data: hero }: HeroProps) { const scrolledRef = useRef(false); const scrollToNext = useCallback(() => { - const hero = sectionRef.current; - if (!hero) return; - // Find the next sibling section - let next = hero.nextElementSibling; + const el = sectionRef.current; + if (!el) return; + let next = el.nextElementSibling; while (next && next.tagName !== "SECTION") { next = next.nextElementSibling; } @@ -26,76 +27,82 @@ export function Hero({ data: hero }: HeroProps) { }, []); useEffect(() => { - const hero = sectionRef.current; - if (!hero) return; + const el = sectionRef.current; + if (!el) return; function handleWheel(e: WheelEvent) { - // Only trigger when scrolling down and still inside hero if (e.deltaY <= 0 || scrolledRef.current) return; - if (window.scrollY > 10) return; // already scrolled past hero top - + if (window.scrollY > 10) return; scrolledRef.current = true; scrollToNext(); - - // Reset after animation completes setTimeout(() => { scrolledRef.current = false; }, 1000); } function handleTouchStart(e: TouchEvent) { - (hero as HTMLElement).dataset.touchY = String(e.touches[0].clientY); + (el as HTMLElement).dataset.touchY = String(e.touches[0].clientY); } function handleTouchEnd(e: TouchEvent) { - const startY = Number((hero as HTMLElement).dataset.touchY); + const startY = Number((el as HTMLElement).dataset.touchY); const endY = e.changedTouches[0].clientY; - const diff = startY - endY; - - // Swipe down (finger moves up) with enough distance - if (diff > 50 && !scrolledRef.current && window.scrollY < 10) { + if (startY - endY > 50 && !scrolledRef.current && window.scrollY < 10) { scrolledRef.current = true; scrollToNext(); setTimeout(() => { scrolledRef.current = false; }, 1000); } } - hero.addEventListener("wheel", handleWheel, { passive: true }); - hero.addEventListener("touchstart", handleTouchStart, { passive: true }); - hero.addEventListener("touchend", handleTouchEnd, { passive: true }); + el.addEventListener("wheel", handleWheel, { passive: true }); + el.addEventListener("touchstart", handleTouchStart, { passive: true }); + el.addEventListener("touchend", handleTouchEnd, { passive: true }); return () => { - hero.removeEventListener("wheel", handleWheel); - hero.removeEventListener("touchstart", handleTouchStart); - hero.removeEventListener("touchend", handleTouchEnd); + el.removeEventListener("wheel", handleWheel); + el.removeEventListener("touchstart", handleTouchStart); + el.removeEventListener("touchend", handleTouchEnd); }; }, [scrollToNext]); return (
- {/* Animated gradient background */} -
- - {/* Glow orbs */} -
-
+ {/* Diagonal split background — 3 dancer videos */} +
+ {VIDEOS.map((src, i) => { + const positions = [ + { left: "0%", width: "38%" }, + { left: "31%", width: "38%" }, + { left: "62%", width: "38%" }, + ]; + const clips = [ + "polygon(0 0, 100% 0, 86% 100%, 0 100%)", + "polygon(14% 0, 100% 0, 86% 100%, 0 100%)", + "polygon(14% 0, 100% 0, 100% 100%, 0 100%)", + ]; + return ( +
+ +
+
+ ); + })} + {/* Gold diagonal lines between panels */} + + + + +
{/* Floating hearts */} @@ -103,7 +110,6 @@ export function Hero({ data: hero }: HeroProps) { {/* Content */}
- {/* Soft ambient glow behind heart */}
-
); }