Skip to content

Commit

Permalink
add register and reset password components
Browse files Browse the repository at this point in the history
  • Loading branch information
ashefor committed Sep 22, 2019
1 parent 290e76a commit 95244fa
Show file tree
Hide file tree
Showing 15 changed files with 463 additions and 85 deletions.
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const routes: Routes = [
path: 'posts', loadChildren: './components/post/posts.module#PostsModule'
},
{
path: 'users', loadChildren: './components/user/user.module#UserModule'
path: 'auth', loadChildren: './components/user/user.module#UserModule'
}
];

Expand Down
6 changes: 3 additions & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<li class=""
*ngIf="!isLoggedIn">
<a class=""
[routerLink]="['/users/login']" routerLinkActive="router-link-active" >Log In</a>
[routerLink]="['/auth/login']" routerLinkActive="router-link-active" >Log In</a>
</li>
<li class=""
*ngIf="isLoggedIn">
Expand All @@ -32,7 +32,7 @@
<div class="container-fluid">
<a class="navbar-brand" [routerLink]="['/posts']" routerLinkActive="router-link-active" >Navbar</a>
<!-- <a class="d-block d-md-none" href="#">Navbar</a> -->
<a *ngIf="!isLoggedIn" [routerLink]="['/users/login']" routerLinkActive="router-link-active" class="navbar-brand d-block d-md-none">Login</a>
<a *ngIf="!isLoggedIn" [routerLink]="['/auth/login']" routerLinkActive="router-link-active" class="navbar-brand d-block d-md-none">Login</a>
<button *ngIf="!isLoggedIn" class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down Expand Up @@ -71,7 +71,7 @@
</div>
<!-- <a role="button" class="btn btn-primary my-2 my-sm-0 d-none d-md-inline">Login</a> -->
<div class="mt-auto mb-auto" *ngIf="!isLoggedIn">
<a class="navbar-brand d-none d-md-inline" [routerLink]="['/users/login']" routerLinkActive="router-link-active">Login</a>
<a class="navbar-brand d-none d-md-inline" [routerLink]="['/auth/login']" routerLinkActive="router-link-active">Login</a>
</div>
<div class="d-none d-md-inline" *ngIf="isLoggedIn">
<a aria-label="Profile image with dropdown" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="profile-thumb menu-item-link align-items-center justify-content-center"><img src="../assets/user.png" alt="Your profile photo"></a>
Expand Down
80 changes: 78 additions & 2 deletions src/app/components/user/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</form>
</div> -->

<div class="">
<!-- <div class="">
<div class="loginform container">
<div class="row">
<div class="col-12">
Expand Down Expand Up @@ -52,4 +52,80 @@
</div>
</div>
</div>
</div>
</div> -->


<!-- <div class="main-w3layouts wrapper">
<div class="main-agileinfo">
<div class="agileits-top">
<form [formGroup]="loginForm" (ngSubmit)="login(loginForm.value)">
<input class="text email" type="email" name="email" formControlName="username"
placeholder="Enter email">
<div class="inputfield mb-3">
<input class="text" type="password" name="password" placeholder="Password"
[type]="hide ? 'password' : 'text'" formControlName="password">
<button mat-icon-button matSuffix (click)="hide = !hide" type="button">
<mat-icon>{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
</button>
</div>
<div class="wthree-text">
<label class="anim">
<input type="checkbox" class="checkbox mr-1" (change)="keepLoggedIn($event)"
formControlName="checked">
<span>Keep me logged in</span>
</label>
<div class="clear"> </div>
</div>
<button type="submit">SIGN IN</button>
</form>
<p>Don't have an account? <a [routerLink]="['/auth/register']" routerLinkActive="router-link-active"> Create
one now!</a></p>
</div>
</div>
</div> -->

<div id="logreg-forms">
<form class="form-signin" [formGroup]="loginForm" (ngSubmit)="login(loginForm.value)">
<h1 class="h3 mb-3 font-weight-normal" style="text-align: center"> Sign in</h1>
<div class="social-login">
<button class="btn facebook-btn social-btn" type="button"><span><i class="fab fa-facebook-f"></i> Sign in with Facebook</span> </button>
<button class="btn google-btn social-btn" type="button"><span><i class="fab fa-google-plus-g"></i> Sign in with Google+</span> </button>
</div>
<p style="text-align:center"> OR </p>
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" autofocus="" formControlName="username">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" formControlName="password">

<button class="btn btn-success btn-block" type="submit"><i class="fas fa-sign-in-alt"></i> Sign in</button>
<a href="#" id="forgot_pswd">Forgot password?</a>
<hr>
<!-- <p>Don't have an account!</p> -->
<button class="btn btn-primary btn-block" type="button" id="btn-signup"><i class="fas fa-user-plus"></i> Sign up New Account</button>
</form>

<!-- <form action="/reset/password/" class="form-reset">
<input type="email" id="resetEmail" class="form-control" placeholder="Email address" required="" autofocus="">
<button class="btn btn-primary btn-block" type="submit">Reset Password</button>
<a href="#" id="cancel_reset"><i class="fas fa-angle-left"></i> Back</a>
</form> -->

<!-- <form action="/signup/" class="form-signup">
<div class="social-login">
<button class="btn facebook-btn social-btn" type="button"><span><i class="fab fa-facebook-f"></i> Sign up with Facebook</span> </button>
</div>
<div class="social-login">
<button class="btn google-btn social-btn" type="button"><span><i class="fab fa-google-plus-g"></i> Sign up with Google+</span> </button>
</div>
<p style="text-align:center">OR</p>
<input type="text" id="user-name" class="form-control" placeholder="Full name" required="" autofocus="">
<input type="email" id="user-email" class="form-control" placeholder="Email address" required autofocus="">
<input type="password" id="user-pass" class="form-control" placeholder="Password" required autofocus="">
<input type="password" id="user-repeatpass" class="form-control" placeholder="Repeat Password" required autofocus="">
<button class="btn btn-primary btn-block" type="submit"><i class="fas fa-user-plus"></i> Sign Up</button>
<a href="#" id="cancel_signup"><i class="fas fa-angle-left"></i> Back</a>
</form> -->
<br>

</div>
133 changes: 101 additions & 32 deletions src/app/components/user/login/login.component.scss
Original file line number Diff line number Diff line change
@@ -1,40 +1,109 @@
.example-container {
display: flex;
flex-direction: column;

/* sign in FORM */
#logreg-forms{
width:412px;
margin:10vh auto;
background-color:#f3f3f3;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}
#logreg-forms form {
width: 100%;
max-width: 410px;
padding: 15px;
margin: auto;
}
#logreg-forms .form-control {
position: relative;
box-sizing: border-box;
height: auto;
padding: 10px;
font-size: 16px;
}
#logreg-forms .form-control:focus { z-index: 2; }
#logreg-forms .form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
#logreg-forms .form-signin input[type="password"] {
border-top-left-radius: 0;
border-top-right-radius: 0;
}

#logreg-forms .social-login{
width:390px;
margin:0 auto;
margin-bottom: 14px;
}
#logreg-forms .social-btn{
font-weight: 100;
color:white;
width:190px;
font-size: 0.9rem;
}

#logreg-forms a{
display: block;
padding-top:10px;
color:lightseagreen;
}

#logreg-form .lines{
width:200px;
border:1px solid red;
}


#logreg-forms button[type="submit"]{ margin-top:10px; }

#logreg-forms .facebook-btn{ background-color:#3C589C; }

#logreg-forms .google-btn{ background-color: #DF4B3B; }

#logreg-forms .form-reset, #logreg-forms .form-signup{ display: none; }

#logreg-forms .form-signup .social-btn{ width:210px; }

#logreg-forms .form-signup input { margin-bottom: 2px;}

.form-signup .social-login{
width:210px !important;
margin: 0 auto;
}

/* Mobile */

@media screen and (max-width:500px){
#logreg-forms{
width:300px;
}

.example-container > * {
width: 100%;
#logreg-forms .social-login{
width:200px;
margin:0 auto;
margin-bottom: 10px;
}

.example-right-align {
text-align: right;
#logreg-forms .social-btn{
font-size: 1.3rem;
font-weight: 100;
color:white;
width:200px;
height: 56px;

}

input.example-right-align::-webkit-outer-spin-button,
input.example-right-align::-webkit-inner-spin-button {
display: none;
#logreg-forms .social-btn:nth-child(1){
margin-bottom: 5px;
}

input.example-right-align {
-moz-appearance: textfield;
#logreg-forms .social-btn span{
display: none;
}
#logreg-forms .facebook-btn:after{
content:'Facebook';
}

.loginform{
max-width: 500px;
margin: auto;
// border: 1px solid;
// padding: 20px;

form{
// padding: 0 25px;

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
box-shadow: 0 0 0 30px white inset !important;
-webkit-box-shadow: 0 0 0 30px white inset !important;
}
}
#logreg-forms .google-btn:after{
content:'Google+';
}

}
1 change: 0 additions & 1 deletion src/app/components/user/logout/logout.component.html

This file was deleted.

Empty file.
25 changes: 0 additions & 25 deletions src/app/components/user/logout/logout.component.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/app/components/user/logout/logout.component.ts

This file was deleted.

29 changes: 29 additions & 0 deletions src/app/components/user/register/register.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<div id="logreg-forms">


<!-- <form action="/reset/password/" class="form-reset">
<input type="email" id="resetEmail" class="form-control" placeholder="Email address" required="" autofocus="">
<button class="btn btn-primary btn-block" type="submit">Reset Password</button>
<a href="#" id="cancel_reset"><i class="fas fa-angle-left"></i> Back</a>
</form> -->

<form action="/signup/" class="form-signup">
<div class="social-login">
<button class="btn facebook-btn social-btn" type="button"><span><i class="fab fa-facebook-f"></i> Sign up with Facebook</span> </button>
</div>
<div class="social-login">
<button class="btn google-btn social-btn" type="button"><span><i class="fab fa-google-plus-g"></i> Sign up with Google+</span> </button>
</div>

<p style="text-align:center">OR</p>

<input type="text" id="user-name" class="form-control" placeholder="Full name" required="" autofocus="">
<input type="email" id="user-email" class="form-control" placeholder="Email address" required autofocus="">
<input type="password" id="user-pass" class="form-control" placeholder="Password" required autofocus="">
<input type="password" id="user-repeatpass" class="form-control" placeholder="Repeat Password" required autofocus="">

<button class="btn btn-primary btn-block" type="submit"><i class="fas fa-user-plus"></i> Sign Up</button>
</form>
<br>

</div>
Loading

0 comments on commit 95244fa

Please sign in to comment.