(生产)create-keyframe-animation -动画实现
参考:https://github.com/HenrikJoreteg/create-keyframe-animation
实例
var animations = require('create-keyframe-animation') 新建动画:animations.registerAnimation({
name: 'move',//动画名称
animation: [ //实现的动画效果
0: {transform: `translate3d(${x}px,${y}px,0) scale(${scale})` },
60: {transform: `translate3d(0,0,0) scale(1.1)` },
100: {transform: `translate3d(0,0,0) scale(1)` }
],
presets: {
duration: 1000, // 持续时间
fillMode: 'both', // css3 animation 的 fill-mode 属性
easing: 'ease', // 动画的效果 default easing
iterations: 1, // 实现动画的次数
delay: 0, // 延迟
direction: 'normal', // 方向
resetWhenDone: false, // if true :将最后动画状态应用为“变换”属性
clearTransformsBeforeStart: false // 是否在动画开始之前清除现有的转换
}
})使用:animations.runAnimation(document.querySelectorAll('.dots'), 'move',function(){})
.runAnimation(element(s), name string or options object, [callback])返回一个 promise
参数element : 可以是一个单一的元素,元素或querySelectorAll结果数组- 参数name:
如果是字符串,那么就是registerAnimation定义的动画名称
如果传递对象,它必须包含名称,例子:
animations.runAnimation(document.querySelectorAll('.dots'), {
name: 'wiggle',
delay: 1500 // 在这里,我们可以重写如上所述的任何预置选项
}, function () {}
callback 回调
(生产)create-keyframe-animation -动画实现的更多相关文章
- CSS3 animation 动画
今天看到一个很酷的logo看了下他用的是animation 动画效果,就拿来做例子 浏览器支持 Internet Explorer 10.Firefox 以及 Opera 支持 animation 属 ...
- Android Property Animation动画
3.0以前,android支持两种动画模式,tween animation,frame animation,在android3.0中又引入了一个新的动画系统:property animation,这三 ...
- css3 animation 动画属性简介
animation 动画属性介绍 animation 属性是一个简写属性,用于设置动画属性: 1. animation-name----规定需要绑定到选择器的 keyframe 名称. 语法:anim ...
- css3 animation动画特效插件的巧用
这一个是css3 animation动画特效在线演示的网站 https://daneden.github.io/animate.css/ 下载 animate.css文件,文件的代码很多,不过要明白 ...
- android Animation 动画绘制逻辑
参考:http://www.jianshu.com/p/3683a69c38ea 1.View.draw(Canvas) 其中步骤为:/* * Draw traversal performs seve ...
- 转 iOS Core Animation 动画 入门学习(一)基础
iOS Core Animation 动画 入门学习(一)基础 reference:https://developer.apple.com/library/ios/documentation/Coco ...
- css3 animation动画技巧
一,css3 animation动画前言 随着现在浏览器对css3的兼容性越来越好,使用css3动画来制作动画的例子也越来越广泛,也随着而来带来了许多的问题值得我们能思考.css3动画如何让物体运动更 ...
- 【Android 基础】Animation 动画介绍和实现
在前面PopupWindow 实现显示仿腾讯新闻底部弹出菜单有用到Animation动画效果来实现菜单的显示和隐藏,本文就来介绍下吧. 1.Animation 动画类型 Android的animati ...
- css3 transition属性变化与animation动画的相似性以及不同点
下面列子中的2个图片的效果. http://zqtest.e-horse.cn/DongXueImportedCar/assets/mouseOverAnimate.html 第一个为transiti ...
- Android中xml设置Animation动画效果详解
在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...
随机推荐
- ORACLE 中dbms_stats的使用
dbms_stats能良好地估计统计数据(尤其是针对较大的分区表),并能获得更好的统计结果,最终制定出速度更快的SQL执行计划. exec dbms_stats.gather_schema_stats ...
- [转]Log4j配置详解
来自: http://www.blogjava.net/zJun/archive/2006/06/28/55511.html Log4J的配置文件(Configuration File)就是用来设置记 ...
- ExtJS 4.2.1学习笔记(二)——主题theme
1 UI组件基础 学习ExtJs就是学习组件的使用.ExtJs4对框架进行了重构,其中最重要的就是形成了一个结构及层次分明的组件体系,由这些组件形成了Ext的控件. E ...
- Tensorflow方法介绍
一.reduce系列函数(维度操作) 1.tf.reduce_sum( input_tensor, axis=None, keep_dims=False, name=None, reduction_i ...
- 13.Convert BST to Greater Tree(将树转为更大树)
Level: Easy 题目描述: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every k ...
- Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
这是因为防火墙或者配置文件导致,无法启动的邮件服务!! 首先关闭防火墙! 修改配置文件 vim /etc/postfix/main.cf inet_protocols = ipv4 inet_inte ...
- Qt 学习之路 2(8):添加动作
Home / Qt 学习之路 2 / Qt 学习之路 2(8):添加动作 [在WINDOWS10 QTCREATOR MENU添加无效] Qt 学习之路 2(8):添加动作 豆子 ...
- Til the Cows Come Home (dijkstra算法)
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before ...
- 华东交通大学2015年ACM“双基”程序设计竞赛1001
Problem A Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Sub ...
- nginx配置应用
启动nginxvim /usr/local/lnmp/nginx/conf/nginx.conf mkdir /wwwcd /wwwvim index.html www.westos.orgmkdir ...