elm-simple-animation icon indicating copy to clipboard operation
elm-simple-animation copied to clipboard

leveraging animationend and transitionend

Open andrewMacmurray opened this issue 4 years ago • 0 comments
trafficstars

It could be nice to have a way to fire events when an animation or transition finishes - a recent example from the elm slack was animating something before a page transition.

One way of doing this could be to use the browser's animationend / transitionend events https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/animationend_event

Here's a minimal example of that approach - https://ellie-app.com/cZPWSKSXcPZa1

Things I'd like to find out before anything like this gets added:

  • Does this approach get out of hand with multiple animations going at once (e.g. if I have a list of animations can I tell which ones have ended reliably)?
  • If we provide helpers do they play nicely with the elm-ui and svg wrappers?

andrewMacmurray avatar Apr 26 '21 10:04 andrewMacmurray