greensock / GSAP

GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web
https://gsap.com
19.71k stars 1.73k forks source link

String values for motionPath array in Typescript #578

Open 7ingyu opened 8 months ago

7ingyu commented 8 months ago

Demo: https://codepen.io/7ingyu/pen/PoLgXKy

image image

I'm currently using the MotionPathPlugin to animate some fish in a pond. (See above demo for sample code). I generate random paths for the fish the swim. I am currently using vh and vw values for the path array. It works fine in the codepen, but my application is in Typesccript and apparently Point2D and PathObject both require numbers.

Would it be possible to add string as an allowed value type, or would that be a bad idea?

jackdoyle commented 8 months ago

Interesting, I never really anticipated someone using strings in that way, but I can update the TypeScript definition in the next release to accommodate it.