diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-14 17:56:47 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-14 17:56:47 -0400 |
| commit | c7f78fee3e5c9a78dbd6c22910ca529a0ee34827 (patch) | |
| tree | d59a32bfac1406e9b90902173625600efd453d4e /StoneIsland/www/js/lib/nav | |
| parent | 6e5cc9505e8b577228bfbe87729174c105a747fd (diff) | |
device orientation
Diffstat (limited to 'StoneIsland/www/js/lib/nav')
| -rw-r--r-- | StoneIsland/www/js/lib/nav/IntroView.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/nav/IntroView.js b/StoneIsland/www/js/lib/nav/IntroView.js index 21e3c2b2..6e04a39e 100644 --- a/StoneIsland/www/js/lib/nav/IntroView.js +++ b/StoneIsland/www/js/lib/nav/IntroView.js @@ -6,6 +6,19 @@ var IntroView = View.extend({ }, initialize: function(){ + this.logo = this.$("#logo").get(0) + window.addEventListener("deviceorientation", deviceorientation) + }, + + deviceorientation: function(e){ + var heading + if ('webkitCompassHeading' in e) { + heading = e.webkitCompassHeading + } + else { + heading = e.alpha + } + this.logo.css[transformProp] = "translateZ(0) rotate(" + heading + "deg)" }, -})
\ No newline at end of file +}) |
