Wednesday, September 17th, 2008
iPhone Web App: Spin the Bottle
Tomi Mickelsson has created a fun iPhone Web App called Spin the Bottle. You know, a Web app, not one that has to get into the Apple store.
You can check it out on the iPhone/Touch/emulator and you will see how Tomi uses the iPhone specific APIs, such as:
-
-
function startTouch() {
-
setTimeout(hideURLbar, 100);
-
-
document.body.ontouchstart = function(e) {
-
oldangle1 = 0; oldangle2 = 0; oldangle3 = 0;
-
//spinout();
-
cancelspin();
-
}
-
-
document.body.ontouchmove = function(e) {
-
// prevent window scrolling!
-
e.preventDefault();
-
-
if (timer_rot != 0)
-
return;
-
-
var touch = e.touches[0]; // finger 1
-
var dx = centerx - touch.pageX;
-
var dy = centery - touch.pageY;
-
var angle = Math.atan2(dy, dx);
-
-
oldangle3 = angle;
-
oldangle1 = oldangle2;
-
oldangle2 = oldangle3;
-
-
var val = "rotateZ(" + angle + "rad)";
-
bottle.style.webkitTransform = val;
-
shadow.style.webkitTransform = val;
-
rot = angle;
-
//cancelspin();
-
}
-
document.body.ontouchend = function(e){
-
if (timer_rot == 0) {
-
var val = ((oldangle2 - oldangle1) + (oldangle3 - oldangle2)) / 2;
-
val /= 3;
-
if (val == 0.0)
-
val = rand(0.3)+0.2;
-
else if (Math.abs(val) <0.3)
-
val *= 3;
-
-
//cancelspin();
-
startanim(val);
-
}
-
}
-
}
-
// remove our touch handlers
-
function stopTouch() {
-
document.body.ontouchstart = null;
-
document.body.ontouchmove = null;
-
document.body.ontouchend = null;
-
}
-













I’m using rss from feedburner to read Ajaxian and in feed, the second link is changed to: http://feeds.feedburner.com/www.idean.com/iphone/spin that point to a different website, http://feeds.feedburner.com/www Please fix the problem (or maybe is a bug from feedburner).
Thanks
It appears that the problem is in the article itself.
Maybe this site is interesting for iPhone WebApp Developers too:
http://www.big5apps.com