MDN's Detecting Device Orientation demo modified to paint



Hold the device parallel to the ground. Tilt along its x and y axes to see the ball move up/down and left/right respectively.