'use client'; import { usePageVisibility } from '@/hooks/usePageVisibility'; import { useIntersectionObserver } from '@/hooks/useIntersectionObserver'; const GlobalBackground = () => { const isPageVisible = usePageVisibility(); const { ref, isIntersecting } = useIntersectionObserver({ threshold: 0.1, rootMargin: '0px' }); const shouldAnimate = isPageVisible && isIntersecting; return ( <> {/* Background layer */}
{/* Gradient overlay */}
{/* Animated lines */}
{shouldAnimate && ( <> )} {shouldAnimate && ( )} {shouldAnimate && ( <> )}
{/* Grid overlay */}
); }; export default GlobalBackground;