Re: [csswg-drafts] [css-easing-2] - Custom Timing Functions in JavaScript (#1012)

Hello, I'm maintainer of [Tween.js](). This would be excellent. For Web Animations, allowing a `function` be passed to `easing` seems like the perfect solution (in Tween.js, easings are functions just like in the OP).

Bramus's guide on how to pre-calculate keyframes or `linear()` strings is great. Besides being cumbersome, these techniques have limitations: namely, animations have to be pre-calculated for pre-determined amounts of animation `duration`s to make them look the best, and this can fall apart when the `duration` is not necessarily known up front.

The real benefit of an easing function is that it implicitly adapts to *any* length duration, because it always operates on the current time value which is irrespective of an animation's duration.

---

Along with this, the following issue would be great to solve too, as it would make the Web Animations API a lot more useful for not only DOM elements, but for other cases like JS properties on Custom Elements, WebGL, canvas 2D, and even non-browser JS runtimes:

- https://github.com/w3c/csswg-drafts/issues/9974

-- 
GitHub Notification of comment by trusktr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1012#issuecomment-1950610931 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 18 February 2024 00:15:10 UTC