Re: [csswg-drafts] [web-animations-2] Prefer phase based start / end delays over converting time based delays (#7749)

My assumption was that because time makes no sense for scroll timelines, the set times would be ignored _(thus, using their initial values)_. But if that paints us into a corner as outlined above, let’s just keep it. The suggested option 1 also reflects [the mental model @fantasai outlined here](https://github.com/w3c/csswg-drafts/issues/8405#issuecomment-1464810166).

I do wonder how switching from scroll based to time based would go in practice though. If I were to take a guess, I would expect something like this to happen upon switching timelines of an animation:
- Calculate how far in the scroll-driven range we are, e.g. `25%`
- Look at the duration set for the time-based version, e.g. `4s`
- Run the remaining part of the animation _(here `100% - 25% = 75%`)_ for the remainder of the duration _(here `4s * 75% = 3s`)_ _– This example assumes a `linear` easing to keep the maths simple._
- When there is an `animation-delay` set, it is ignored upon switching if the scroll-timeline was a progress greater than 0% because in that case it had already started.

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


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

Received on Friday, 7 April 2023 10:19:38 UTC