web-animations/web-animations-js
关于
Web Animations API 的 JavaScript 实现
创作与媒体实测星标增长
- 24小时
- 0
- 7天
- -1
- 15天
- -4
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文What is Web Animations?
A new JavaScript API for driving animated content on the web. By unifying the animation features of SVG and CSS, Web Animations unlocks features previously only usable declaratively, and exposes powerful, high-performance animation capabilities to developers.
What is in this repository?
A JavaScript implementation of the Web Animations API that provides Web Animation features in browsers that do not support it natively. The polyfill falls back to the native implementation when one is available.
Quick start
Here's a simple example of an animation that fades and scales a <div>.
Try it as a live demo.
<!-- Include the polyfill -->
<script src="web-animations.min.js"></script>
<!-- Set up a target to animate -->
<div class="pulse" style="width: 150px;">Hello world!</div>
<!-- Animate! -->
<script>
var elem = document.querySelector('.pulse');
var animation = elem.animate({
opacity: [0.5, 1],
transform: ['scale(0.5)', 'scale(1)'],
}, {
direction: 'alternate',
duration: 500,
iterations: Infinity,
});
</script>
Documentation
We love feedback!
For feedback on the API and the specification:
- File an issue on GitHub: https://github.com/w3c/web-animations/issues/new
- Alternatively, send an email to [email protected] with subject line "[web-animations] ... message topic ..." (archives).
For issues with the polyfill, report them on GitHub: https://github.com/web-animations/web-animations-js/issues/new.
Keep up-to-date
Breaking polyfill changes will be announced on this low-volume mailing list: [email protected].
More info
- Technical details about the polyfill
- To test experimental API features, try one of the experimental targets
探索相关项目
加载中…