From b49a83baafd1b439d891da0a1c3a002f23d06f98 Mon Sep 17 00:00:00 2001 From: kudindmitriy Date: Wed, 25 Feb 2026 17:31:17 +0200 Subject: [PATCH] Bob AI: Add fancy animations across the website including: fade-in a --- src/app/page.tsx | 46 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) 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 ( -
+
-
+
-
+
-
+
-
+