# @huteming/util-animation

> 提供动画的简单算法

Latest version **4.0.0** (published 2020-02-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @huteming/util-animation
pnpm add @huteming/util-animation
yarn add @huteming/util-animation
bun add @huteming/util-animation
```

## 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 | 4.0.0 |
| Published | 2020-02-05 |
| First published | 2019-02-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 759.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | huteming |

## Links

- npm: https://www.npmjs.com/package/@huteming/util-animation
- npm.io page: https://npm.io/package/@huteming/util-animation

## Recent versions

- 4.0.0 (latest) — 2020-02-05
- 1.2.1-alpha.0 — 2019-02-18
- 1.0.3-alpha.0 — 2019-02-15
- 1.0.2-alpha.0 — 2019-02-14
- 1.0.1 — 2019-02-13

## README

> 动画的简单算法

--------------

## 示例

```javascript
import { animation } from '@huteming/util'

animation.linear(from, to, (now, done) => {}, duration)
```

## 方法

| 函数 | 说明 |
|----------|-----------|
| linear | 匀速 |
| easeIn | 减速进入，加速离开 |
| easeOut | 加速进入，减速离开 |
| easeInOut | 减速进入，加速，在减速离开 |

### 函数参数列表

| name | 描述 | 类型 | 默认值 |
|---------|-----------|----------|---------|
| from | 起始位置 | Number | |
| to | 结束位置 | Number | |
| callback | 变化的位置回调, 支持两个参数, value和isEnding, 表示当前的位置值（数值）以及是否动画结束了（布尔值）| Function(now, done) | |
| duration | 持续时间毫秒数 | Number | `300` |

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