# easy-ease

> A tiny easing package with no dependencies

Latest version **1.0.9** (published 2019-11-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-ease
pnpm add easy-ease
yarn add easy-ease
bun add easy-ease
```

## 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.9 |
| Published | 2019-11-09 |
| First published | 2017-12-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 68 |
| Author | David Gilbertson |
| Maintainers | davidgilbertson |
| Keywords | animation, ease, easing, tween |

## Links

- npm: https://www.npmjs.com/package/easy-ease
- Repository: https://github.com/davidgilbertson/easy-ease
- Homepage: https://github.com/davidgilbertson/easy-ease#readme
- Issues: https://github.com/davidgilbertson/easy-ease/issues
- npm.io page: https://npm.io/package/easy-ease

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 1.0.9 (latest) — 2019-11-09
- 1.0.8 — 2018-01-30
- 1.0.7 — 2018-01-01
- 1.0.5 — 2017-12-31
- 1.0.4 — 2017-12-31
- 1.0.3 — 2017-12-31
- 1.0.1 — 2017-12-30
- 1.0.0 — 2017-12-30

## README

# Easy Ease
A tiny easing package (~0.2 KB gzipped) with no dependencies. For doing stuff like:
* Scrolling smoothly to the top of the page
* Sliding out a navigation menu
* Sliding open an accordion component

You won't find any options for different types of easing here. What you get is a nice ease-in-out 
similar to the default animation for `transition` in CSS.

If you'd prefer to choose from the full suite of 
Robert Penner equations, try [tween.js](https://www.npmjs.com/package/@tweenjs/tween.js)
or [d3-ease](https://www.npmjs.com/package/d3-ease) instead.

# Usage
`npm install easy-ease`

## Example

To scroll the window to the top of the page:

```js
import ease from 'easy-ease';

ease({
  startValue: window.scrollY,
  endValue: 0,
  onStep: value => window.scroll(0, value),
});
```

Have a play with some other examples on CodePen https://codepen.io/davidgilbertson/pen/GyrZNz

## API
The `ease` function takes a single parameter, an object. The properties of that object are:

| Property | Type | Description | Default |
| ---- | ---- | ---- | ---- |
| `startValue` | Number | The value at which to start | `0` |
| `endValue` | Number | The value at which to end | `1` |
| `durationMs` | Number | The amount of time (in milliseconds) the transition should take | `200` |
| `onStep` | Function | This will be called on each step of the transition. That's once for each 'animation frame' - roughly every 16 milliseconds. The current value is passed as the only argument. The last time it is called the value is guaranteed to be `endValue`. | No default |
| `onComplete` | Function | Called when the transition is complete. Will be called after the final call to `onStep`. No argument is passed to this function. | noop |

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