create-keyframe-animation-js实现css3动画
来源:互联网 发布:阿里云主机免费试用 编辑:程序博客网 时间:2024/06/07 22:02
create-keyframe-animation
github地址
这两天在项目里接触到这个库,在这里记录一下。
使用JavaScript在浏览器中动态生成CSS关键帧动画。
可以在项目中npm下载
// 引用var animations = require('create-keyframe-animation')
我这里配合vue transition js钩子函数 enter after-enter
enter(el, done) { // 设置动画帧数 let animation = { 0: { transform: `translate3d(${x}px, ${y}px, 0) scale(${scale})` }, 60: { transform: 'translate3d(0, 0, 0) scale(1.2)' }, 100: { transform: 'translate3d(0, 0, 0) scale(1)' } } // 注册动画 animations.registerAnimation({ name: 'move', // 插入自定义的动画 animation, // 参数配置 presets: { duration: 1000, // 持续时间 easing: 'linear', // 过度效果 delay: 500 // 延迟时间 terations: 1, // 实现动画的次数 delay: 0, // 延迟 direction: ‘normal‘, // 方向 resetWhenDone: false, // if true :将最后动画状态应用为“变换”属性 clearTransformsBeforeStart: false // 是否在动画开始之前清除现有的转换 } }) animations.runAnimation(el, 'move', function () { // callback gets called when its done })},afterEnter() { // 取消动画 animations.unregisterAnimation('move') this.$refs.cdWrapper.style.animation = '' }
阅读全文
0 0
- create-keyframe-animation-js实现css3动画
- Html+CSS CSS3 Keyframe+Animation属性 CSS动画
- jQuery Animation实现CSS3动画
- css3 animation 实现帧动画
- CSS3 Animation实现加载动画
- 细说css3中的animation和keyframe
- CSS3动画animation实现漂浮的云
- css3动画显示实现animation属性
- CSS3 animation实现点点点loading动画
- CSS3 animation动画实现轮播图效果
- iOS UIView动画实践(五):Keyframe Animation
- Animation动画详解(八)——PropertyValuesHolder与Keyframe
- iOS UIView动画实践(五):Keyframe Animation
- CSS3 -webkit-animation(动画)
- CSS3 动画之animation
- CSS3之动画Animation
- css3的animation 动画
- css3 animation动画事件
- kettle保存资源库报错:一个数据库错误发生在从资源库文件读取转换时
- Ubuntu QT4 安装以及各个安装工具介绍
- JAVA作业2
- Spark:用Java和Scala实现WordCount
- 129. Sum Root to Leaf Numbers
- create-keyframe-animation-js实现css3动画
- jquery实现导航吸顶效果
- codeforces 894A. QAQ
- iOS微信分享&h5和原生app交互
- Android中UI线程(主线程)和子线程间的通讯方式比较
- js包装对象
- 解决loadrunner11 无法连接oracle数据库的问题
- Rxjava实现eventbus效果
- Spring-Boot启动方式