<commit_before># Tweenzy.js

A simple utility to easily create performant tweening.

### Installation

##### Npm

Add it to your `package.json`, and make sure to load it in using a module loader like browserify or webpack.

```shell
$   npm install tweenzy --save
```

##### Bower

Install via the bower commandline tool

```shell
$   bower install tweenzy
```

##### Script

Download the dist folder and copy this to your HTML

```html
<script src="dist/tweenzy.min.js"></script>
```

### Usage

+ Create a new instance
+ Specify options
+ Attach to the emitter
+ Run the tween

```es6
import Tweenzy from 'tweenzy'

let div = document.querySelector('div')

// create new instance

let animatedHeight = new Tweenzy({
  duration: 1000,         // in ms
  start: 0,               // the start tween value
  end: 1000,              // end tween value
  ease: ease-in-out-quad  // pass in easing function, see details below
})

// attach to the emmiter
animatedHeight.on('tick', val => div.style.height = `${val}px`)

// begin the tweening
animatedHeight.begin()
```

### Examples

These examples will assume you have imported the library as Tweenzy.

##### Animate the height of a div on a button click

```es6
let div = document.querySelector('div')
let animatedHeight = new Tweenzy({ start: 0, end: 1000})
animatedHeight.on('tick', val => div.style.height = `${val}px`)

let button = document.querySelector('button').addEventListener('click', animatedHeight.begin)<commit_msg>reorder readme usage to top<commit_after># Tweenzy.js

A simple utility to easily create performant tweening.

### Usage

+ Create a new instance
+ Specify options
+ Attach to the emitter
+ Run the tween

```es6
import Tweenzy from 'tweenzy'

let div = document.querySelector('div')

// create new instance

let animatedHeight = new Tweenzy({
  duration: 1000,         // in ms
  start: 0,               // the start tween value
  end: 1000,              // end tween value
  ease: ease-in-out-quad  // pass in easing function, see details below
})

// attach to the emmiter
animatedHeight.on('tick', val => div.style.height = `${val}px`)

// begin the tweening
animatedHeight.begin()
```

### Installation

##### Npm

Add it to your `package.json`, and make sure to load it in using a module loader like browserify or webpack.

```shell
$   npm install tweenzy --save
```

##### Bower

Install via the bower commandline tool

```shell
$   bower install tweenzy
```

##### Script

Download the dist folder and copy this to your HTML

```html
<script src="dist/tweenzy.min.js"></script>
```

### Examples

These examples will assume you have imported the library as Tweenzy.

##### Animate the height of a div on a button click

```es6
let div = document.querySelector('div')
let animatedHeight = new Tweenzy({ start: 0, end: 1000})
animatedHeight.on('tick', val => div.style.height = `${val}px`)

let button = document.querySelector('button').addEventListener('click', animatedHeight.begin)
{'fraction_non_alphanumeric': 0.1260957518543493, 'fraction_numerical': 0.01078894133513149, 'mean_word_length': 3.6872037914691944, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '272762', 'n_tokens_mistral': 949, 'n_tokens_neox': 899, 'n_words': 341}