0.2.3 • Published 9 years ago

famous-animation-engine v0.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

famous-animation-engine

Extract famous transitionable capabilities in 10kb. Mixin to transition between state values.

Example

import {TransitionableMixin, Easing} from 'famous-animation-engine';

var TestComponent = React.createClass({
  mixins: [TransitionableMixin(["width", "height"])],

  getInitialState() {
    return {
      width: 200,
      height: 50
    }
  },

  handleClick() {
    this.width = {
      value: 800,
      duration: 5000
    };
    this.height = {
      value: 400,
      duration: 2000,
      curve: Easing.outCirc
    };
  },

  handleStop() {
    this.halt();
  },

  render() {
    return (
      <div>
        <button onClick={this.handleClick}>click me</button>
        <button onClick={this.handleStop}>Stop</button>
        <div style={{
          width: this.state.width,
          height: this.state.height,
          backgroundColor: 'blue',
          color: "white"
        }}>Loader</div>
      </div>
    )
  }
});

React.render(<TestComponent/>, document.body);
0.2.3

9 years ago

0.2.2

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago