dao-game / peerjs-browser-bug / files / src / animate.ts
Branch peerjs-browser-bug · default branch · all branches
animate.ts
e46456c2 2022-03-22 Pavel Safronov | 1 | require('web-animations-js'); |
| 2 | ||
| 3 | export async function poly_animate( | |
| 4 | element: Element, | |
| 5 | keyframes: Keyframe[], | |
| 6 | options: KeyframeAnimationOptions): Promise<Animation> { | |
| 7 | const animation = element.animate(keyframes, options); | |
| 8 | const result = await animation.finished; | |
| 9 | return result; | |
| 10 | } |