iPhone 6s was cracked by the press too strong :-P (Force Touch / 3D Touch) (2015-10-05)

I made a joke sample for iPhone 6s (Plus) + Safari.
-> Force Touch (3D Touch) sample

Press strongly the screen and release.

iPhone 6s was cracked by the press too strong :-P (Force Touch / 3D Touch)

Sound and cracked image appears.

iPhone 6s was cracked by the press too strong :-P (Force Touch / 3D Touch)

This cracked display photo is by my son...

Samurai zlash! - TOSHIBA REGZA 37Z3500 crashed!
-> Samurai zlash! - TOSHIBA REGZA 37Z3500 crashed! (2011-09-15)

JavaScript: a sample of Touch.force


window.onload = function(){
  get("content").addEventListener("touchstart", handleEvent);
  get("content").addEventListener("touchmove", handleEvent);
};
 
function get(id){
  return document.getElementById(id);
}
 
function handleEvent(event) {
  try{
    var type  = event.type;
    var touch = event.touches[0];
    if(touch){
      var force = touch.force || 0;
      var x     = touch.clientX;
      var y     = touch.clientY;
      if(force >= 0.5){
        hogehoge();
      }
    }
  }catch(e){
    alert(e);
  }
}
tags: javascript iphone ios

Posted by NI-Lab. (@nilab)