diff --git a/index.html b/index.html index b22fb35..87dfde2 100644 --- a/index.html +++ b/index.html @@ -15,12 +15,13 @@ - + +

- -

Hello world! This is HTML5 Boilerplate.

+ +

+ + diff --git a/js/main.js b/js/main.js index e69de29..bfb4aa6 100644 --- a/js/main.js +++ b/js/main.js @@ -0,0 +1,13 @@ +if (window.DeviceMotionEvent) { + window.addEventListener('devicemotion', deviceMotionHandler, false); +} else { + document.getElementById("warning").innerHTML = "Not supported." +} + + +function deviceMotionHandler(eventData) { + // Grab the acceleration from the results + var acceleration = eventData.acceleration; + $("#accelerationX").html(acceleration.x); + +} \ No newline at end of file