A simple react component that animates an array of frames.
Using yarn:
yarn add react-frame-animator
Using npm:
npm i -S react-frame-animator
- Import After Installation
import FrameAnimator from 'react-frame-animator';
- Add the Component to Your App
<FrameAnimator frames={frames} speed={500} />
Name | Description | Type | Values |
---|---|---|---|
frames * | List of frames to be animated. This can be a url, file path, or image data. | String Array | [ "img/walk_up1.png", "img/walk_up2.png" ] |
speed * | The speed in milliseconds of the animation. | Number | 500, 30, 1000 |
playMode | The mode in which the animation will play. | Number | playModes.NORMAL (Default), playModes.LOOP, playModes.REVERSE, playModes.LOOP_REVERSE |
Note: playModes
can be imported as follows:
import { playModes } from 'react-frame-animator';
Install Dependencies:
yarn install
Run the Demo:
yarn run demo
Build:
yarn run build
This project is licensed under the MIT License - see the LICENSE for details.