From 164fc4407621b4bd6448dd7790d684635a023726 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 16 Sep 2015 15:07:05 -0400 Subject: build --- .../platforms/ios/www/js/lib/nav/IntroView.js | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js (limited to 'StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js') diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js b/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js new file mode 100644 index 00000000..93602eb5 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/IntroView.js @@ -0,0 +1,44 @@ +var IntroView = View.extend({ + + el: "#intro", + + events: { + "click .store": "store", + "click .hub": "hub", + "click .story": "story", + "click .archive": "archive", + }, + + initialize: function(){ + this.compass = this.$("#compass").get(0) + this.orient = this.deviceorientation.bind(this) + }, + + show: function(){ + document.body.className = "intro" + window.addEventListener("deviceorientation", this.orient) + this.orient({ alpha: 0 }) + // get location.. + }, + + hide: function(){ + window.removeEventListener("deviceorientation", this.orient) + }, + + deviceorientation: function(e){ + var heading + if ('webkitCompassHeading' in e) { + heading = e.webkitCompassHeading || 0 + } + else { + heading = e.alpha || 0 + } + this.compass.style[transformProp] = "translateZ(0) translateX(-50%) translateY(-50%) rotate(" + heading + "deg)" + }, + + store: function(){ app.router.go("store") }, + hub: function(){ app.router.go("hub") }, + story: function(){ app.router.go("story") }, + archive: function(){ app.router.go("archive") }, + +}) -- cgit v1.2.3-70-g09d2