Closed jonkwheeler closed 4 years ago
In v3, onOverwrite
has been to changed to onInterrupt
.
https://greensock.com/forums/topic/21986-gsap-3-and-scrollmagic-with-npm/?tab=comments#comment-103673
@OSUblake That link didn't work for me, as it's saying I don't have permission? https://greensock.com/forums/topic/21986-gsap-3-and-scrollmagic-with-npm/?tab=comments#comment-103597
I updated the link.
@OSUblake Thanks. Is it fair to say then...
var methodUsed = GSAP3_OR_GREATER ? 'onInterrupt' : 'onOverwrite';
thisTween.vars[methodUsed];
?
Yep.
@OSUblake Added. Thanks!
@janpaepke would you mind looking into this?
Hey guys, sorry - I was super busy. Looking through this now...
good stuff.
assets/js/lib/greensock
if not needed anymore?@janpaepke I did delete the minified file. It’s on my second commit. “Revert ...”
I felt it was important to add the necessary library of gsap 3, and now the examples reference both versions of gsap 1.4 and 3.
Lemme know if you need anything. 👻
what I'm saying is, it shouldn't be deleted. it should not be part of the pr (left untouched) :)
@janpaepke alright! I'd check it one more time.
Hey Jon, I'm sorry but it seems I'm not making myself clear enough. No dist files should be part of the PR. This concerns all files in /scrollmagic.
Now instead of removing scrollmagic/minified/plugins/animation.gsap.min.js
from the PR you also added scrollmagic/uncompressed/plugins/animation.gsap.js
Both of them should remain untouched and will only be updated with a new release, which also results in a version bump.
Ah, shall I just copy pasta the latest version online of both /minified
and /uncompressed
and push that? You want both files, just to be the exact same as online (untouched).
Sorry for the confusion.
yes, perfect. :)
sorry - language can be tricky sometimes. ;)
I'll probably make a release in the next couple of days to include these changes.
thank you! :)
When will upgrade-to-gsap3 be released ? : )
I'd be interested in getting this new release too.
@janpaepke was the release made yet?
@janpaepke Hi, checking in on the release. Still getting errors while using GSAP 3 with Scroll Magic.
I think I might fork this and release a new instance.
I think I might fork this and release a new instance.
Then I would recommend doing it just like I suggested here. This PR will load gsap twice if the user is using es-modules, thus doubling gsap's module size. A plugin should NOT directly import gsap.
@OSUblake 100%. I already do this in my local code instance. We need something more ESM compatible. Here's to finding time to do this.
Alright @OSUblake I made a new package that makes all of this stuff much easier to do. https://github.com/jonkwheeler/ScrollScene
Maybe we can connect via slack or email.
Does this fix the errors while using GSAP3 and scrollMagic? Are there any files to download that shows a basic example of what additional .js files to load to make this work ? I see everything on Storybook, but I am just unsure what additional files to add to make ScrollMagic work with GSAP3.
There’s no additional files really. You just need to install the packages you wish to use. gsap, scrollmagic, scrollscene would be all 3. They are independent of one another.
Do not add animation.gsap.js.
@jonkwheeler is there a way to include scrollscene like a regular .js file instead of installing packages like ?
Not currently, no. Maybe I’ll add it, but The goal of it was to make is more ESM compatible.
okay, thanks. That's what I'd be looking for to use it along with scrollMagic and GSAP3. I hope ScrollMagic will be updated to work with GSAP3, or I can use an additional script like this.
I’d suggest not doing it that way. Gsap does too. If you aren’t using ESM yet, I’d look into a compiler to build your own js files.
I changed all the codes mentioned and still get the same mistake Invalid property onOverwrite set to undefined Missing plugin? gsap.registerPlugin()
@jonkwheeler
@Elabbasy00 this isn't my library. I'm not sure ScrollMagic is maintained anymore, or if my PR here was even merged. If you want to use my version, ScrollScene, feel free to file an issue over there.
I know it's not your library but I've seen the changes you've made and I think it might solve the problem so I asked you I want to finish this project first and then I will permanently delete this library @jonkwheeler
oldCallback = thisTween.vars.onInterrupt; thisTween.vars.onInterrupt = function () {
This works
Perhaps you could use the new GSAP ScrollTrigger plug-in: https://greensock.com/docs/v3/Plugins/ScrollTrigger 🤔
I'd certainly push people towards using that. In the future I'll be deprecating ScrollMagic's usage within ScrollScene. However, I'll still make easy additions to the ScrollTrigger like I did with ScrollMagic.
@janpaepke Mind checking this out with you can?
Please let me know if I need to push any edits. Thanks!