Anybody used web-animations polyfill?
Posted: 27 January 2021, 11:28
In a new project, I'm doing some experiments using element.animate() from the Web Animations api (a javascript equivalent to CSS animations). This is working very well on up-to-date browsers, but I'd also like to load the web-animations-js polyfill so that the same code works on older browsers (e.g. I have an iPad here with Safari iOS 10.3 on it). web-animations.min.js is under 50k and falls back to using native calls when the browser supports them.
Has anybody used this, or a similar "external" js files in a BGA project? I've put the file into my "modules" directory, but I'm not sure how to reference it to get it to load at the right time. The documentation assumes you have control of the whole page's html, and just suggests putting this somewhere near the top:
but obviously this isn't possible to game developers, at least not directly. Any tips?
Has anybody used this, or a similar "external" js files in a BGA project? I've put the file into my "modules" directory, but I'm not sure how to reference it to get it to load at the right time. The documentation assumes you have control of the whole page's html, and just suggests putting this somewhere near the top:
Code: Select all
<!-- Include the polyfill -->
<script src="web-animations.min.js"></script>