1.0.11 • Published 5 years ago

animation-util v1.0.11

Weekly downloads
167
License
MIT
Repository
github
Last release
5 years ago

AnimationUtil

安装

$ npm install animation-util --save

引用

import Timer from 'animation-util';

使用示例

var Timer = require('animation-util');

var block = document.querySelector('#block');

let timer = new Timer({
  duration: 500,
  easing: 'easeOutSine',
  onStart:(e)=>{
    console.log(e);
  },
  onRun: (e) => {
    block.style.webkitTransform = `translateX(${e.percent * 200}px)`;
  },
  onEnd: (e)=>{
    console.log(e)
  }
});

timer.run();

API说明

属性

名称类型默认值描述
durationNumberInfinity动画周期(ms)
easingStringlinear动画缓动函数
bezierArgsArray-动画缓动函数(贝塞尔)

方法

名称参数返回值描述
run//开始动画
stop//停止动画
onStart/开始动画
onRun/正在动画
onStop/正在中断
onEnd/结束动画
1.0.11

5 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago