animejs

https://animejs.com/

Anime.js (/ˈæn.ə.meɪ/) is a lightweight JavaScript animation library with a simple, yet powerful API.
It works with CSS properties, SVG, DOM attributes and JavaScript Objects.

此库是一个轻量级的JS动画库,带有简单和强大的API。

Anime's built-in staggering system makes complex follow through and overlapping animations simple. It can be used on both timings and properties.

Animate multiple CSS transforms properties with different timings simultaneously on a single HTML element.

Play, pause, control, reverse and trigger events in sync using the complete built-in callbacks and controls functions.

Anime.js works with anything web. CSS, SVG, DOM attributes and JavaScript Objects: animate everything with a single unified API.

GITHUB上有33K的favorites。

https://github.com/juliangarnier/anime/

例子

https://animejs.com/documentation/

物体沿着一条path行进, path的入参数,表示的DOM对象,可以是一个path, 也可以是任意的一个特殊图形, 如圆圈,抛物线。

https://animejs.com/documentation/#motionPath

var path = anime.path('.motion-path-demo path');

anime({
targets: '.motion-path-demo .el',
translateX: path('x'),
translateY: path('y'),
rotate: path('angle'),
easing: 'linear',
duration: 2000,
loop: true
});

教学库

https://github.com/joao-pratas/animejs-tut

https://github.com/joao-pratas/animejs-tut/tree/master/anime-master/documentation/examples

时间线接口,可以串起来每一个小步骤。

https://github.com/joao-pratas/animejs-tut/blob/master/anime-master/documentation/examples/anime-timeline.html

  var noOffset = anime.timeline({
autoplay: true
});
noOffset
.add({
targets: '.no-offset',
translateX: -100,
translateY: -100,
scale: 2,
background: '#FF1461',
begin: function() { console.log('noOffset animation 1 began')},
complete: function() { console.log('noOffset animation 1 completed')}
})
.add({
targets: '.no-offset',
translateX: -100,
translateY: 100,
scale: 3,
background: '#18FF92',
begin: function() { console.log('noOffset animation 2 began')},
complete: function() { console.log('noOffset animation 2 completed')}
})
.add({
targets: '.no-offset',
translateX: 100,
translateY: 100,
rotate: 120,
scale: 4,
background: '#5A87FF',
begin: function() { console.log('noOffset animation 3 began')},
complete: function() { console.log('noOffset animation 3 completed')}
})
.add({
targets: '.no-offset',
translateX: 100,
translateY: -100,
scale: 5,
background: '#FBF38C',
begin: function() { console.log('noOffset animation 4 began')},
complete: function() { console.log('noOffset animation 4 completed')}
})
.add({
targets: '.no-offset',
translateX: 100,
translateY: -100,
scale: '+=8',
background: '#FBF38C',
begin: function() { console.log('noOffset animation 5 began')},
complete: function() { console.log('noOffset animation 5 completed')}
});

练练手

https://github.com/fanqingsong/sun_system

实现一个太阳系行星围绕太阳运转动画。

一个流行的网页动画JS库的更多相关文章

  1. impress.js 一个创建在线幻灯的js库

    真的好奇怪,我居然会写前端技术的博客.没有办法的,最近实习,看的大多是前端.所以今天就用这个来练练手了. Impress.js 是一个非常棒的用来创建在线演示的Javascript库.它基于CSS3转 ...

  2. 安利一个绘制指引线的JS库leader-line

    前言 之前看到一篇推荐Magi这个搜索引擎的新闻,对于这个搜索引擎是否好用咱们不予置评,但是我在这个搜索引擎上面发现了一个好玩的前端功能. 如上图,将鼠标浮动到学习来源上时,会展示一堆指引线. 本博客 ...

  3. 一个构建XML对象的js库

    初学javascript,学习中用到在IE中建立XML对象,于是写了一个简单的“库”.因为水平所限,肯定会有不恰当的地方,欢迎指正. 如果大家有知道现存的更好的东西,非常希望大家能将它推荐给我. 代码 ...

  4. 利用moment为基础,基于DOM实现一个多个倒计时同时进行的js库方便使用

    moment非常强大,提供了很多时间方法的封装,项目需要一个小倒计时的功能,网上找了很多不合适,决定自己写一个,直接上代码 //定义一个立即执行的函数(function () { var Ticts= ...

  5. 利用Bootstrap制作一个流行的网页

    首先是html承载内容: <!DOCTYPE html> <html lang="zh_CN"> <head> <meta charset ...

  6. 分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”

    这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...

  7. 12个值得关注的顶级可视化JS库 涉及图表、动画、时间处理,表格操作

    本文是译文,原文是https://da-14.com/blog/top-11...我在原文的基础上加了百度的Echats图表库,这个也是毫不逊色其他图表库的.另外Handsontable电子表格库也是 ...

  8. Dynamics.js - 创建逼真的物理动画的 JS 库

    Dynamics.js 是一个用来创建物理动画 JavaScript 库.你只需要把dynamics.js引入你的页面,然后就可以激活任何 DOM 元素的 CSS 属性动画,也可以用户 SVG 属性. ...

  9. 网页3D效果库Three.js初窥

    网页3D效果库Three.js初窥 背景 一直想研究下web页面的3D效果,最后选择了一个比较的成熟的框架Three.js下手 ThreeJs官网 ThreeJs-github; 接下来我会陆续翻译 ...

随机推荐

  1. 打造好用的C++ IDE环境

    https://www.jianshu.com/p/1aa989808e15 这哥们说的也是极好,也可以这部分直接看他的示例! mingw-w64应该可以算是mingw的改进版本吧,mingw系列编译 ...

  2. sublime设置代码缩进

    打开sublime的首选项(Preferences)下的设置-用户(Setting-User) ,配置如下代码 , "translate_tabs_to_spaces": true ...

  3. Caused by: java.lang.IllegalStateException: duplicate key: datasource

    java.lang.IllegalStateException: Failed to load property source from location 'classpath:/applicatio ...

  4. 20、Python常用模块sys、random、hashlib、logging

    一.sys运行时环境模块 sys模块负责程序与python解释器的交互,提供了一系列的函数和变量,用于操控python的运行时环境. 用法: sys.argv:命令行参数List,第一个元素是程序本身 ...

  5. React.js 小书

    http://huziketang.mangojuice.top/books/react/

  6. WHAT IS THE DIFFERENCE BETWEEN REACT.JS AND REACT NATIVE?

    Amit Ashwini - 09 SEPTEMBER 2017 React.js was developed by Facebook to address its need for a dynami ...

  7. [React] Write a generic React Suspense Resource factory

    Using Suspense within our component isn't exactly ergonomic. Let's put all that logic into a reusabl ...

  8. 【luoguP2989】[USACO10MAR]对速度的需要Need For Speed

    题目描述 最大化平均值 二分一个\(x\) \(check\): \(\frac{F+\sum_{i=1}^{n} X_{i} \times F_{i}}{M+\sum_{i=1}^{n} X_{i} ...

  9. ffmpeg结合SDL编写播放器(二)

    我们将对帧数据做一些处理,比如将每一帧的 图像转为jpg或者bmp或者ppm等格式保存下来. 举例:在ffmpeg-2.8.8文件夹下编写test.c程序 /* test.c */ #include& ...

  10. 第09组 Alpha冲刺(2/6)

    队名:观光队 组长博客 作业博客 组员实践情况 王耀鑫 过去两天完成了哪些任务 文字/口头描述 完成服务器连接数据库部分代码 展示GitHub当日代码/文档签入记录 接下来的计划 服务器网络请求. 还 ...