diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-14 18:59:39 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-14 19:06:34 -0400 |
| commit | 685d2f5bd5b27f22b9ce01a99bc578585d955c33 (patch) | |
| tree | 8d5dbbae1d9bd4071f5c043ea589b7a1aae4dde6 /StoneIsland/www/js/lib/nav/IntroView.js | |
| parent | c7f78fee3e5c9a78dbd6c22910ca529a0ee34827 (diff) | |
nav and routing
Diffstat (limited to 'StoneIsland/www/js/lib/nav/IntroView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/nav/IntroView.js | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/StoneIsland/www/js/lib/nav/IntroView.js b/StoneIsland/www/js/lib/nav/IntroView.js index 6e04a39e..346c3aef 100644 --- a/StoneIsland/www/js/lib/nav/IntroView.js +++ b/StoneIsland/www/js/lib/nav/IntroView.js @@ -3,13 +3,28 @@ var IntroView = View.extend({ el: "#intro", events: { + "click .store": "store", + "click .hub": "hub", + "click .story": "story", + "click .archive": "archive", }, initialize: function(){ - this.logo = this.$("#logo").get(0) - window.addEventListener("deviceorientation", deviceorientation) + this.compass = this.$("#compass").get(0) + this.orient = this.deviceorientation.bind(this) }, + show: function(){ + this.$el.show() + window.addEventListener("deviceorientation", this.orient) + // get location.. + }, + + hide: function(){ + this.$el.hide() + window.removeEventListener("deviceorientation", this.orient) + }, + deviceorientation: function(e){ var heading if ('webkitCompassHeading' in e) { @@ -18,7 +33,12 @@ var IntroView = View.extend({ else { heading = e.alpha } - this.logo.css[transformProp] = "translateZ(0) rotate(" + heading + "deg)" + this.compass.css[transformProp] = "translateZ(0) 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") }, }) |
