Re: [csswg-drafts] [css-animations-2] Proposal: Time-based Keyframe Animations (#4907)

I think it is a great idea, animations based on percentages always felt a little unwieldy. In the past I was destining complex CSS animations and i remember siting with notebook and calculator to figure out the percentages. Still have these long scripts somewhere.

But, not only this approach clarifies the timescale a little bit, for me adding something into a finished animation was a real pain, and this looks like a great solution for this as well! Basically, it looks like it comes down to just adding another keyframe at he end, no tedious recalculation of all percentages. Awesome, love that!

Another use case i see is for larger projects, with many animations. may be animation libraries, even. With custom properties controlling speed of animations becomes really just a "one line" solution. I imagine it to be something like that: 
```css
:root {
  --animationDuration: 100%;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --animationDuration: 50%;
  }
}

.animatedBlock {
  ...
  animation-name: myFancyAnimation;
  animation-duration: var(--animationDuration);
}
```
As I know in mobile operating systems (Android, for example) there is a control for animation speed. This proposal makes it easier to implement something like that in web aps.

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

Received on Monday, 13 April 2020 13:24:38 UTC