diff options
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/lib/nav')
6 files changed, 196 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js b/StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js new file mode 100644 index 00000000..30c3190e --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/CurtainView.js @@ -0,0 +1,21 @@ +var CurtainView = View.extend({ + + el: "#curtain", + + events: { + "click": "click", + }, + + initialize: function(){ + }, + + click: function(){ + if (document.body.classList.contains("nav")) { + app.nav.hide() + } + else if (document.body.classList.contains("login")) { + app.login.hide() + } + }, + +})
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js new file mode 100644 index 00000000..15c6425f --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/FooterView.js @@ -0,0 +1,11 @@ +var FooterView = View.extend({ + + el: "#footer", + + events: { + }, + + initialize: function(){ + }, + +})
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js new file mode 100644 index 00000000..bbf18274 --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/HeaderView.js @@ -0,0 +1,26 @@ +var HeaderView = View.extend({ + + el: "#header", + + events: { + "click .burger": "nav", + "click .logo": "logo", + "click .cart": "cart", + }, + + initialize: function(){ + }, + + nav: function(){ + app.nav.show() + }, + + logo: function(){ + app.router.go("intro") + }, + + cart: function(){ + app.router.go("cart") + }, + +})
\ No newline at end of file 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") }, + +}) diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js b/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js new file mode 100644 index 00000000..0f30db3d --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/LoginView.js @@ -0,0 +1,19 @@ +var LoginView = View.extend({ + + el: "#login", + + events: { + }, + + initialize: function(){ + }, + + show: function(){ + document.body.classList.add("login") + }, + + hide: function(){ + document.body.classList.remove("login") + }, + +})
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/nav/NavView.js b/StoneIsland/platforms/ios/www/js/lib/nav/NavView.js new file mode 100644 index 00000000..c9eb2d4e --- /dev/null +++ b/StoneIsland/platforms/ios/www/js/lib/nav/NavView.js @@ -0,0 +1,75 @@ +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") + $("#curtain").show() + }, + + hide: function(){ + $("body").removeClass("nav") + $("#curtain").hide() + }, + + 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') + }, + + +}) |
