Re: [csswg-drafts] [css-animations-2] Add animation-trigger for triggering animations when an element is in a timeline's range (#8942)

To clarify [what I suggested earlier](https://github.com/w3c/csswg-drafts/issues/8942#:~:text=however%20maybe%20a%20range%20based%20trigger%20always%20plays%20forward%20when%20you%20enter%20the%20range%20and%20plays%20backwards%20when%20you%20leave%20it%20and%20if%20you%20don%27t%20want%20one%20of%20the%20directional%20trigger%20points%20it%20is%20conceptually%20infinite%20/%20the%20start%20or%20end%20of%20the%20range.), I think it would be helpful to always have a range (i.e. start and end) for all cases. When the end of the range is not specified it could be some form of infinity / auto value so that most of the time developers would only need to specify a start point.

Then, it becomes easier to rationalize all of the behaviors. The "trigger" occurs whenever a rendering update results in going from outside of the range to inside of the range or vice versa, and the behavior depends on the mode:
* `once` will play the animation a single time when you enter the range. Subsequent entry / exiting is ignored.
* `repeat` will play the animation every time you enter the range.
* `alternate` will play the animation forward every time you enter the range and reverse the animation every time you exit the range.

@ydaniv does having a trigger range not fix the discontinuity issue?

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


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

Received on Thursday, 14 September 2023 16:48:11 UTC