Coder Social home page Coder Social logo

pcclickbit / react-sprite-scaled-animator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webpty/react-sprite-scaled-animator

0.0 1.0 0.0 846 KB

A React component that animates through an image sprite while scaling to its parent container

License: ISC License

JavaScript 100.00%

react-sprite-scaled-animator's Introduction

React Sprite Scaled Animator

Project forked from https://github.com/jcblw/react-sprite-animator

Build Status

A React component that animates through an image sprite while scaling to its parent container.

Install

$ npm i react-sprite-scaled-animator -S

Usage

<SpriteAnimator
  sprite='/path-to/sprite.svg'
  width={100}
  height={100}
/>

Props

  • width {number} - width of clipped sprite (original, non-scaled dimensions)
  • height {number} - height of clipped sprite (original, non-scaled dimensions)
  • sprite {string} - path to sprite
  • direction {string} - horizontal/vertical
  • shouldAnimate {bool} - if the sprite should animate
  • startFrame {number} - the frame to start animation
  • fps {number} - the frame rate (frames per second) target
  • stopLastFrame {bool} - stops animation from looping
  • frame {number} - manually sets current frame

Only required for two-dimensional sprites

  • frameCount {number} - the total frame count of the sprite
  • wrapAfter {number} - the row or column count of the sprite (direction: "horizontal" -> columns, "vertical" -> rows)

react-sprite-scaled-animator's People

Contributors

dependabot[bot] avatar direct-fuel-injection avatar dlindenkreuz avatar etnlbck avatar greenkeeper[bot] avatar jcblw avatar krisaoe avatar ogaseb avatar timarney avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.