Jump to content
Search Community

hunterruth

Business
  • Posts

    3
  • Joined

  • Last visited

About hunterruth

hunterruth's Achievements

  1. Hello! Long story short, I'm having difficulty getting a complicated animation work directly with snapTo: labelsDirectional. I don't want the animation to scrub, but I want it to play to certain labels in the animation based on the snap point. I understand how to do this, but cannot figure out how to return the index of a current snap before it finishes. I have my snaps working using an object. let snaps = []; panels.forEach((panel, i) => { snaps.push(i / panels.length); }); console.log(snaps); ScrollTrigger.create({ trigger: hero, pin: hero, start: "top top", end: "+=" + (panels.length * 1000), markers: true, snap: { snapTo: snaps, duration: {min: 1.5, max: 2.5}, ease: "power2.inOut", onStart: (e, i) => { console.log(e); } } }); The docs don't seem to include any properties inside of the onStart function. Is it possible to return the destination snap inside onStart? Even just the decimal value would work, as I can filter the array and find the correct index. I would then use this to animate the timeline to that corresponding label. Thanks in advance for any nudge in the right direction!
  2. Thanks, Jack. This is exactly what I was looking for! I can't believe I've never used labels until now. I've always used percents or specific timestamps. Thanks again.
  3. Hi there, Quick question - I am hoping I do not need to create a simplified demo for, but will if necessary. Is there a way to use Timeline Seek in reverse? I know there is the suppress events parameter, but it doesn't actually change the direction of the animation. This would be a great feature, if it's not already possible. Essentially, I am trying to animate backwards from Label 2 to Label 1. Right now, .seek() to label 1 jumps you back there and plays until the pause point I have before label 2. I would rather it play in Reverse to Label 1. I am sure the alternative is using .reverse() and .play(), but I'm really enjoying using labels and could see this being beneficial on more complicated animations. It might also make more sense to think about it as using .reverse() to a specific label that is defined.
×
×
  • Create New...