# animation-util

> util for animation

Latest version **1.0.11** (published 2019-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install animation-util
pnpm add animation-util
yarn add animation-util
bun add animation-util
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2019-11-05 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 42.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xiaoqi.huxq |
| Maintainers | huxiaoqi |
| Keywords | animation, util, timer, easing, bezier |

## Links

- npm: https://www.npmjs.com/package/animation-util
- Repository: https://github.com/huxiaoqi567/animation-util
- Homepage: https://github.com/huxiaoqi567/animation-util#readme
- Issues: https://github.com/huxiaoqi567/animation-util/issues
- npm.io page: https://npm.io/package/animation-util

## Dependencies (1)

- [object-assign](https://npm.io/package/object-assign.md) ^4.1.1

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2019-11-05
- 1.0.10 — 2018-02-11
- 1.0.9 — 2018-02-07
- 1.0.8 — 2018-01-30
- 1.0.7 — 2018-01-30
- 1.0.6 — 2018-01-30
- 1.0.5 — 2018-01-30
- 1.0.4 — 2018-01-30
- 1.0.3 — 2017-11-22
- 1.0.2 — 2017-11-22
- 1.0.1 — 2017-11-22
- 1.0.0 — 2017-11-22
- 0.0.3 — 2017-10-26
- 0.0.2 — 2017-10-20
- 0.0.1 — 2017-10-20

## README

# AnimationUtil

## 安装

```bash
$ npm install animation-util --save
```

## 引用

```jsx
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说明

### 属性

|名称|类型|默认值|描述|
|:---------------|:--------|:----|:----------|
|duration|Number|Infinity|动画周期(ms)|
|easing|String|linear|动画缓动函数 |
|bezierArgs|Array|-|动画缓动函数(贝塞尔) |



### 方法

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

---
_Source: https://npm.io/package/animation-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
