Giter Site home page Giter Site logo

mcanthony / propeller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pixelscommander/propeller

1.0 2.0 0.0 450 KB

JavaScript library to rotate elements with mouse or touch gestures. Supports inertia and stepwise rotation. Optimized for better performance.

Home Page: http://pixelscommander.com/polygon/propeller/

JavaScript 49.48% CSS 14.24% HTML 36.28%

propeller's Introduction

Propeller.js

JavaScript library to rotate elements by mouse. Supports inertia and stepwise rotation. It is also compatible with touch devices.

Lot of demos

Project page

Propeller.js

##Usage

####Easy-to-use as jQuery plugin: $(nodeOrSelector).propeller(options);

####or zero-dependancy library new Propeller(nodeOrSelector, options)

##Performance Propeller uses requestAnimationFrame and GPU compositing for better performance.

##Options

  • angle sets initial angle
  • inertia is the most valueble option. It is a number between 0 and 1. 0 means no rotation after mouse was released. 1 means infinite rotation. For this demo we use inertia equals to 0.99.
  • speed - initial speed of rotation. It also can be used as property in runtime.
  • minimalSpeed - minimal speed of rotation. Works only if propeller have inertia between 0 and 1.
  • step allows to set step in degrees for stepwise mode.
  • stepTransitionTime enables CSS transition to move from step to step. This makes steps smooth and allows to use CSS transitions easing.
  • stepTransitionEasing CSS easing mode for transition when in stepwise mode and stepTransitionTime is more than zero. A bit more about easing functions
  • onRotate callback executed when rotated. You can easily get current angle as this.angle inside of callback function.
  • onStop callback executed when stopped.
  • onDragStart callback executed when start dragging.
  • onDragStop callback executed when stop dragging.

##Methods

  • unbind unbind listeners to make propeller inactive, this does not stop rotation
  • bind bind listeners after they were unbinded
  • stop stop rotation immidiately

##Public properties

  • angle current propellers angle.
  • speed current speed of rotation. Degrees per frame.

##License

MIT: http://mit-license.org/

Copyright 2014 Denis Radin aka PixelsCommander

propeller's People

Contributors

pixelscommander avatar netsgnut avatar

Stargazers

Michael Anthony avatar

Watchers

Michael Anthony avatar  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.