GithubHelp home page GithubHelp logo

faizalpribadi / impulse Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luster-io/impulse

0.0 0.0 0.0 174 KB

Dynamics Physics Interactions for the Mobile Web

Home Page: impulse.luster.io

License: MIT License

impulse's Introduction

#Impulse

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

##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.

  <script src="/scripts/impulse.js"></script>

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

#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!

##LICENSE MIT -- Read LICENCE

impulse's People

Contributors

xcoderzach 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.