https://github.com/bendc/animateplus <!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="UTF-8"> <title>animateplus</title> <style type="text/css"> span{width:50px;height: 50px;background: purple;border-radius: 50%;display: block;margin: 10px auto;} </style> </head> <body> <script type="module"> import animate from "https://cdn.jsdelivr.net/npm/animateplus@2/animateplus.js"; const play = async () => { const options = await animate({ elements: "span", duration: 3000, transform: ["translateY(-100vh)", 0] }); await animate({ ...options, transform: ["rotate(0turn)", 1] }); await animate({ ...options, duration: 800, easing: "in-quintic", transform: ["scale(1)", 0] }); }; play(); </script> <span></span> </body> </html> 提示:你可以先修改部分代码再运行。 转载请注明:有爱前端 » 动画插件animateplus 喜欢 (1)or分享 (0)