Search the Community
Showing results for tags 'cubic-bezier'.
-
Hi GSAP Team & Contributors, I've had hard times to make "1D cubic path" working. According to the following codepen, simply extracting the y property of a working curve data doesn't produce the same tween : let points = [{x:0,y:0},{x:50,y:0},{x:100,y:50},{x:100,y:100}]; // Reference Y let yValues= [{y:0} ,{y:0} ,{y:50} ,{y:100}]; // Not the same tween/smoothing GreenBall is 2D cubic path, as BlueRect is 1D cubic path using the same values https://codepen.io/swingingTom/pen/qBPBQQP A workaround a could have imagine is to tween another fake property in order to have a two-dimensional properties let points = [{x:0,y:0} ,{x:50,y:0} ,{x:100,y:50} ,{x:100,y:100}]; // Reference Y let yValues= [{y:0,foo:0},{y:0,foo:50},{y:50,foo:100},{y:100,foo:100}]; // Not the same tween/smoothing But according to this codepen, it won't work : https://codepen.io/swingingTom/pen/NWaWOXX I start to believe that `type:cubic` require both `x` and `y` property to produce the cubic smoothing. For now, my only working workaround is to animate a proxy target, that only reports "y" property on the real target to be animated. https://codepen.io/swingingTom/pen/GRMRYav gsap.to(proxyTarget, { duration: 3, ease: "none", repeat: -1, yoyo: true, motionPath: { path: cubicPoints2D, type: "cubic" }, onUpdate: function () { gsap.set(realDisplayTarget, { y: proxyY.y }); } }), I know that looks more like I should use CustomEase for the prodived cases, but I would like to know better the cubic motionpath features and its limitations.
- 3 replies
-
- cubic
- cubic-bezier
-
(and 1 more)
Tagged with:
-
Download CustomEase Get CustomEase by creating a FREE GreenSock account which gets you access to our community forums plus you’ll receive our exclusive “GreenSock Insider” email series (you can unsubscribe anytime). Make sure you're logged in, then you’ll get immediately gain access to the download zip containing CustomEase. Note: CustomEase is not in the GitHub repository or CDN; it's only available for download at GreenSock.com. data:image/svg+xml,%3Csvg%20xmlns='http%3A//www.w3.org/2000/svg'%20viewBox='0%200%2084.25%2084.25'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23FFF;%7D%3C/style%3E%3C/defs%3E%3Cpath%20class='cls-1'%20d='M42.12,0A42.13,42.13,0,1,0,84.25,42.12,42.17,42.17,0,0,0,42.12,0Zm0,77.25A35.13,35.13,0,1,1,77.25,42.12,35.17,35.17,0,0,1,42.12,77.25Z'/%3E%3Cpath%20class='cls-1'%20d='M53.38,41.25l-7.63,8V26.66a3.5,3.5,0,1,0-7,0V49.53l-7.69-7.69a3.5,3.5,0,1,0-4.95,4.95L39.78,60.46h0a5.17,5.17,0,0,0,.51.42l.2.11c.13.07.26.15.4.21l.26.08c.13,0,.26.09.4.12a3.17,3.17,0,0,0,.69.07h0c.12,0,.24,0,.36,0a1.65,1.65,0,0,0,.32,0,2.33,2.33,0,0,0,.25-.07,2.83,2.83,0,0,0,.41-.14l.21-.11a2.16,2.16,0,0,0,.39-.22l.2-.16c.11-.09.22-.18.32-.28l0,0L58.44,46.08a3.5,3.5,0,1,0-5.06-4.83Z'/%3E%3C/svg%3E Download GSAP (ZIP) Demos CustomEase Demos
- 4 comments
-
- 4
-
- easing
- featured-homepage
-
(and 5 more)
Tagged with:
-
In a project I'm doing, I need to match easing feel of elements animated using CSS cubic-Bezier timing function (example:cubic-bezier(0.1, 0.9, 0.2, 1) using tweenmax. Is this supported in GSAP ? I'm trying to avoid writing my own cubic-Bezier plugin if possible Thanks! Orry
- 21 replies
-
- 1