Jump to content
Search Community

kaungkz93@gmail.com

Members
  • Posts

    3
  • Joined

  • Last visited

kaungkz93@gmail.com's Achievements

2

Reputation

  1. Thanks for the solutions, I am using for the case where I personally think fromTo is most suitable to use. I tried with object destructuring method and it works since I have more shared values for fromTo tweens.
  2. I personally use Intersection observer + gsap to create animation when user has scrolled to the targeted element.
  3. I am trying to add a defaults values for my fromTo(), I tried putting defaults: {} inside gsap.timeline({}) as below const tl_shapes = gsap.timeline( { defaults: { opacity: 0 } }, { defaults: { opacity: 1 } } ); function step_shapes_animation () { return tl_shapes .fromTo( ".step-2 .shapes img:first-child", { x: -200 }, { x: 0, duration: duration } ) .fromTo( ".step-2 .shapes img:last-child", { y: -200 }, { y: 0, duration: duration }, "-=0.4" ); } I am not sure if this is the right way to do it but second element doesn't seem to work and it starts with initial opacity: 1 and I guess it is because fromTo() has 2 objects and I can't put 2 objects for defaults. I am wondering if there is a right way to do it.
×
×
  • Create New...