# easeer-js

> JavaScript module with easing generators and basic animation functions

Latest version **1.0.0** (published 2022-03-02) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install easeer-js
pnpm add easeer-js
yarn add easeer-js
bun add easeer-js
```

## 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.0 |
| Published | 2022-03-02 |
| First published | 2022-03-02 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Còdec |
| Maintainers | codeccoop |

## Links

- npm: https://www.npmjs.com/package/easeer-js
- Repository: https://github.com/codeccoop/Easeer.js
- Homepage: https://github.com/codeccoop/Easeer.js#readme
- Issues: https://github.com/codeccoop/Easeer.js/issues
- npm.io page: https://npm.io/package/easeer-js

## Recent versions

- 1.0.0 (latest) — 2022-03-02

## README

# Easeer.js

JavaScript module with easing generators and basic animate and throttle functions.

## Installation

`npm i easeer-js`

## Usage

Easeer.js offers two different approaches: Work with **javascript generators** to
get easing curves, or work with **javascript functions** to perform animations.

### Easing
```javascript
const { easeInOut, inteval } = require("easeer-js");

const easing = easeInOut([0, 1000], 100);
let next = easing.next();
while (next.done !== true) {
    console.log(next.value);
    next = easing.next();
}
```

### Animation
```javascript
var total = 100;
throttle(function (progress) {
    console.log("Loading: " + progress * total + "%");
}, {
    interval: 50,
    duration: 1000,
    easing: "in"
});
```

## Functions

<dl>
<dt><a href="#easeInOut">easeInOut(domain, steps)</a> ⇒ <code>object</code></dt>
<dd><p>Perform an ease-in-out curve from min to max evaluated in n steps.</p>
</dd>
<dt><a href="#easeOut">easeOut(domain, steps)</a> ⇒ <code>object</code></dt>
<dd><p>Perform an ease-out curve from min to max evaluated in n steps.</p>
</dd>
<dt><a href="#easeIn">easeIn(domain, steps)</a> ⇒ <code>object</code></dt>
<dd><p>Perform an ease-in curve from min to max evaluated in n steps.</p>
</dd>
<dt><a href="#throttle">throttle(fn, settings)</a> ⇒ <code>function</code></dt>
<dd><p>Perform an easeing based animation throghout a duration time updated in a deterimed interval</p>
</dd>
<dt><a href="#animation">animation(callback, settings)</a> ⇒ <code>function</code></dt>
<dd><p>Perform an easing based animation with N frames</p>
</dd>
</dl>

<a name="easeInOut"></a>

## easeInOut(domain, steps) ⇒ <code>object</code>
Perform an ease-in-out curve from min to max evaluated in n steps.

**Kind**: global function  
**Returns**: <code>object</code> - easing  

| Param | Type | Description |
| --- | --- | --- |
| domain | <code>Array</code> | An array with tow values, min and max of the easing domain |
| steps | <code>number</code> | How many steps has to return the easing between min and max |

<a name="easeOut"></a>

## easeOut(domain, steps) ⇒ <code>object</code>
Perform an ease-out curve from min to max evaluated in n steps.

**Kind**: global function  
**Returns**: <code>object</code> - easing  

| Param | Type | Description |
| --- | --- | --- |
| domain | <code>Array</code> | An array with tow values, min and max of the easing domain |
| steps | <code>number</code> | How many steps has to return the easing between min and max |

<a name="easeIn"></a>

## easeIn(domain, steps) ⇒ <code>object</code>
Perform an ease-in curve from min to max evaluated in n steps.

**Kind**: global function  
**Returns**: <code>object</code> - easing  

| Param | Type | Description |
| --- | --- | --- |
| domain | <code>Array</code> | An array with tow values, min and max of the easing domain |
| steps | <code>number</code> | How many steps has to return the easing between min and max |

<a name="throttle"></a>

## throttle(fn, settings) ⇒ <code>function</code>
Perform an easeing based animation throghout a duration time updated in a deterimed interval

**Kind**: global function  
**Returns**: <code>function</code> - close - A function to stop the animation before it reaches the end  

| Param | Type | Description |
| --- | --- | --- |
| fn | <code>function</code> | The callback function to be triggered on eacn interval |
| settings | <code>object</code> | A configuration object with values for 'interval', 'duration' and 'easing'. The 'interval' value is for the time interval in milliseconds and have 10ms as default value, 'duration' defines the animation time duration and has 1000ms as default value, and 'easing' is to choose what type of easing the animations has to follow and has 'in-out' as default value. |

<a name="animation"></a>

## animation(callback, settings) ⇒ <code>function</code>
Perform an easing based animation with N frames

**Kind**: global function  
**Returns**: <code>function</code> - close - A function to stop the animation before it reached the end  

| Param | Type | Description |
| --- | --- | --- |
| callback | <code>function</code> | The callback function to be triggered on each frame |
| settings | <code>object</code> | A configuration object with values fro 'frames' and 'easing'. The 'frames' defines how much long will be the animation, the 'easing' is to choose what type of easing the animation has to follow. |

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