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

Speeding up or ending overdue animation after visibilityChange #71

Open
randunel opened this issue Apr 5, 2019 · 0 comments
Open

Speeding up or ending overdue animation after visibilityChange #71

randunel opened this issue Apr 5, 2019 · 0 comments

Comments

@randunel
Copy link

randunel commented Apr 5, 2019

Sometimes elements with animation are added while the user doesn't have the elm document focussed. These pile up and their animations trigger all at once when the user switches back to the elm tab.

In one use case that I have, requests come over a websockets (think fast paced multiplayer game) and SVG elements that are supposed to animate for 1-2 seconds are added, they pile up, animate all at once when the user brings the tab into focus and then get removed. This is because the removal trigger is the last item in Animation.interrupt. Having many elements concomitantly animating with javascript makes for a very poor experience.
Since there is no way of knowing at which point in time the user brings the tab back into focus, all elements need to be rendered as they come in.

Another use case is player/world movements. They also pile up and slowly render their entire timeline all at once, causing sluggishness and inaccurate representation of the server state.

Is there a way to force animations to not take longer than the specified duration (from the time of creation), in absolute time, when the animation is overdue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant