summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/nav/IntroView.js
blob: 6e04a39e05ecd5d2c1d9db351cdc1b5c5ab4399e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var IntroView = View.extend({
  
  el: "#intro",
  
  events: {
  },
  
  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)"
  },

})