GSAP icon indicating copy to clipboard operation
GSAP copied to clipboard

String values for motionPath array in Typescript

Open 7ingyu opened this issue 1 year ago • 1 comments

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?

7ingyu avatar Feb 21 '24 05:02 7ingyu

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.

jackdoyle avatar Feb 21 '24 18:02 jackdoyle