Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

captainchemist

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

3 Newbie

About captainchemist

  • Rank
    Member
  1. Hi Everyone, I'm trying to figure out how to use timelineLite with React properly. I attached a codepen that works but I have read is not best practice. The key thing I need is a parent component that will contain the timeline object as a state and then a series of child components that I iterate over. I read this blog post that claims that it is important to use the onComplete() call back when I am setting up my timeline entries. The callback gets triggered within the ChildItem when it appears or disappears. The problem with react is that data flows from the top on down, so
  2. That was super helpful, thank you! Just as a followup, what would be the proper way to write the ball so that it had the rolling & moving behavior as well as the rolling & bouncing behavior? If I just wanted the little bit of bounce at the end, should I really have just ended the first tween after rolling down say 90%, and then having the second tween pick up there at +=0 and continue to roll down the last 10% but add the bounce animation as well? There isn't a way to specify that the bounce animation only turns on 90% through an animation, for example, right?
  3. Hi everyone, I am having a problem with making a ball roll down a ramp and then bounce off a block when it hits the bottom. I am including a working version in codepen which will speak many more words than I can, but the problem is that the roll works perfectly when it plays initially, but if I grab the progress bar to readjust it, the ball does not roll back up the ramp but only the Top direction moves, not the Left. I can only fix it by reloading the page. I can fix this problem by removing the "-=0.05" timing parameter from the last timeline transition, but I feel like I shouldn't h
  4. As a final update, I was able to figure out how you can access the state of a timeline within react. The trick is to define the timeline in the parent component and then to add a onUpdate event callback within the child component. Here is a working example, I hope that it helps someone! http://codepen.io/CaptainChemist/pen/XKzJay?editors=0010
  5. Sure, this is kind of hard for me to strip down but I am pretty sure the following will work. Each component would be in its own separate file. Let me know how it fairs when you try it. The idea is that I loaded the timeline in the parent file, passed it in as a prop to the tweens component and then a separate component called controls which has the play, pause etc buttons. This all works great for me except getting a progress bar. If you can figure that part out definitely let me know: http://greensock.com/forums/topic/14729-progress-not-working-with-timeline-lite-and-react/ export clas
  6. Thanks, for what it is worth I am using Meteor+React, but I totally understand that this issue is getting to be less of a GSAP issue. Thanks again for getting me this far!
  7. I am using Meteor + React and it works great with the 'gsap' npm package. Just import it and put all of your transitions in the componentDidMount() {} function and define your timeline in the render function.
  8. My thoughts were similar to yours but when I implemented it like you suggested, I get an error that "this.setState is not a function". The issue is also reflected in the codepen demo: http://codepen.io/CaptainChemist/pen/XKzJay?editors=1111 I also tried adding .bind(this) to the this.tlUpdate function but that actually causes the browser to become unresponsive. Thanks again!
  9. Thanks so much, this is beautiful! This totally outputs the correct progress in the console.log. Just as one followup question, how can I access that progress number in the Controls child component so that I can feed it into my slider? Do I have to setState() in the body of the tlUpdate function or am I able to somehow call the progress() in the <Controls> component? Thanks again!
  10. Thanks so much Rodrigo! I finally was able to replicate the issue in a Code Pen demo, check it out! http://codepen.io/anon/pen/RRLZgj?editors=0010 You can see that the demo plays just fine and I can restart it, but when I console.log the progress(), it gives undefined. I tried playing around with your onUpdate callback and it definitely is on the right track because I start getting hundreds of console messages but they all give this error: Uncaught TypeError: CreateListFromArrayLike called on non-object
  11. Hi Everyone, I am having an issue integrating React with Timeline lite. I can successfully play, pause, and rewind a timeline but when I try to read the current time using .progress() on the timeline object, I get undefined. I want that progress() function because I want to create a slider bar that will report the progress of the timeline and hopefully also allow for it to be adjusted. My app is laid out like this, I have a container LectureLayout that has a draggableObjects container which itself has many draggable object components. I have a controls component which has the play, pause,
×