GsapLover Posted October 14, 2023 Share Posted October 14, 2023 Hey, I want to animate the white striped bar with the current animation. Additionally, the blue text should be visible when it comes into the view-port, and the purple text should be visible when it goes out of the view-port. Please help.? See the Pen wvRZLpQ?editors=1010 by sumit_appinventiv (@sumit_appinventiv) on CodePen Link to comment Share on other sites More sharing options...
Rodrigo Posted October 14, 2023 Share Posted October 14, 2023 Hi, The animation for the bar should be super simple and you can tie it up to the ScrollTrigger instance that pins the black section. Just be aware that you have this on your CSS: .bar { position: absolute; left: -2px; top: 0; width: 6px; height: 120px; background: #fff; content: ""; border-radius: 60px; transition: all 1s cubic-bezier(0, 0, 0, 1.35); -webkit-transition: all 1s cubic-bezier(0, 0, 0, 1.35); } Mixing CSS transitions and GSAP is not recommended at all, as Jack explains in this post: The rest is just some extra conditional logic in the text loops and override some styles for the first text element. Here is a fork of the demo: See the Pen gOZJpZW by GreenSock (@GreenSock) on CodePen Hopefully this helps. Happy Tweening! Link to comment Share on other sites More sharing options...
GsapLover Posted October 14, 2023 Author Share Posted October 14, 2023 Hi Rodrigo, It is the exact that I wanted ?. Also, I will look into the recommendation for CSS transition with GSAP. Thanks for the solution and suggestion ?. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now