diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-15 16:54:38 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-15 16:56:28 -0400 |
| commit | d5855a5d5b7c16a2c262ad2b98aabe5e8dd161f0 (patch) | |
| tree | 6debdaea50594aa9a57707d2cb2e360b5f5aa6d8 /StoneIsland/www/js/lib | |
| parent | 007ef2401acf0a98d7412dba06e1acd5f3957a1b (diff) | |
begin writing navigation css
Diffstat (limited to 'StoneIsland/www/js/lib')
| -rw-r--r-- | StoneIsland/www/js/lib/_router.js | 20 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/ArchiveView.js | 4 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/HubView.js | 4 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/StoryView.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/CurtainView.js | 21 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/IntroView.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/LoginView.js | 8 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/NavView.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/products/CollectionView.js | 7 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/products/Selector.js | 3 |
10 files changed, 75 insertions, 6 deletions
diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 0d0c3bd1..6434e9bf 100644 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -1,6 +1,7 @@ var SiteRouter = Router.extend({ el: 'body', + routeByHash: true, routes: { '/': 'intro', @@ -11,32 +12,49 @@ var SiteRouter = Router.extend({ '/faq': 'faq', '/search': 'search', + + '/cart': 'cart', }, initialize: function(){ - this.route() }, go: function(url){ if (app.view && app.view.hide) { app.view.hide() } + window.location.href = "#/" + url this.parseRoute(url) + console.log(url) }, intro: function(){ + app.view = app.intro + app.intro.show() }, store: function(){ + app.view = app.store + app.collection.show() }, hub: function(){ + app.view = app.hub + app.hub.show() }, story: function(){ + app.view = app.story + app.story.show() }, archive: function(){ + app.view = app.archive + app.archive.show() + }, + + + cart: function(){ }, }) diff --git a/StoneIsland/www/js/lib/blogs/ArchiveView.js b/StoneIsland/www/js/lib/blogs/ArchiveView.js index 04b43a4b..742ee0f2 100644 --- a/StoneIsland/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/www/js/lib/blogs/ArchiveView.js @@ -10,6 +10,10 @@ var ArchiveView = View.extend({ this.$content = this.$(".content") }, + show: function(){ + document.body.className = "archive" + }, + populate: function(){ }, diff --git a/StoneIsland/www/js/lib/blogs/HubView.js b/StoneIsland/www/js/lib/blogs/HubView.js index 4958b320..430464b1 100644 --- a/StoneIsland/www/js/lib/blogs/HubView.js +++ b/StoneIsland/www/js/lib/blogs/HubView.js @@ -10,6 +10,10 @@ var HubView = View.extend({ this.$content = this.$(".content") }, + show: function(){ + document.body.className = "hub" + }, + populate: function(){ }, diff --git a/StoneIsland/www/js/lib/blogs/StoryView.js b/StoneIsland/www/js/lib/blogs/StoryView.js index 4c71e9ff..ed46af31 100644 --- a/StoneIsland/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/www/js/lib/blogs/StoryView.js @@ -9,7 +9,11 @@ var StoryView = View.extend({ initialize: function(){ this.$content = this.$(".content") }, - + + show: function(){ + document.body.className = "story" + }, + populate: function(){ }, diff --git a/StoneIsland/www/js/lib/nav/CurtainView.js b/StoneIsland/www/js/lib/nav/CurtainView.js new file mode 100644 index 00000000..30c3190e --- /dev/null +++ b/StoneIsland/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/www/js/lib/nav/IntroView.js b/StoneIsland/www/js/lib/nav/IntroView.js index 346c3aef..7b726f6a 100644 --- a/StoneIsland/www/js/lib/nav/IntroView.js +++ b/StoneIsland/www/js/lib/nav/IntroView.js @@ -15,13 +15,13 @@ var IntroView = View.extend({ }, show: function(){ - this.$el.show() + document.body.className = "intro" window.addEventListener("deviceorientation", this.orient) + this.orient({ alpha: 0 }) // get location.. }, hide: function(){ - this.$el.hide() window.removeEventListener("deviceorientation", this.orient) }, @@ -33,7 +33,7 @@ var IntroView = View.extend({ else { heading = e.alpha } - this.compass.css[transformProp] = "translateZ(0) rotate(" + heading + "deg)" + this.compass.style[transformProp] = "translateZ(0) transformX(-50%) transformY(-50%) rotate(" + heading + "deg)" }, store: function(){ app.router.go("store") }, diff --git a/StoneIsland/www/js/lib/nav/LoginView.js b/StoneIsland/www/js/lib/nav/LoginView.js index 670fb333..0f30db3d 100644 --- a/StoneIsland/www/js/lib/nav/LoginView.js +++ b/StoneIsland/www/js/lib/nav/LoginView.js @@ -7,5 +7,13 @@ var LoginView = View.extend({ 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/www/js/lib/nav/NavView.js b/StoneIsland/www/js/lib/nav/NavView.js index 42877d88..c9eb2d4e 100644 --- a/StoneIsland/www/js/lib/nav/NavView.js +++ b/StoneIsland/www/js/lib/nav/NavView.js @@ -22,10 +22,12 @@ var NavView = View.extend({ show: function(){ $("body").addClass("nav") + $("#curtain").show() }, hide: function(){ $("body").removeClass("nav") + $("#curtain").hide() }, store: function(){ diff --git a/StoneIsland/www/js/lib/products/CollectionView.js b/StoneIsland/www/js/lib/products/CollectionView.js index 65ed0230..137d0ec3 100644 --- a/StoneIsland/www/js/lib/products/CollectionView.js +++ b/StoneIsland/www/js/lib/products/CollectionView.js @@ -1,11 +1,16 @@ var CollectionView = View.extend({ el: "#collection", - + template: $("#collection .template").html(), + events: { }, initialize: function(){ + this.$content = this.$(".content") + }, + + populate: function(){ }, })
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/products/Selector.js b/StoneIsland/www/js/lib/products/Selector.js index c0d59deb..3d3d5ccc 100644 --- a/StoneIsland/www/js/lib/products/Selector.js +++ b/StoneIsland/www/js/lib/products/Selector.js @@ -7,5 +7,8 @@ var Selector = View.extend({ initialize: function(){ }, + + select: function(options, callback){ + }, })
\ No newline at end of file |
