Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luster-io/impulse
Dynamic Physics Interactions for the Mobile Web
https://github.com/luster-io/impulse
Last synced: 20 days ago
JSON representation
Dynamic Physics Interactions for the Mobile Web
- Host: GitHub
- URL: https://github.com/luster-io/impulse
- Owner: luster-io
- License: mit
- Created: 2014-07-26T18:32:40.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-12T02:27:34.000Z (over 9 years ago)
- Last Synced: 2024-10-01T15:41:25.712Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://impulse.luster.io
- Size: 487 KB
- Stars: 1,588
- Watchers: 50
- Forks: 74
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - impulse - Dynamic Physics Interactions for the Mobile Web (JavaScript)
README
#Impulse
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/luster-io/impulse?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)Create animations that flow naturally from the user's movements.
Rather than animating properties for a set amount of time,
impulse takes a start position, end position, and velocity.##example
```
var ball = Impulse(document.querySelector('.ball'))
.style({
translate: function(x, y) { return x + 'px, ' + y + 'px' },
})
//set a starting position
ball.position(50, 50)ball.spring({ tension: 100, damping: 10 })
.to(100, 100).start()
```More examples can be found [here](http://impulse.luster.io/examples.html)
##Installation
####Browserify
```
npm install impulse
```####Bower
```
bower install impulse
```
Exposes a global called Physics####Component
```
component install luster-io/impulse
```####Manually
Get `build/impulse.js` or `build/impulse.min.js` from github.
```html
```Exposes a global called impulse
##High Level Explanation
Calling `Impulse` on an element or set of elements returns an Impulse object.
A physics object maintains it's own position and velocity. You can interact
with a Impulse object (drag, pan, etc), and animate it. Animations take
the current position and velocity of the PhysicsObject as a starting point, and
animate to a user defined position.This makes the animations flow naturally from the user's actions. For example a user can drag an element around. Once they're done dragging,
the next animation will start from the position and velocity that they left off.Documentation can be found [here](http://impulse.luster.io/guides.html)
#Contributing
Bug reports are extremely useful, if you think something's wrong, create an
issue.If there's an interaction you'd like to see, but you don't know if it's
possible, please create an issue. Maybe we can find a way to build it!#Discussion
There's also a place to ask questions, or get help here:
[https://gitter.im/luster-io/impulse](https://gitter.im/luster-io/impulse)
##LICENSE
MIT -- Read LICENSE