This project now includes GSAP animations with split text effects for enhanced user experience.
- Split Text Animations: Character, word, and line-based text animations
- Scroll-Triggered Animations: Elements animate when they come into view
- Reusable Components: Easy-to-use animated components
- Customizable: Configurable duration, stagger, easing, and delays
A reusable component for text animations with split text effects.
import AnimatedText from "@/components/AnimatedText";
<AnimatedText
animationType="chars"
duration={1.2}
stagger={0.03}
ease="power3.out"
delay={0.5}
>
Your text here
</AnimatedText>;Props:
animationType: "chars" | "words" | "lines" | "fadeIn"duration: Animation duration in secondsstagger: Delay between each element animationdelay: Initial delay before animation startsease: GSAP easing functiony: Initial Y offset for elements
A wrapper component for scroll-triggered animations.
import AnimatedSection from "@/components/AnimatedSection";
<AnimatedSection animationType="slideUp" delay={0.2} duration={1}>
<YourComponent />
</AnimatedSection>;Props:
animationType: "fadeIn" | "slideUp" | "scaleIn"delay: Initial delay before animation startsduration: Animation duration in secondstrigger: Scroll trigger point (default: "top 80%")
Custom hook for GSAP animations.
import { useGSAP } from "@/lib/hooks/useGSAP";
const { elementRef, animateText, animateIn, animateOnScroll } = useGSAP();<Title>
<AnimatedText
animationType="chars"
duration={1.2}
stagger={0.03}
ease="power3.out"
>
Animated Title
</AnimatedText>
</Title><AnimatedSection animationType="slideUp" delay={0.2}>
<EventsSection />
</AnimatedSection><Section>
<Title>
<AnimatedText
animationType="chars"
duration={1.5}
stagger={0.04}
ease="power3.out"
>
Main Heading
</AnimatedText>
</Title>
<Description>
<AnimatedText
animationType="words"
duration={1.2}
stagger={0.02}
ease="power2.out"
delay={0.5}
>
Description text with word-by-word animation
</AnimatedText>
</Description>
</Section>- chars: Each character animates individually
- words: Each word animates as a unit
- lines: Each line animates as a block
- fadeIn: Simple fade-in animation
- fadeIn: Fade in from transparent
- slideUp: Slide up from below
- scaleIn: Scale in from smaller size
Common GSAP easing functions:
power2.out: Smooth decelerationpower3.out: More pronounced decelerationback.out: Slight overshootelastic.out: Bouncy effectbounce.out: Bounce effect
Visit /animation-demo to see all animation types in action.
- GSAP (GreenSock Animation Platform)
- SplitText plugin
- ScrollTrigger plugin
GSAP is already installed in this project. If you need to install it manually:
npm install gsap- Performance: Use reasonable stagger values (0.02-0.1) to avoid overwhelming animations
- Accessibility: Ensure animations don't interfere with user experience
- Timing: Use delays to create natural animation sequences
- Mobile: Test animations on mobile devices for performance
- Reduced Motion: Consider users who prefer reduced motion
You can customize animations by modifying the useGSAP hook or creating new animation components. The global styles include CSS classes for split text elements that can be customized as needed.