• Stars
    star
    409
  • Rank 105,709 (Top 3 %)
  • Language
    JavaScript
  • Created almost 11 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Propeller.js

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

Lot of demos

Spinner game drawn by my doughter

Project page

Propeller.js

Usage

Available on NPM

npm install Propeller

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

More Repositories

1

HTML-GL

Get as many FPS as you need and amazing effects by rendering HTML/CSS in WebGL
JavaScript
3,454
star
2

ViralJS

Express.JS middleware to enable P2P distribution for your app. Your decentralized CDN made easy.
JavaScript
961
star
3

Download-File-JS

Intelligent JavaScript solution for file downloading.
JavaScript
200
star
4

FlashJS

JavaScript graphics and games engine with API similar to Flash one. Just look to examples sources.
JavaScript
174
star
5

pixi-sdf-text

Signed distance field text implementation for PixiJS
JavaScript
96
star
6

OnlineJS

Reliable, fast and easy to use library to check your internet connection status
JavaScript
68
star
7

requestIdleCallback-polyfill

Polyfill for request idle callback. Determines is user interacting with document and fires when it is not or after interaction is finished.
JavaScript
54
star
8

polymer-native

Develop completely native mobile apps with Web Components
JavaScript
46
star
9

CanvasImage

Converts image to canvas with same look. Useful for memory optimization in case of responsive image usage. Also is good for solving PhoneGap Android anti aliasing issue.
JavaScript
34
star
10

pixel-shaders-workshop

GLSL
29
star
11

React-GL

Render React components in WebGL for 60 FPS animations
JavaScript
21
star
12

PrayerWheel

Produces positive karma when spinning, blessing all living beings around and purifying karma of the one who spins it
TypeScript
21
star
13

glsl-component

Lightweight library for GLSL rendered web components
HTML
17
star
14

HTML-Aircraft-Indicators

Indicators for multifunctional display built with HTML
CSS
16
star
15

Mobile-Transitions

High performance JavaScript library to emulate native mobile transitions. Designed to be as easy to use as possible. Just look to example.
JavaScript
11
star
16

Telekinesis-JS

JavaScript multiplayer game engine. Using Node.JS for server and any graphic library for client-side.
JavaScript
9
star
17

webgpu-vs-webgl-compute-matrix-multiplication

WebGL vs WebGPU vs JavaScript demo shows the difference in performance when naively multiplying some matrices
JavaScript
9
star
18

isAntialiasingSupportedForWebGL

gl.antialias=true does not guarantee it is actually going to be ON because browser accepts antialias attribute just as a hint and decides on itself there. This library checks for actual AA availability.
JavaScript
6
star
19

StyleObserver

The StylesObserver library provides the ability to watch for changes being made to the styles of the element
TypeScript
5
star
20

fps-control-chrome-extension

Control FPS in your browser for testing, performance investigation or to stress your app with dropped frames
JavaScript
4
star
21

GetterSetterJS

Π‘ross-browser way to getters and setters
JavaScript
4
star
22

PerFix

Rendering smoothness benchmark for scientific - blended performance optimization, written in JavaScript
JavaScript
3
star
23

QuickContext

ContextAPI state management made Easy. Less code more performance.
JavaScript
1
star
24

CodeTone

Let code play!
CSS
1
star