diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-09 01:48:51 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-09 01:48:51 -0500 |
| commit | 9cb9177accbbf6e4397cc71bc06dff0ccd47f441 (patch) | |
| tree | 8f1c1ab7e78da7ecace35db86f14b38119d87e1d | |
| parent | dad5f3f0c3c13e8334a6a0ea522c5a2bfe8cd830 (diff) | |
login view
| -rw-r--r-- | StoneIsland/www/css/account.css | 4 | ||||
| -rw-r--r-- | StoneIsland/www/css/nav.css | 13 | ||||
| -rw-r--r-- | StoneIsland/www/css/products.css | 5 | ||||
| -rw-r--r-- | StoneIsland/www/index.html | 21 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/LoginView.js | 10 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/account/LogoutView.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/NavView.js | 8 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/SearchView.js | 6 | ||||
| -rw-r--r-- | StoneIsland/www/js/sdk/auth.js | 7 |
9 files changed, 47 insertions, 33 deletions
diff --git a/StoneIsland/www/css/account.css b/StoneIsland/www/css/account.css new file mode 100644 index 00000000..70f8d216 --- /dev/null +++ b/StoneIsland/www/css/account.css @@ -0,0 +1,4 @@ +.login #login { display: block } +#login { + display: none; +} diff --git a/StoneIsland/www/css/nav.css b/StoneIsland/www/css/nav.css index 89d62ca1..70e9cbc3 100644 --- a/StoneIsland/www/css/nav.css +++ b/StoneIsland/www/css/nav.css @@ -204,17 +204,6 @@ } -/* LOGIN / SIGNUP SCREEN */ - -#login { - display: none; - position: absolute; - top: 50%; left: 50%; - -webkit-transform: translateX(-50%) translateY(-50%); - background: #fff; -} - - /* SELECTOR */ #selector { @@ -226,7 +215,7 @@ /* CONTENT */ -#story, #hub, #archive, #collection, #product, #cart, #faq, #search { +#story, #hub, #archive, #collection, #product, #cart, #faq, #search, #login, #logout { position: absolute; top: 43px; height: -webkit-calc(100% - 43px); diff --git a/StoneIsland/www/css/products.css b/StoneIsland/www/css/products.css index b3dff2ba..cd0814d8 100644 --- a/StoneIsland/www/css/products.css +++ b/StoneIsland/www/css/products.css @@ -41,3 +41,8 @@ background-position: center center; background-repeat: no-repeat; } + +.search #search { display: block } +#search { + display: none; +} diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index a063f0c3..f358c0dd 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -21,6 +21,7 @@ <link rel="stylesheet" type="text/css" href="css/vendor/flickity.css"> <link rel="stylesheet" type="text/css" href="css/index.css"> <link rel="stylesheet" type="text/css" href="css/nav.css"> + <link rel="stylesheet" type="text/css" href="css/account.css"> <link rel="stylesheet" type="text/css" href="css/products.css"> <link rel="stylesheet" type="text/css" href="css/cart.css"> <link rel="stylesheet" type="text/css" href="css/blogs.css"> @@ -150,6 +151,15 @@ </div> </div> + <div id="search"> + <div class="scroll"> + <h1>SEARCH</h1> + <form> + <input type="text" class="q" placeholder="ENTER YOUR SEARCH"> + </form> + </div> + </div> + <div id="product"> <div class="scroll"> <div class="loader"></div> @@ -186,11 +196,18 @@ <div id="login"> <form> - <input type="email" name="email" placeholder="EMAIL" required> - <input type="password" name="password" placeholder="PASSWORD" required> + <input type="email" name="Email" placeholder="EMAIL" required> + <input type="password" name="Password" placeholder="PASSWORD" required> <span class="submit">SIGN IN</span> </form> </div> + + <div id="profile"> + </div> + <div id="shipping"> + </div> + <div id="payment"> + </div> <div id="cart"> <h1>YOUR CART / <span class="itemcount">2 ITEMS</h1> diff --git a/StoneIsland/www/js/lib/account/LoginView.js b/StoneIsland/www/js/lib/account/LoginView.js index 3b409b3d..31137c55 100644 --- a/StoneIsland/www/js/lib/account/LoginView.js +++ b/StoneIsland/www/js/lib/account/LoginView.js @@ -11,14 +11,10 @@ var LoginView = View.extend({ }, show: function(){ - this.$form.reset() - document.body.classList.add("login") + this.$form.get(0).reset() + document.body.className = "login" }, - - hide: function(){ - document.body.classList.remove("login") - }, - + submit: function(e){ e.preventDefault() }, diff --git a/StoneIsland/www/js/lib/account/LogoutView.js b/StoneIsland/www/js/lib/account/LogoutView.js index fffe661a..d5b70aff 100644 --- a/StoneIsland/www/js/lib/account/LogoutView.js +++ b/StoneIsland/www/js/lib/account/LogoutView.js @@ -6,11 +6,7 @@ var LogoutView = View.extend({ }, show: function(){ - document.body.classList.add("logout") - }, - - hide: function(){ - document.body.classList.remove("logout") + document.body.className = "logout" }, submit: function(e){ diff --git a/StoneIsland/www/js/lib/nav/NavView.js b/StoneIsland/www/js/lib/nav/NavView.js index 3949c3c5..9f82bf08 100644 --- a/StoneIsland/www/js/lib/nav/NavView.js +++ b/StoneIsland/www/js/lib/nav/NavView.js @@ -49,7 +49,12 @@ var NavView = View.extend({ login: function(){ this.hide() - app.router.go("login") + if (auth.logged_in()) { + this.$el.addClass("account") + } + else { + app.router.go("account/login") + } }, search: function(){ @@ -70,6 +75,5 @@ var NavView = View.extend({ tw: function(){ window.open("https://twitter.com/stoneisland", '_system') }, - }) diff --git a/StoneIsland/www/js/lib/nav/SearchView.js b/StoneIsland/www/js/lib/nav/SearchView.js index 8739f088..c9738773 100644 --- a/StoneIsland/www/js/lib/nav/SearchView.js +++ b/StoneIsland/www/js/lib/nav/SearchView.js @@ -6,11 +6,7 @@ var SearchView = View.extend({ }, show: function(){ - document.body.classList.add("search") - }, - - hide: function(){ - document.body.classList.remove("search") + document.body.className = "search" }, })
\ No newline at end of file diff --git a/StoneIsland/www/js/sdk/auth.js b/StoneIsland/www/js/sdk/auth.js index cea0054c..53ac310f 100644 --- a/StoneIsland/www/js/sdk/auth.js +++ b/StoneIsland/www/js/sdk/auth.js @@ -28,6 +28,13 @@ var auth = (function(){ auth.get_user = function(cb){ // fetch user data } + auth.log_out = function(){ + auth.user_id = -1 + auth.access_token = "" + } + auth.logged_in = function(){ + return (auth.user_id !== -1) + } return auth })() |
