Skip to content
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] Should Triggers have any effect on non time-driven animations? #11646

Open
ydaniv opened this issue Feb 4, 2025 · 0 comments
Labels
web-animations-2 Current Work

Comments

@ydaniv
Copy link
Contributor

ydaniv commented Feb 4, 2025

Currently AnimationTriggers' effect on time-driven animations is well defined:

An animation trigger is used to control the playback of its associated animation for time-driven animations.

Should there also be an effect of Triggers on non time-driven animations, e.g. scroll-driven animations?

Option 1

No effect, they are simply ignored.

Option 2

They behave exactly the same.
If we create an Animation() in WAAPI it doesn't apply any effect until .play() is invoked. The same is true for scroll-driven animations.
Using a Trigger practically replaces the need to call .play(), so we could just define that to have the same effect.
Now we need to define how each type interacts with these animations:

  • once: the animation becomes active once trigger's active interval is entered.
  • repeat: the animation switches between active/inactive on trigger's active interval entry and exit.
  • alternate: the animation switches direction on trigger's active interval entry and exit.
  • state: the animation's play-state is toggled on trigger's active interval entry and exit.

Since I'm not seeing any reason to prevent it, I'm leaning towards option 2.

Proposal: amend the spec to say AnimationTriggers' effect is apply to all animations time-based and non time-based alike.

@ydaniv ydaniv added the web-animations-2 Current Work label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-animations-2 Current Work
Projects
None yet
Development

No branches or pull requests

1 participant