Hi There
I got a situation, where I am wondering if there is any way to use different durations for a tween without using ST matchmedia function inside the tween, for example I want a duration of 5sec tween on desktop and 1 sec tween on mobile as in my demo. I can do that by using ST matchmedia function but imagine I have a timeline where I only want to change duration of that timeline/ tween based on breakpoints and rest remains the same. With matchmedia I will be repeating such cod
If you're repeating code, that probably means a function could help you out.
Like you could pass in the duration....
ScrollTrigger.matchMedia({
"(min-width: 800px)"() {
const animation = createAnimation(5);
// Return a function that'll get called when the breakpoint no longer matches so we can kill() the animation (or whatever)
return () => animation.kill();
},
"(max-width: 799px)"() {
const animation = createAnimation(1);
return () => anim