GSAP Website Layout animation from scratch in Reactjs
GSAP is an industry standard JavaScript animation library from GreenSock that lets you craft high-performance animations that work in every major browser.
GSAP Top to bottom Layout Animation
Here, we set fixed size container (width:100%,height:0,top:0,left:0,bottom:0)
1. Using useRef() accessing Layout container.
2. Create gsap timeline().
3. Now animate our container
set height:100% and duration:1.3
Now again Call gsap timeline to animate our container
set duration 1 and top:100% with 0.3delay
What output here you got
while start your react project container move from top to bottom so initial height 0 to 100% and after 0.3delay again container move from top to bottom with top:100%