-
Posts
9,196 -
Joined
-
Last visited
-
Days Won
706
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
ScrollTrigger Demos
Downloads
Posts posted by OSUblake
-
-
Actually those updates were just push a couple of hours ago, so try downloading the new tgz.
-
You really can't use fit like that by passing in a scrollTrigger. However, you can still use fit to get the values you need.
See the Pen bGaJYJK by GreenSock (@GreenSock) on CodePen
-
2
-
-
Welcome to the forums @Studio7
To prevent it from looping, you just need to get rid of the wrapForward/wrapBackward calls.
onUpdate(self) { if (self.progress === 1 && self.direction > 0 && !self.wrapping) { // wrapForward(self); } else if (self.progress < 1e-5 && self.direction < 0 && !self.wrapping) { // wrapBackward(self); } else { scrub.vars.totalTime = snap((iteration + self.progress) * seamlessLoop.duration()); scrub.invalidate().restart(); // to improve performance, we just invalidate and restart the same tween. No need for overwrites or creating a new tween on each update. self.wrapping = false; }
See the Pen PoEgOOm by GreenSock (@GreenSock) on CodePen
But that's a rather complicated demo to learn from. It might be easier to start out small and build up to what you want following this article. And, of course you can ignore the looping parts, but the animations might still be helpful.
Going “Meta GSAP”: The Quest for “Perfect” Infinite Scrolling | CSS-Tricks - CSS-Tricks
-
3
-
-
Hi beavykins,
It's hard to advise without seeing a minimal demo, but there is helper function for using Lottie with ScrollTrigger.
https://greensock.com/docs/v3/HelperFunctions#lottie
See the Pen QWdjEbx by GreenSock (@GreenSock) on CodePen
-
3 minutes ago, Shuriken said:
As the From tween do not work as well. I must use a fromTo
If you're using React 18, that just a new feature that is causing those issues. We're looking at ways to fix that, but for now it is what it is. It seems like every new version of React throws some new feature into the mix that makes doing animations increasingly more complex and tedious.
-
18 minutes ago, sirhclluk said:
What is this clearing? console.clear();
It just clears the dev console. You'll typically see that in CodePen demos because it doesn't reload the page when you make changes, so the console might have a bunch of old console.log messages showing.
https://developer.mozilla.org/en-US/docs/Web/API/console
-
1
-
-
Currently normalizeScroll does not support nested scrollers, but it's something we're investigating. For now you'll just have to disable that feature.
ScrollSmoother.create({ content: "#smooth-content", wrapper: "#smooth-wrapper", smooth: 1, // how long (in seconds) it takes to "catch up" to the native scroll position effects: false, // looks for data-speed and data-lag attributes on elements // normalizeScroll: true, // prevents address bar from showing/hiding on most devices, solves various other browser inconsistencies smoothTouch: 0, })
-
1
-
-
14 minutes ago, PointC said:
I can't find anything on CodePen. 🤷♂️
Haha, I can't either, but luckily someone brought that demo up to me in a DM a couple of weeks, so it was easy to find.
-
1
-
-
28 minutes ago, PointC said:
Here's a cool pen from resident guru @OSUblake. It's a few years old, but he may have an updated version - I'm not sure.
Nope. I don't want to touch that again. It brings up way too many questions that I don't want to answer. 😉
But here is a bezier connector isolated.
-
2
-
-
Welcome to the forums @Oleh_Rusyi
Can you make a minimal demo showing that? And you are you using normalizeScroll?
-
Hi Sascha,
Can you try with these beta files for 3.10.4?
https://assets.codepen.io/16327/ScrollTrigger.min.js
https://assets.codepen.io/16327/ScrollSmoother.min.js
-
17 minutes ago, akapowl said:
You might just need the offsetLeft / offsetTop instead - like in this very similar thread:
Yeah, that can work too. You just have to be careful if the elements are nested deeply as offsetLeft/offsetTop are relative to the nearest offset parent.
-
1
-
-
24 minutes ago, Apnw2 said:
when I saw it doesn't work on field. I think that's because
getBoundingClientRect
gives me the value with transform at each time.What do you mean by field? It's doing getBoundingClientRect correctly as you can see in the logs there are no transforms when it's called.
See the Pen GRyLgYP by GreenSock (@GreenSock) on CodePen
If you're trying to have it match up exactly with size and position, it would be probably be better to calculate and animate to the center of each element. The scaling is going to mess up the x and y coordinates if you use the elements top left corner because the transform origin is in the center.
-
1
-
-
Welcome to the forums @Vinicius Eidy
You can use your ScrollTrigger's callbacks like onEnter, onLeave, onEnterBack, and onLeaveBack to custom whatever you want. It's very similar to this answer. @akapowl is changing the classList property of an element. Same basic concept.
-
2
-
1
-
-
Hi Apnw2,
One issue is that you forgot to put
invalidateOnRefresh
inside thescrollTrigger
object. Another issue is thatgetBoundingClientRect
includes transform, which is going to mess up your calculations if there are any transforms applied. It's best to compute all that when animation is invalidated as it will reset those transforms, allowing you to get the correct getBoundingClient values.See the Pen GRyLgYP by GreenSock (@GreenSock) on CodePen
-
2
-
-
9 hours ago, PointC said:
Using the ScrollSmoother file from CodePen (also 3.10.4) - no effects in local testing. Weird. 🤷♂️
I think the demo just needed the beta version of ScrollTrigger 3.10.4.
https://assets.codepen.io/16327/ScrollTrigger.min.js
See the Pen NWXmPdJ by GreenSock (@GreenSock) on CodePen
-
Hi PixelPixie,
It's best to keep your demos as simple as possible, that just focus on the issue at hand. So based on the question in that previous post, is this what you were going for? All I really did is move the nav to side and added a the same onlick listener that the nav uses for each section, so when click on a section it does the same thing as click on the nav links.
See the Pen WNdWbvP by GreenSock (@GreenSock) on CodePen
-
3
-
-
Can you check this version of ScrollTrigger to see if fixes your issue?
https://assets.codepen.io/16327/ScrollTrigger.min.js
If you need to import it, just add that file to your project and import ScrollTrigger from it instead of gsap.
-
24 minutes ago, PointC said:
Blake will probably have some funky math to make this, but I prefer to cheat
I like your cheating over my math. Very nice!
-
2
-
1
-
-
Yeah, I can edit it. I think one of the issues is that that nesting needs to be different, kind like this.
<div id="smooth-wrapper"> <div id="smooth-content"> <PageTransition route={router.asPath}> <Component {...pageProps} /> </PageTransition> </div> </div>
And we need to kill some ScrollTriggers and effects when navigating to a new page. We also need to refresh ScrollSmoother on new routes. I just put it inside a timeout for now. How would I go about calling
ScrollTrigger.refresh()
at the end of the page transition?It's looking better, but there are still issues with it, like that black area when you scroll down. Is that part of the wipe?
https://codesandbox.io/s/gsap-scrollsmoother-next-js-starter-forked-demo-459fmr?file=/pages/_app.js
I'm going to tinker around with make a ScrollSmoother component similar to what I did with this nuxt.js one.
-
2
-
-
Hm... I'm not sure about. When CodeSandbox, I usually click the Restart Sandbox and Restart Server buttons, and that usually fixes it.
@Cassie do know anyone who might be able to help with this?
-
This is what looks with the console closed.
https://gyazo.com/5753f1e3d634888f0dd743bab23d94ff -
Hi null,
Here's a next.js demo you can fork for ScrollSmoother. To use on CodeSandbox, install
gsap-trial
instead ofgsap
.https://codesandbox.io/s/gsap-scrollsmoother-next-js-starter-0h67eh?file=/pages/index.js
-
1
-
-
Hi serotininene,
That scroll animation looks the same to me whether the console is open or closed. What browser and OS are you seeing this on?
The only weird thing I noticed is that when that contact form at the bottom appears, it's changing the scroll position, probably because it's changing the height of the document, but I don't know if that is related to what you are seeing and you are properly handling that change like doing a ScrollTrigger refresh.
If you could try to make a demo that reproduces the issue, that would be really helpful because it's really to troubleshoot a live site, especially when can't interact with the code and make changes to it. You can use CodeSandbox if you need to use React.
gsap-bonus.tgz file installs old version
in GSAP
Posted
Welcome to the forums @Tada AS
Is very answer hard to local dev questions, but assuming you've nuked your node_modules folder and the latest tgz is in your project, then it's probably some sort of caching issue with the package manager you are using. Try googling for how to clear the cache of whatever package manager you are using. It usually seems to be yarn that does kind of stuff.