jonkwheeler / ScrollScene

ScrollScene is an extra layer on top of ScrollMagic as well as using IntersectionObserver to achieve similar effects.
https://scrollscene.jonkwheeler.now.sh/
MIT License
136 stars 9 forks source link

ScrollScene breakpoints with gsap.timeline.from #32

Closed seb-celinedesign closed 4 years ago

seb-celinedesign commented 4 years ago

Hi, i use ScrollScene with breakpoints and a gsap timeline with only "from" tweens :

new ScrollScene({
  breakpoints: { 0: false, 768: true },
  triggerElement: '.trigger',
  gsap: { timeline: gsap.timeline({ paused: true }).from('.anim', { y: '100%' }) }
})

My issue is on viewport width < 768px (mobile), where my .anim node gets it initial style from Gsap :

transform: translate(0px, 100%)

where i do not want to : for me the breakpoint is supposed to remove the timeline and all it styles. From my tests, timeline with only 'to' animation are not concerned by this issue obviously.

The problem is that the timeline stay in "paused state" even if the breakpoints doesn't match. Should Scrollscene calls the timeline.progress(0).pause() method instead ? like in the ScrollMagic gsap plugin removeTween method ?

Or do you have a better idea how to resolve this problem ?

jonkwheeler commented 4 years ago

Hmm. It's already doing this with pause(0) which is the same as progress(0).pause().

What about changing the immediateRender options within gsap?

seb-celinedesign commented 4 years ago

Hmm. It's already doing this with pause(0) which is the same as progress(0).pause().

What about changing the immediateRender options within gsap?

Interesting option. For me it implies other problems in my animations and i had to refactor it for making it really responsive, but maybe for someone else it could be fine. Thanks 4 ur help.

jonkwheeler commented 4 years ago

I can't tell whether this got resolved. If you have more troubles, just let me know and I'll try and work the kinks out. This library is still fresh.