diff --git a/src/components/home/HeroVideo.tsx b/src/components/home/HeroVideo.tsx index d8f43b3..a0654e1 100644 --- a/src/components/home/HeroVideo.tsx +++ b/src/components/home/HeroVideo.tsx @@ -21,7 +21,7 @@ export default function HeroVideo({ locale = "sr" }: HeroVideoProps) { }; return ( -
+
{/* Background Image with Overlay */}
; + const sectionRef = useRef(null); + + useEffect(() => { + const observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + entry.target.classList.add("animate-visible"); + observer.unobserve(entry.target); + } + }); + }, + { threshold: 0.1 } + ); + + const animatedElements = sectionRef.current?.querySelectorAll(".animate-on-scroll"); + animatedElements?.forEach((el) => observer.observe(el)); + + return () => observer.disconnect(); + }, []); return ( -
+
@@ -55,21 +76,6 @@ export default function ProblemSection() {
-