diff --git a/src/app/page.tsx b/src/app/page.tsx index 8372438..b22a374 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,4 +1,5 @@ "use client"; +import { useEffect, useRef } from 'react'; import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; import HeroBillboardGallery from '@/components/sections/hero/HeroBillboardGallery'; import AboutMetric from '@/components/sections/about/AboutMetric'; @@ -11,6 +12,41 @@ import { Users, Calendar, Award, Clock, Sparkles, MessageSquare, MessageCircle, import Link from 'next/link'; export default function HomePage() { + const heroRef = useRef(null); + + useEffect(() => { + const handleScroll = () => { + if (heroRef.current) { + const scrollY = window.scrollY; + heroRef.current.style.transform = `translateY(${scrollY * 0.5}px)`; + } + }; + + const observerOptions = { + threshold: 0.1, + rootMargin: '0px 0px -100px 0px' + }; + + const observer = new IntersectionObserver((entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + entry.target.classList.add('animate-fade-in-up'); + } + }); + }, observerOptions); + + document.querySelectorAll('[data-section]').forEach((section) => { + observer.observe(section); + }); + + window.addEventListener('scroll', handleScroll); + + return () => { + window.removeEventListener('scroll', handleScroll); + observer.disconnect(); + }; + }, []); + return ( -
+
-
+
-
+
-
+
-
+