- From: David A via GitHub <sysbot+gh@w3.org>
- Date: Mon, 05 May 2025 16:18:57 +0000
- To: public-css-archive@w3.org
> > > However, taking this a step further, I wonder if it is possible to have triggers be entirely independent of animations such that they exist as external mechanisms that simply call play(), pause(), cancel() etc. on their target animations. I think that would produce behavior that is easy to reason about for all cases. > > > > > > This matches how I had been thinking about it and I think it might be possible with a [proposal](https://github.com/explainers-by-googlers/scroll-triggered-animations/blob/main/PROPOSAL.md) I've just uploaded. > > Thanks. I had a read and I think that's pretty close to what I was imagining. However, I wonder if `Animation.enableTrigger` is even needed? Why can't that be a method on the trigger itself? i.e. `AnimationTrigger.enable()`? > I am currently imagining that Animations and AnimationTriggers are not 1-to-1. I think we want to be able to set `animation.trigger = ...` which means multiple animations could share the same trigger, but we would not want enabling or disabling the trigger for one animation to affect other animations with the same trigger. So what I've been referring to as the trigger's state is really state that is tracked per-animation. I think my proposal needs to be updated with a `TriggerState` concept which each `Animation` has. > > On creating but not playing an animation, I think if you don’t play but you call `enableTrigger` we should play the animation when the trigger's condition is met. On getAnimations, we can specify that an inactive trigger does not make an animation relevant but any other state will. > > I don't follow why that clarification is needed. If `enableTrigger` is not called, the animation won't be relevant, right? If `enableTrigger` is called—putting the animation in a kind-of paused state—then it will be relevant and should be returned by `getAnimations`. In my proposal, when we call `enableTrigger` we only pause the animation if it has `fillMode: both|backwards`. I felt that if it has `fillMode : none` it should still be returned by `getAnimations`, reflecting that it could be played by the trigger at some point in the future. -- GitHub Notification of comment by DavMila Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12119#issuecomment-2851529846 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 5 May 2025 16:18:57 UTC