Chris Bateman


Long story short: I made a simple JavaScript utility for adding momentum to anything — Impetus.js.

Long story: I used to play around with creating panoramas (you know, before smartphones made it easy to make bad ones), and I was wondering if you could display a spherical panorama using CSS 3D transforms. Turns out you can. I wasn’t the first to come up with it, but it was really fun to figure out. You can check it out here: Spherical.js.

I built it to work on touch devices – but the first time I tried it, it was clear that I’d need to add momentum to the touch interaction. Momentum is so ubiqitous in touch UIs, that anything without it feels really unnatural. I started coding momentum into the panorama code, and then realized that I was solving two separate problems, so I abstracted out the momentum code, and Impetus was born.

You give it an area to listen for touch or mouse events, and it gives you the x and y values plus some momentum. That’s it. It’s not for scrolling, it’s not for touch carousels — it’s just simple momentum. I have no idea if it’ll be useful to anyone, but if you have any feedback or suggestions, please let me know!

The code is on Github and it’s on Bower as “impetus.”

Tell me what you think: @batemanchris