• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

luster-io/impulse: Dynamic Physics Interactions for the Mobile Web

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

luster-io/impulse

开源软件地址(OpenSource Url):

https://github.com/luster-io/impulse

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

#Impulse ![Gitter](https://badges.gitter.im/Join Chat.svg)

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!

#Discussion

There's also a place to ask questions, or get help here:

https://gitter.im/luster-io/impulse

##LICENSE MIT -- Read LICENSE




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap