0.2.0 • Published 6 years ago

the-oa v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

The-OA

A reactive animation library.

  • Observable-base: Everything is observable (Rxjs)!
  • Fast: Dispatch value on animation frame without any waste.
  • Tiny: Only 4 kb (without gzip)

Install

npm install the-oa --save

or

yarn add the-oa

Usage

import { tween, easing } from 'the-oa';

const squareDOM = document.getElementById('square');

tween({
  from: { x: 0, r: 0 },
  to: { x: 500, r: 180 },
  duration: 1200,
  ease: easing.backOut,
}).subscribe(({ x, r }) => {
  squareDOM.style.transform = `translateX(${x}px) rotateZ(${r}deg)`;
});

Demo

Edit the-oa

API

tween(config): Observable

Arguments

  • config :
{
    from: any,
    to: any,
    duration?: number,
    ease?: function
}
0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago