Sergye Posted May 21, 2021 Share Posted May 21, 2021 Good day! please tell me how to make a smooth animation of the picture. Thank you See the Pen GRWrwjg by Sergio-novik (@Sergio-novik) on CodePen Link to comment Share on other sites More sharing options...
Cassie Posted May 21, 2021 Share Posted May 21, 2021 I'm not quite sure exactly what you're trying to achieve, but I assume you want the images to scroll through like a flick book? If so Step 1 - you'll need to set it up properly. Make sure all the images are aligned on top of each other using css and by prepping the images correctly in an editor before you export. At the moment they don't line up. Step 2 - You'll need to take off all the y axis transforms in your code as they're all animating in upwards at the moment this is a different, but effective approach See the Pen mdVEpKK by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Sergye Posted May 21, 2021 Author Share Posted May 21, 2021 2 hours ago, Cassie said: I'm not quite sure exactly what you're trying to achieve, but I assume you want the images to scroll through like a flick book? If so Step 1 - you'll need to set it up properly. Make sure all the images are aligned on top of each other using css and by prepping the images correctly in an editor before you export. At the moment they don't line up. Step 2 - You'll need to take off all the y axis transforms in your code as they're all animating in upwards at the moment this is a different, but effective approach Thank you so much! Tell me, what am I doing wrong now? When scrolling, there should be animation, but for me it works like a slider. please tell meи Link to comment Share on other sites More sharing options...
elegantseagulls Posted May 21, 2021 Share Posted May 21, 2021 You'll need to adjust your background-size and the calculation for offset value for your sprite. From a performance standpoint, you'll likely have better results using an <img /> with inside an overflow hidden div, and transform that image. This is also easier as you can better use relative units (width: 1100%_ Either way, an easy way to de-bug this is to remove the ScrollTrigger and easing, and make sure the final image is in the correct spot at the end of your tween. Then add back in stepped easing and make sure that works as expected. Then tie that to the ScrollTrigger. Basically break it down so you aren't trying to figure out everything at once. 4 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