{"id":1263,"date":"2014-03-27T00:19:45","date_gmt":"2014-03-27T05:19:45","guid":{"rendered":"http:\/\/cbateman.com\/blog\/?p=1263"},"modified":"2014-03-29T11:48:30","modified_gmt":"2014-03-29T16:48:30","slug":"impetus-js","status":"publish","type":"post","link":"https:\/\/cbateman.com\/blog\/impetus-js\/","title":{"rendered":"Impetus.js"},"content":{"rendered":"<p>Long story short: I made a simple JavaScript utility for adding momentum to anything &mdash; <a href=\"http:\/\/chrisbateman.github.io\/impetus\/\">Impetus.js<\/a>.<\/p>\r\n\r\n<p>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&#8217;t the first to come up with it, but it was really fun to figure out. You can check it out here: <a href=\"http:\/\/chrisbateman.github.io\/spherical\/\">Spherical.js<\/a>.<\/p>\r\n\r\n<p>I built it to work on touch devices &#8211; but the first time I tried it, it was clear that I&#8217;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 <a href=\"http:\/\/chrisbateman.github.io\/impetus\/\">Impetus<\/a> was born.<\/p>\r\n\r\n<p>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&#8217;s it. It&#8217;s not for scrolling, it&#8217;s not for touch carousels &mdash; it&#8217;s just simple momentum. I have no idea if it&#8217;ll be useful to anyone, but if you have any feedback or suggestions, please let me know!<\/p>\r\n\r\n<p>The code is on <a href=\"https:\/\/github.com\/chrisbateman\/impetus\">Github<\/a> and it&#8217;s on Bower as &#8220;impetus.&#8221;<\/p>\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>Long story short: I made a simple JavaScript utility for adding momentum to anything &mdash; 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&#8217;t the first&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1263","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/1263"}],"collection":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/comments?post=1263"}],"version-history":[{"count":13,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/1263\/revisions"}],"predecessor-version":[{"id":1276,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/1263\/revisions\/1276"}],"wp:attachment":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/media?parent=1263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/categories?post=1263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/tags?post=1263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}