Show HN: Impulse – Dynamic JS Animations for the Mobile Web
impulse.luster.io
impulse.luster.io
coderzach, since you're here and responding, how would you compare your library to Velocity? (http://julian.com/research/velocity/)
EDIT: Ah, should've kept reading. The answer is here: http://impulse.luster.io/guides.html
Having messed around with 2d games this seems really intuitive and exciting. Nice job and well named.
Number two is that, even though it's running a physics simulation for each animation, we kept the physics code really simple. The simulation code generally takes less time than the drawing itself.
It also doesn't rely on jquery animate, which has a lot of extra cruft to run on older browsers and support legacy code. Writing the rendering in pure javascript helps a ton.
And I think the last thing is that, when the animations respond with the velocity of your interaction it makes everything feel really smooth.
Even if an animation runs at 60fps, if the way it responds to your touch feels bad, the animation won't look good.
Right now it's iOS and Android, and works on most versions I've been able to test on. It works on windows tablet, but I haven't been able to get my hands on a windows phone.
Also, it works on all modern desktop browsers, IE 10+, with IE 9 support coming soon.
The home page title I can flick around, and it reacts to velocity and direction, but if I try and drag it, it lets go before I get very far and goes back to its default state.
Similarly the pull-down menu on the home page - I can pull it down, but it goes at its own speed - I can't drag it or give it velocity.
On the demos page - I can't scroll the page, so can only get to chat heads. This one, like the home page title, I can flick around with velocity and direction, but can't keep hold of it. And the background image moves too.
Windows Phone 8.0.10328.78, Nokia Lumia 520 (480x800)
(PS. In iOS, personally I'd find it easier if the demos opened in the same page so the back button works.)
Quick question for anyone passing by: Do the latest versions of jQuery still have this issue? I know 2.x dropped legacy support, so it would be interesting to see how much efficiency with things like animations has increased.
Although, my hope is that the web will progress as a platform to the point where cordova/phonegap/app store/play store aren't needed. Domenic Denicola gave a great talk about exactly this topic at EmpireJS this year. And he explains it much better than I can.
EDIT: I was mistaken. I'm using an app to view HN and it uses the built-in browser view to view websites. That's the browser that's broken. Chrome on Android works great.
Android 4.4 uses the same rendering and javascript engine as Chrome for android, but older versions of Android's WebFrame use a different fork of webkit.
EDIT: Some debugging shows that "from" and "to" are both (0, 416). This is causing direction in Acceleration.onStart to be (0, 0), which causes acceleration to also be zero. However, velocity is not zero; it's some apparently random number. Also, the boundary bottom is set to Infinity, because it uses (to.y > from.y) instead of (to.y >= from.y), so it never enters a "bounce" state as it's impossible to go outside the boundary.
TL;DR: I think you need to add tests for when "to" and "from" are the same location.
Right now it's iOS 6+ and Android 4+. It works on windows tablet, but I haven't been able to get my hands on a windows phone. Also, it works on all modern desktop browsers, IE 10+, with IE 9 support coming soon.
I'll add a page in the docs for this soon.