Skip to content

Commit

Permalink
login style added
Browse files Browse the repository at this point in the history
Relates #11
  • Loading branch information
Nicos committed May 18, 2018
1 parent 7e13580 commit ef3842e
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 14 deletions.
83 changes: 83 additions & 0 deletions public/css/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,86 @@ body {
margin: 0;
background-color: #74dfb5;
font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; }

main {
height: 100vh;
}

.section__login {
max-width: 600px;
margin: auto;
padding: 5%;
text-align: center;
}

.login__title {
font-family: "Londrina Solid";
color:#F5F6FA;
font-size: 5em;
}

.login__title--desc {
font-size: 1.5em;
color: #2D3039;
font-weight: 700;
line-height: 1.7em;
letter-spacing: 2px;
}

.login__desc {
font-size: 1.2em;
color: #2D3039;
font-weight: 700;
text-align: left;
max-width: 75%;
margin: auto;
line-height: 1.5em;
}

.login__desc p {
margin: .5em;
}

.login__form--container {

}

.login__form {

}

.login__form label {
display: none;
}



.login__form input {
background: #F5F6FA;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
font-size: 1.2em;
padding: 4%;
width: 60%;
margin: 1%;
}

.login__form--button {
width: 65%;
background: #7BE6BB;
border: 3px solid #F5F6FA;
box-sizing: border-box;
font-size: 1.5em;
font-weight: 700;
color: #F5F6FA;
margin: 5%;
padding: 3%;
bottom: 4%;
}

.login__error {
color: #D8000C;
background-color: #FFBABA;
width: 70%;
margin: 0em auto;
padding: 2%;
}
4 changes: 2 additions & 2 deletions src/controllers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ exports.post = (req, res, next) => {
req.session.userName = username;
res.redirect('/');
} else {
res.render('login', { error: 'Password is incorrect' });
res.render('login', { layout: 'basic', error: 'Password is incorrect' });
}
})
.catch(e => next(e));
} else {
res.render('login', { error: `User "${inputUser}" does not exist` });
res.render('login', { layout: 'basic', error: `User "${inputUser}" does not exist` });
}
})
.catch(e => next(e));
Expand Down
27 changes: 15 additions & 12 deletions src/views/login.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<section>
<h1>Welcome to Well-Bean</h1>
<article>
<h3>Login Here</h3>
<form action="/login" method="POST">
<section class="section__login">
<h1 class="login__title">WELL-BEAN</h1>
<h3 class="login__title--desc">Your journey starts today</h3>
<div class="login__desc">
<p>Anonymous, feel confident expressing yourself to others. </p>
<p>Join a positive community determined to your <span style="color:white;font-size:90%"> WELL-BEAN </span> </p>
</div>
<article class="login__form--container">
<form class="login__form" action="/login" method="POST">
<fieldset>
<legend>Well-Bean!</legend>
<label for="user">Username/Email</label>
<input type="text" name="inputUser" id="user" placeholder="enter your username or email">
<input type="text" name="inputUser" id="user" placeholder="Username or Email">
<label for="password">Password</label>
<input type="password" name="inputPassword" id="password" placeholder="enter a password">
<input type="submit" value="Login">
<input type="password" name="inputPassword" id="password" placeholder="Your Password">
</fieldset>
{{#if error}}
<span>{{error}}</span>
{{/if}}
{{#if error}}
<div class="login__error">{{error}}</div>
{{/if}}
<button class="login__form--button">Login</button>
</form>
</article>
</section>

0 comments on commit ef3842e

Please sign in to comment.