一个流行的网页动画JS库
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库的更多相关文章
- impress.js 一个创建在线幻灯的js库
真的好奇怪,我居然会写前端技术的博客.没有办法的,最近实习,看的大多是前端.所以今天就用这个来练练手了. Impress.js 是一个非常棒的用来创建在线演示的Javascript库.它基于CSS3转 ...
- 安利一个绘制指引线的JS库leader-line
前言 之前看到一篇推荐Magi这个搜索引擎的新闻,对于这个搜索引擎是否好用咱们不予置评,但是我在这个搜索引擎上面发现了一个好玩的前端功能. 如上图,将鼠标浮动到学习来源上时,会展示一堆指引线. 本博客 ...
- 一个构建XML对象的js库
初学javascript,学习中用到在IE中建立XML对象,于是写了一个简单的“库”.因为水平所限,肯定会有不恰当的地方,欢迎指正. 如果大家有知道现存的更好的东西,非常希望大家能将它推荐给我. 代码 ...
- 利用moment为基础,基于DOM实现一个多个倒计时同时进行的js库方便使用
moment非常强大,提供了很多时间方法的封装,项目需要一个小倒计时的功能,网上找了很多不合适,决定自己写一个,直接上代码 //定义一个立即执行的函数(function () { var Ticts= ...
- 利用Bootstrap制作一个流行的网页
首先是html承载内容: <!DOCTYPE html> <html lang="zh_CN"> <head> <meta charset ...
- 分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”
这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...
- 12个值得关注的顶级可视化JS库 涉及图表、动画、时间处理,表格操作
本文是译文,原文是https://da-14.com/blog/top-11...我在原文的基础上加了百度的Echats图表库,这个也是毫不逊色其他图表库的.另外Handsontable电子表格库也是 ...
- Dynamics.js - 创建逼真的物理动画的 JS 库
Dynamics.js 是一个用来创建物理动画 JavaScript 库.你只需要把dynamics.js引入你的页面,然后就可以激活任何 DOM 元素的 CSS 属性动画,也可以用户 SVG 属性. ...
- 网页3D效果库Three.js初窥
网页3D效果库Three.js初窥 背景 一直想研究下web页面的3D效果,最后选择了一个比较的成熟的框架Three.js下手 ThreeJs官网 ThreeJs-github; 接下来我会陆续翻译 ...
随机推荐
- Hibernate各种状态(瞬时状态、持久化状态、游离|托管状态)之间的转换
- pandas知识点脑图汇总
参考文献: [1]Pandas知识点脑图汇总
- jlink之j-scope使用
网上看到了j-scope的用法,可以把单片机的数据显示成波形,这个和我使用的STMStudio有点类似,但是有区别: 1.STMStudio这个需要stlink结合swo的输出口,j-scope不需要 ...
- Cookies and Custom Protocols
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/URLLoadingSystem/Cookiesa ...
- 提交代码报错 error: failed to push some refs to
在本人想把本地的分支推送到远程仓库时,突然出现了错误提醒error: failed to push some refs to....心里一咯噔,推不上去这还得了,手比脑快地就去google了一下. 然 ...
- Likelihood function
似然函数 统计学中,似然函数是一种关于统计模型参数的函数,表示模型参数中的似然性. 给定输出x时,关于参数θ的似然函数L(θ|x)(在数值上)等于给定参数θ后变量X的概率:L(θ|x)=P(X=x|θ ...
- 探索Windows 10的CFG机制
转载https://www.anquanke.com/post/id/85493 0x00 前言 随着操作系统开发人员一直在增强漏洞利用的缓解措施,微软在Windows 10和Windows 8.1 ...
- datetime.now()提示没有now方法
py3.6 导入方法是 from datetime import datetime 在使用datetime.now()的时候报错,说没有now 在保存module的create_time字段的时候,提 ...
- shell 只读变量
test.sh: #!/bin/bash myUrl="http://www.google.com" readonly myUrl myUrl="http://www.r ...
- SpringBoot:使用feign调用restful服务时地址栏传参
1.服务提供者(controller层) @GetMapping("/user/{id}") public ApiResult getById(@PathVariable(&quo ...