(生产)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 ...
随机推荐
- vue_cli下开发一个简单的模块权限系统之展现数据
这个页面是用户列表:userList就是第二张截图中的data里面的userList vue中只要改变存放数据的载体就会实现页面改变,mounted的意思是页面加载时执行这里面的函数,我们需要在页面加 ...
- 解决Android应用安装快完毕时提示签名冲突,android签名文件生成(转)
最近开发了一个Android手机应用,自己用Eclipse调试安装没问题,使用其他人调试生成的bin下的apk就会出现问题,安装到最后提示"安装签名冲突"错误,想了一下估计是没有给 ...
- Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name"
解决办法
- IDEA 中 使用 git(Git)
GitLab GitLab 是一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,并在此基础上搭建起来的web服务.安装方法是参考GitLab在GitHub上的Wiki页面. Git Git( ...
- 百度地图 api bug 解决.......
百度地图 遇到了一个默明奇妙的bug..... 调用后中心点 不再 point(标注的点上...)这是需要执行一次(仅一次) 当 地图 加载完后 执行(这个方法你每次改地图 都会执行...所以让他执 ...
- AngularJS页面【uib-dropdown】控件在模态窗口(弹出窗)中无法使用问题
如果你的下拉框中有属性 dropdown-append-to-body 将它去掉,即可正常使用该插件. <div class="btn-group dropdown" uib ...
- 读经典——《CLR via C#》(Jeffrey Richter著) 笔记_方法执行
[前言] 方法执行前,CLR 会检测方法内代码引用的所有类型.同时 CLR 会分配一个内部数据结构,用来管理对所有引用的类型的访问. 首次执行方法时,托管程序集会把 IL 转换成本地 CPU 指令,并 ...
- Django之auth模块(用户认证)登陆组件
auth模块简介 auth模块是对登录认证方法的一种封装,之前我们获取用户输入的用户名及密码后需要自己从user表里查询有没有用户名和密码符合的对象, 而有了auth模块之后就可以很轻松的去验证用户的 ...
- 75th LeetCode Weekly Contest Champagne Tower
We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so ...
- Codeforces Round #347 (Div. 2) A
Description Greatest common divisor GCD(a, b) of two positive integers a and b is equal to the bigge ...