Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Testing
  • Loading branch information
Joel Salisbury committed Jan 21, 2016
1 parent 5058b8f commit 9c5448a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.html
Expand Up @@ -15,12 +15,13 @@
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<p id="warning"></p>

<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>

<h1 id="accelerationX"></h1>



<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script>
Expand Down
13 changes: 13 additions & 0 deletions 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);

}

0 comments on commit 9c5448a

Please sign in to comment.