(生产)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 ...
随机推荐
- kuangbin专题七 POJ3468 A Simple Problem with Integers (线段树或树状数组)
You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. One type of op ...
- HashMap 1.8的源码分析二
hashmap的构造方法: public HashMap(int initialCapacity, float loadFactor) { ) throw new IllegalArgumentExc ...
- Exadata X7来了
1.Exadata Brings In-Memory OLTP to Storage Exadata Storage Servers add a memory cache in front of Fl ...
- lambda函数/排序/filter/map
1.lambda 匿名函数 zrf = lambda x:x**2 ret = zrf(10) #这里面实际上还是有函数名 print(ret) 2.sorted 排序(list也自带排序功能) 排序 ...
- JS模式和原型精解
首先需要知道的是 模式只是思想.不要用 结构 看模式. ES中函数是对象,因此函数也有属性和方法. 每个函数含有两个属性: length 和 prototype 每个函数含有两个非继承的方法: app ...
- 解决浏览器location.href重定向失效问题
在[location.href]赋值语句后,添加页面刷新代码[location.reload(true)],参数为[true]这样就等价于F5刷新页面了. 需要注意的是:不能把[location.re ...
- PAT - 1067 试密码 (20 分)
当你试图登录某个系统却忘了密码时,系统一般只会允许你尝试有限多次,当超出允许次数时,账号就会被锁死.本题就请你实现这个小功能. 输入格式: 输入在第一行给出一个密码(长度不超过 20 的.不包含空格. ...
- TortoiseGit安装简单介绍和使用
首先,你必须有会装软件的技能和一个看得懂英语的眼睛.然后保证Git也装好了 他提供了中文版的安装包哦 安装过程尽量选择默认就行,先装上面那个啊,语言包最后装. 语言配置 因为以前装过,所以...路径是 ...
- Life is a journey
Life is a journey. What we should care about is not where it's headed but what we see and how we fee ...
- GitLab 遇到的坑
Job for postfix.service failed because the control process exited with error [zbb@storage1 ~]$ sudo ...