summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/nav
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-09-14 18:59:39 -0400
committerJules Laplace <jules@okfoc.us>2015-09-14 19:06:34 -0400
commit685d2f5bd5b27f22b9ce01a99bc578585d955c33 (patch)
tree8d5dbbae1d9bd4071f5c043ea589b7a1aae4dde6 /StoneIsland/www/js/lib/nav
parentc7f78fee3e5c9a78dbd6c22910ca529a0ee34827 (diff)
nav and routing
Diffstat (limited to 'StoneIsland/www/js/lib/nav')
-rw-r--r--StoneIsland/www/js/lib/nav/IntroView.js26
-rw-r--r--StoneIsland/www/js/lib/nav/NavView.js62
2 files changed, 84 insertions, 4 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") },
})
diff --git a/StoneIsland/www/js/lib/nav/NavView.js b/StoneIsland/www/js/lib/nav/NavView.js
index 57eaf357..6e57ec32 100644
--- a/StoneIsland/www/js/lib/nav/NavView.js
+++ b/StoneIsland/www/js/lib/nav/NavView.js
@@ -3,9 +3,69 @@ var NavView = View.extend({
el: "#nav",
events: {
+ "click .store": "store",
+ "click .hub": "hub",
+ "click .story": "story",
+ "click .archive": "archive",
+ "click .login": "login",
+ "click .faq": "faq",
+ "click .search": "search",
+ "click .fb": "fb",
+ "click .insta": "insta",
+ "click .tw": "tw",
},
initialize: function(){
},
+
+ show: function(){
+ $("body").addClass("nav")
+ },
+
+ hide: function(){
+ $("body").removeClass("nav")
+ },
+
+ store: function(){
+ this.hide()
+ app.router.go("store")
+ },
+ hub: function(){
+ this.hide()
+ app.router.go("hub")
+ },
+ story: function(){
+ this.hide()
+ app.router.go("story")
+ },
+ archive: function(){
+ this.hide()
+ app.router.go("archive")
+ },
+
+ login: function(){
+ this.hide()
+ app.router.go("login")
+ },
+
+ search: function(){
+ this.hide()
+ app.router.go("search")
+ },
+ faq: function(){
+ this.hide()
+ app.router.go("faq")
+ },
+
+ fb: function(){
+ window.open("https://www.facebook.com/StoneIsland", '_system')
+ },
+ insta: function(){
+ window.open("https://instagram.com/stoneisland_official", '_system')
+ },
+ tw: function(){
+ window.open("https://twitter.com/stoneisland", '_system')
+ },
+
-}) \ No newline at end of file
+})