-
Notifications
You must be signed in to change notification settings - Fork 669
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
[web-animations-2] Iteration delay #4459
Comments
I appreciate the desire to keep things simple but after digging into this (and based on experience with SVG/SMIL too), I think the chaining approach ends up being more complicated. As that issue points out, there are a number of open questions with iteration delays:
Because the answers to these questions are not obvious, whatever behavior is specified is going to confuse some authors whereas the grouping approach makes the behavior explicit. Furthermore groups allow:
Groups are also more easily mapped to markup allowing CSS authors to access this behavior too rather than having to tie together Groups also enable further optimizations by user agents that are able to send the entire group to a separate process/thread and play it smoothly without the potential jank introduced by having to execute JS when each animation ends. So I think groups are the preferred approach here but authors are still obviously able to chain animations together using JS by either hard-coding delays or using |
My infinite respect to the awesome work done around this and the other standards. However, I believe, that the stated questions should be answered, and the feature included. Only from a logical perspective, if there is a start delay, an end delay, there are iterations, there should be "in between iterations delay". And is it complex?... well I don't think that all of this is simple, its all complex by its nature. And using additional objects to simulate it will move the complexity to the use cases, instead to the specification. So its one more drop into the ocean:
So from all of the questions remains only the fill mode, that could be included. For the groups, yes, such a feature is needed, but not for the purpose of simulating a more simple behavior. |
ps. I will open another issue related to the groups, not to mix here. |
I've updated the issue title to reflect what I understand to be the core proposal here. I personally don't think the essential complexity it adds to the model is warranted and am concerned it has a poor upgrade path for authors. (That is, while it helps with some simple cases, as soon as you want to anything more complex, you need to drop the iteration delays and represent them using groups.) However, I'm happy to leave the issue here for now in case others are interested in pursuing it. It is out of scope for level 1, however. |
I think that the animation authors, will mostly create simple animations (work with single effects, not with the time line inheritance), and will benefit from the feature. And for the upgrade path, I think that the specifications must embrace the "proper way to do it" not the "current way to do it", which are not always the same. When a group of developers, regardless how skilled and with good intentions, missed in some code base some feature, or created improper one, that must not affect the whole world for years to come. The effort needed to upgrading some existing code base, is far less, then the effort put into the code bases that will be created subsequently to reflect the standard plus the uncountable use cases that will be developed. To the question "Is that feature useful?", I vote "yes", because its existence reflects the logic in my previous comment. |
@birtles What if The first value would be a before delay, the second value a after delay. The before delay would fill like If authors want to fill the The property could be a shorthand for The iteration count increases in between the two values: after EDIT: While this can stretch out the effect on either side, it does not give the option to define a delay with no fill mode …hmm |
@bramus Thanks for following up on this. As you noted in your update, even just getting the filling part right is difficult. I still think the best thing we can do for everyone is to push ahead with timing groups. They cover this use case in an intuitive and extensible way without further complicating the model, and so many other use cases too. After that, I think we could add syntactic sugar for some version of iteration delay if it proved necessary. Timing groups are already outlined in Web Animations level 2. The most useful next step would be to consider how they might be exposed to CSS. |
I was looking if there is an existing issue, glad I found it. This is something that I needed a lot in my work. This is also a rather commonly asked question, for example, on StackOverflow https://stackoverflow.com/questions/13887889/css-animation-delay-in-repeating, with 100+ upvotes. Developers want this and have had to come up with cumbersome workarounds for years. Example article from 2016: https://css-tricks.com/css-keyframe-animation-delay-iterations/ |
Hello, A property like |
Greetings to everyone,
I'm curious about the relation of the property discussed in "Proposal for animation-pause property" at https://lists.w3.org/Archives/Public/www-style/2016May/0080.html and its relation to the web animations specification 2 - group of effects and sequence of effects. It seems to me that instead of using groups of effects, its better to have the discussed property and to allow one animation to have more then one effect instead of the one 'target effect'. It does not look nice, to have to define two animations with the same attributes, when there are two effects, at least because of the redundancy. When a group is need, then simply the required effects will be connected to the animation. The sequence of effects could be made by delaying each effect accordingly, hard codding its value, or attaching it to the onfinish event of the previous effect. This could simplify the design of many common animation cases.
The text was updated successfully, but these errors were encountered: