Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

anymation

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anymation

Simple & easy animation/tweener

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

anymation

Simple stand-alone animation / tweening library. Currently works in node or in browsers w/ browserify.

Basic use

var Animation = require("anymation");

var objectToAnimate = {
   x: 40
};

var animation = new Animation({
   object: objectToAnimate,
   duration: 3000, // 3 seconds
   props: {
      x: 500
   }
};

// Your render loop is up to you

function render() {
   animation.update();
   // Draw / update what you need to based on objectToAnimate's properties
   // ...
   
   requestAnimationFrame(render);
}

render();

API

Animation(options)

Constructor for an Animation. Calling it with the new operator is optional. The animation starts immediately.

  • options: An object specifying options:
    • object (object, required) - The object whose properties are going to get changed by the animation.
    • duration (number, optional, default=1000) - Duration for animation, in milliseconds
    • props (object, optional) - Specification of what to actually animate. See below.
    • onComplete (function, optional) -Function called when the animation completes
    • onCancel (function, optional) - Function called when the animation is canceled
Props object

... to be continued

Keywords

FAQs

Package last updated on 03 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc