Discussion:
[css-animation] Script access to property interpolator
Henrik Andersson
2017-05-15 17:04:00 UTC
Permalink
There are many tricky rules for how to interpolate css properties for
animation. The transform matrix being one of the more complicated examples.

Scripting will surely find good use for a way to interpolate between
property values on demand. Perhaps to do some crazy betterer animation
engine. Perhaps to do something crazy that nobody else would have
thought of.

Only one problem, there is no way to do it. There is no interface to ask
the user-agent to interpolate between two properties for a given position.

Keyframes seem very useful to be interpolated between with, but they do
have one complicating factor: they have associated times. Some uses
would benefit from being able to interpolate on a ratio of 0 % to 100 %
progress. As such I ask for an interface that supports a number in the
range of 0 to 1 to specify the interpolation progress.
Brian Birtles
2017-05-15 22:56:05 UTC
Permalink
Hi Henrik,

Yes, I agree this seems like a reasonable request and is something we have
been considering in the Web Animations API. Would you mind filing an issue
on the Web Animations spec?[1]

Thank you.

Best regards,

Brian

[1] https://github.com/w3c/web-animations/issues
Post by Henrik Andersson
There are many tricky rules for how to interpolate css properties for
animation. The transform matrix being one of the more complicated examples.
Scripting will surely find good use for a way to interpolate between
property values on demand. Perhaps to do some crazy betterer animation
engine. Perhaps to do something crazy that nobody else would have
thought of.
Only one problem, there is no way to do it. There is no interface to ask
the user-agent to interpolate between two properties for a given position.
Keyframes seem very useful to be interpolated between with, but they do
have one complicating factor: they have associated times. Some uses
would benefit from being able to interpolate on a ratio of 0 % to 100 %
progress. As such I ask for an interface that supports a number in the
range of 0 to 1 to specify the interpolation progress.
Loading...