-
Notifications
You must be signed in to change notification settings - Fork 715
[css-animations-2] frames() as a more intuitive steps() #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm planning to spec this in Web Animations: https://w3c.github.io/web-animations/#issue-fc1dd2fc |
I do not agree with this. In the case of animating a sprite-sheet with finite iterations (background-position) it is impossible to overshoot due to the limitations of the underlying background-image. I think that possible parametrizations to animate all frames correctly with fill-mode forwards only exist for 1 and infinite iterations. Run the example here: http://stackoverflow.com/questions/38809527/css-spritesheet-animation-fill-mode-forwards-with-steps-ends-on-wrong-position Should this be a separate issue? |
Resolved now (we're using steps(), but adding a keyword with the behavior described here). Closing in favor of #1680 to track remaining naming issue. |
…e effect values This closes w3c#136
As was discussed in the past, and most recently championed by Rachel Nabors, steps() is defined in a nonintuitive way. Depending on whether you use "start" or "end", you never actually see the starting/ending value. If you do want to see both the starting and ending values, and have a stepped transition between them, you need to do some math and overshoot the desired end-point instead. This is extremely common; for example, the default "discrete" method that we use for things without a better interpolation method is exactly this! This also shows the weakness of the hack - for non-interpolable values, you can't "overshoot" either.
It was suggested that we add a new function that handles things more intuitively, so that saying you want "2 steps" creates a timing function that spends half the time on the starting value and half on the ending value, "3 steps" spend a third of time at the start, a third in the middle, and a third at the end, etc.
The name
frames()
was suggested for this and proved popular in Rachel's group of authors, by analogy with animation frames. It takes a single<integer>
which must be >= 2.The text was updated successfully, but these errors were encountered: