Re: [csswg-drafts] [css-animations-2, css-transitions-2] Entry and exit animations for top-layer elements (#8189)

> In previous spec, it was hacky but possible to control the animation from JS by using "proxy" native animations that one could pause and complete. If I understand correctly, this new proposal is founded on a CSS `transition` and that, is impossible to control from JS.

The [getAnimations() API](https://www.w3.org/TR/web-animations-1/#dom-animatable-getanimations) returns all running CSS animations, CSS transitions and web animations allowing them to be modified or controlled from JS. This would let you pause and complete the transition in order to run a JS-based animation.

> Can someone write a basic example of a physics-based animations (e.g. springs) for a top-layer element removal?

Something like this (uses a transition of visibility so that it works in regular browsers but with this proposal the same would work for the top layer transition):
https://output.jsbin.com/qoyevow

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


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

Received on Monday, 27 February 2023 20:59:22 UTC