Jump to content
Search Community

Why progress is not working?

TeddyBrown test
Moderator Tag

Recommended Posts

I didn't have time to try to parse through all your logic and figure out what you're trying to do, but I suspect the problem has to do with the fact that you're calling .to() on each timeline on  [almost] every tick...which appends another tween to that timeline, so you're basically making a super long timeline with a bunch of appended tweens of the same element. I wonder if maybe you don't understand how timelines work. Are you just trying to have one animation for each element, and affect its progress()? If so, just create one tween for each, don't constantly add more and more animations. And set the tween's progress() accordingly. 

 

If you're still having trouble, please give us more details about exactly what you expect to happen. And if you could simplify your codepen even more, just to make it crystal clear what you're trying to do and minimize the chances of contaminated logic or confusion, that'd be awesome :)

 

Happy tweening!

  • Like 2
Link to comment
Share on other sites

Hi Jack and thank you for your answer!

Actually what I want to do is just replicating what Scrollmagic do without using it, so yes, as you said, animate each element while scrolling. 

Now after adding one tween for each timeline it works as expected but I still miss something.

What I would like to have is something really smooth (this is a perfect example: Pleanaire).

I've seen somewhere here in forum, that I could use a proxy tween to make the progress smooth, do you(all) think it's a good solution?

And since you mentioned it, could you(all) give me some advices about the logic and the structure of the code (I know i'm really bad at it)?

 

Thank you very much guys! 

Teddy

Link to comment
Share on other sites

Thank you guys for your answers!

@mikel Yeah, I've read about Intersection Observer API but I thought it was redundant since I was already detecting scrolling. 

@ZachSaucier The example of OSUblake is great, but it's not so easy to understand how to apply the logic on animate elements.

 

Anyway, I will try some approaches and then come back if something is not clear!

 

Thanks, 

Teddy

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...