# automatos

> A CSS Animation controller

Latest version **0.1.0** (published 2015-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install automatos
pnpm add automatos
yarn add automatos
bun add automatos
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-03-07 |
| First published | 2015-03-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dan Reeves |
| Maintainers | danreeves |
| Keywords | css, animation, promise |

## Links

- npm: https://www.npmjs.com/package/automatos
- Repository: https://github.com/danreeves/automatos
- Issues: https://github.com/danreeves/automatos/issues
- npm.io page: https://npm.io/package/automatos

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-03-07

## README

# Automatos
> A CSS Animation library

Automatos is a small Javascript library for controlling CSS Animations.

**Requires Promises**

## Usage

```
automatos({
    el: '.demo',
    name: 'fadeIn',
    duration: 1000,
});
```

## Options

```
{
    el: DOM node or selector string,
    name: string,
    duration: integer,
    iterations: integer or string,
    direction: string,
    delay: string,
    fillMode: string,
    timingFunc: string
}
```
e.g.

```
{
    el: document.querySelector('.demo'),
    name: 'bounce',
    duration: 1000,
    iterations: 'infinite',
    direction: 'reverse',
    delay: '1s',
    fillMode: 'forwards',
    timingFunc: 'ease-in-out'
}
```

## Methods

### `.after`

Calls a callback after the specified milliseconds.

e.g.

```
[...]
.after(100, function () {
    console.log('calls after 100ms');
})
```

### `.then`

Calls a callback when the animation is complete.

e.g.

```
[...]
.then(function () {
   console.log(this.el, 'has finished animating');
});
```

### `.play`

Sets the play-state to running.

e.g.

```
[...]
.play()
```

### `.pause`

Sets the play-state to paused.

e.g.

```
[...]
.pause()
```

### `.stop`

Stops the animation and emits the animation stopped event.

e.g.

```
[...]
.stop()
```

### `.promise`

A reference to the promise attached to the animation-end event.

e.g.

```
[...]
.promise.then(function () {
    // called when the animation is over
});

// or

var a1 = automatos(//put options here);
var a2 = automatos(//put options here);

Promise.all([a1.promise, a2.promise]).then(function () {
    // called when all animations are over
});

```

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