Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated login UI #343

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/assets/imgs/bk/bk1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/imgs/bk/bk2.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/imgs/bk/bk3.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/imgs/bk/bk4.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/imgs/reboot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 37 additions & 77 deletions src/pages/login/login.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<!--
Generated template for the LoginPage page.

See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-header *ngIf='false'>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
@@ -13,78 +7,44 @@
</ion-header>

<ion-content>
<ion-grid no-padding class="my-grid">
<ion-row>
<ion-col id="header" col-12>
<ion-spinner *ngIf='spinnerActive' icon='bubbles' id='spinner'></ion-spinner>
<ion-grid id='loginGrid' no-padding>

<!-- <ion-row>
<ion-col id="background" col-12>
<img src="../assets/imgs/reboot.png">
<h1 id="title">INTRANSITION</h1>
</ion-col>
</ion-row>

<form [formGroup]="loginCreds" (ngSubmit)="login()">

<ion-row justify-content-center>
<ion-col col-7 col-xl-6>
<h2 text-center>Transitioning from the military to civilian environment is more than just a job change.</h2>
<br>
<h2 id="lifechange" text-center>It's a life change.</h2>
</ion-col>
</ion-row>

<ion-row justify-content-center>
<ion-col col-7 class="email-col">
<ion-label class="email-label" style="font-size: 25px" stacked>EMAIL ADDRESS</ion-label>
<p *ngIf="!loginCreds.controls.email.valid && (loginCreds.controls.email.dirty || submitAttempt)" class="invalid-text">
Please enter a valid email
</p>
<ion-input formControlName="email" class="email-inputs" id="email" type="email"></ion-input>
</ion-col>
</ion-row>


<!-- <ion-row justify-content-center>
<ion-col col-10>
<ion-item no-lines *ngIf="!loginCreds.controls.email.valid && (loginCreds.controls.email.dirty || submitAttempt)">
<p class="invalid-text">Please enter a valid email</p>
</ion-item><br>
</ion-col>
</ion-row> -->

<ion-row justify-content-center>
<ion-col col-7>
<ion-label class="password-labels" style="font-size: 25px" stacked>PASSWORD</ion-label>
<ion-input formControlName="password" class="password-inputs" id="password" type="password"></ion-input>
</ion-col>
</ion-row>

<!-- <ion-row justify-content-center>
<ion-col col-10>
<ion-item no-lines *ngIf="!loginCreds.controls.password.valid && (loginCreds.controls.password.dirty || submitAttempt)">
<p text-center class="invalid-text">Password contains 6-30 letters, numbers, or special characters</p>
</ion-item><br>
</ion-col>
</ion-row> -->

<ion-row justify-content-center>
<ion-col class="button-col" col-5>
<button id="loginbutton" type="submit" ion-button block [disabled]="!loginCreds.valid">LOGIN</button>
</ion-col>
</ion-row>

<ion-row>
<ion-col col-1></ion-col>
<ion-col>
<h3 text-center>If you don't have an account yet, you can register now.</h3>
</ion-col>
<ion-col col-1></ion-col>
</ion-row>

</form>

<ion-row justify-content-center>
<ion-col class="button-col" col-5>
<button (click)="toRegisterPage()" id="signupbutton" ion-button block>SIGN UP</button>
</ion-col>
</ion-row>
</ion-row> -->

<div id="background"></div>

<div id='newInput'>
<form [formGroup]="loginCreds" (ngSubmit)="login()" id='login'>

<ion-item color='none'>
<ion-label floating>Username</ion-label>
<ion-input formControlName="email" type="email"></ion-input>

</ion-item>

<ion-item color='none' no-lines *ngIf="!loginCreds.controls.email.valid && (loginCreds.controls.email.dirty || submitAttempt)">
<p text-center class="invalid-text">Please enter a valid email</p>
</ion-item>

<ion-item color='none'>
<ion-label floating>Password</ion-label>
<ion-input formControlName="password" type="password"></ion-input>
</ion-item>

<ion-item color='none' no-lines *ngIf="!loginCreds.controls.password.valid && (loginCreds.controls.password.dirty || submitAttempt)">
<!-- <p text-center class="invalid-text">Password contains 6-30 letters, numbers, or special characters</p> -->
</ion-item>

<button id="loginbutton" type="submit" ion-button block [disabled]="!loginCreds.valid">LOGIN</button>
</form>
<button (click)="toRegisterPage()" id="signupbutton" ion-button block>SIGN UP</button>
</div>

</ion-grid>

181 changes: 111 additions & 70 deletions src/pages/login/login.scss
Original file line number Diff line number Diff line change
@@ -1,34 +1,100 @@
page-login {

* {
scroll-behavior: smooth;
}

#loginGrid {
background: linear-gradient(to bottom, rgba(125,185,232,0) 26%,rgba(125,185,232,0.5) 56%,rgba(0,108,122,0.65) 72%,rgba(0,107,122,0.66) 73%,rgba(5,90,130,1) 93%);
}

#newInput {
position: absolute;
background-color: #343434c4;
width: 90%;
top: 365px;
margin-left: 5%;
border-radius: 3px;
padding-bottom: 2%;
padding-right: 5%;
z-index: 5;
}

.scroll-content{
overflow: hidden;
overflow-y: none;
}
.item-ios {
background-color: none;
}

#tologin {
width: 100%;
top: 86%;
position: absolute;
font-size: 12vh;
text-align: center;
color: #2459f88a;
content: "\f289";
}

#spinner {
position: absolute;
width: 100px;
height: 100px;
top: 30%;
z-index: 1000;
stroke: #488aff;
fill: #488aff;

display: block;
margin-right: auto;
width: 100%;
}

#header {
#background {
display: flex;
padding: 65px;
justify-content: center;
align-items: center;
z-index: -1;
background-image: url('../assets/imgs/bk/bk1.jpg');
background-size: cover;
background-position: center top;
background-attachment: fixed;
// width: 100vh;
height: 100vh;
transition: 4s;

}

background-position: 0px -250px;
background-size: 100% 500%;
background-image: url('../assets/imgs/background.png');
#overlay {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.3);
z-index: 1;
}

#title {
letter-spacing: 3px;
font-weight: bold;
font-family: proxima-nova;
font-size: 70px;
color: white;
color: #e3e3e3;
text-shadow: 4px 4px 4px #000000;
}

#lifechange {
font-weight: bold;
}

.password-inputs {
position: relative;
border: 1px solid rgb(229, 230, 230);
background-color: rgb(248, 248, 248);
padding-left: 60px;
font-size: 25px
.labels {
color: rgb(96,96,96);
}

#email:before {
@@ -53,70 +119,42 @@ page-login {
top: 10px;
}

.inputs {
position: relative;
border: 1px solid rgb(229, 230, 230);
background-color: rgb(248, 248, 248);
padding-left: 60px;
font-size: 25px
}

.invalid-text {
font-size: 14px;
color: #ea6153;
}

#loginbutton {
background-color: rgb(130,180,64);
font-size: 25px;
font-size: 20px;
height: 2.1em;
margin-left: 3%;
margin-bottom: 3%;
margin-top: 5%;

display: block;
margin-right: auto;
width: 100%;
}

#signupbutton {
background-color: rgb(42,61,79);
font-size: 25px;
font-size: 20px;
height: 2.1em;
}

@media only screen and (min-width: 768px) {
// For desktop
.email-col {
display: flex;
flex-wrap: wrap;
}
.email-labels {
color: rgb(96,96,96);
}

.password-labels {
color: rgb(96,96,96);
}

.invalid-text {
flex-basis: 50%;
font-size: 20px;
color: #ea6153;
}

.email-inputs {
flex-basis: 100%;
// position: relative;
border: 1px solid rgb(229, 230, 230);
background-color: rgb(248, 248, 248);
padding-left: 60px;
font-size: 25px
}
}
margin-left: 3%;
margin-bottom: 3%;

@media only screen and (max-width: 768px) {
// For mobile\
.email-labels {
color: rgb(96,96,96);
}

.password-labels {
color: rgb(96,96,96);
}

.invalid-text {
font-size: 20px;
color: #ea6153;
}

.email-inputs {
position: relative;
border: 1px solid rgb(229, 230, 230);
background-color: rgb(248, 248, 248);
padding-left: 60px;
font-size: 25px
}
display: block;
margin-right: auto;
width: 100%;
}

@media screen and (orientation:portrait){
@@ -159,16 +197,19 @@ page-login {
}

.invalid-text {
font-size: 20px;
font-size: 12px;
color: #ea6153;
margin: auto;
// margin: auto;
width: 70%;
}

.email-labels, .password-labels {
.labels {
padding-left: 10%;
font-size: 25px;
}

}


}

}
36 changes: 29 additions & 7 deletions src/pages/login/login.ts
Original file line number Diff line number Diff line change
@@ -22,10 +22,11 @@ export class LoginPage {
getDummyChart: any
user: any
userId: any
bgInterval:any = ''

private loginCreds : FormGroup;
// loginResponse: any;
checkResponse: any;
spinnerActive:any = false;
data:any

constructor(
public navCtrl: NavController,
@@ -51,6 +52,7 @@ export class LoginPage {
*/

login() {
this.spinnerActive = true;
this._userService.login(this.loginCreds.value)
.subscribe(
(res) => {
@@ -79,12 +81,13 @@ export class LoginPage {
// this.loginResponse = res;
console.log(res);
this._userService.setCredentials(res);
alert("you're logged in!");
// alert("you're logged in!");
// this.navCtrl.setRoot(WizardPage);
//this.getChartData();
this.firstTimeUserCheck()
},
(err) => {
this.spinnerActive = false;
let toast = this.toastCtrl.create({
message: "Invalid credentials",
duration: 2500,
@@ -134,13 +137,32 @@ export class LoginPage {
this.logInCheck();
}

ionViewDidEnter() {
this.bkChange();
}


ionViewWillLeave() {
clearTimeout(this.bgInterval);
}

bkChange() {
this.bgInterval = setInterval(() => {
let random = Math.floor(Math.random() * 4) + 1
// console.log(random)
document.getElementById("background").style.backgroundImage = "url('../assets/imgs/bk/bk" + random + ".jpg')";

// document.getElementById("header").style.opacity = "1";
}, 20000)
}

firstTimeUserCheck() {
this._userService.getUser()
.subscribe(response => {
this.checkResponse = response;
console.log(this.checkResponse)
if (this.checkResponse.militaryBranch) {
this.navCtrl.setRoot(DashboardPage);
this.data = response;
console.log(this.data)
if (this.data.militaryBranch) {
this.navCtrl.setRoot(DashboardPage, {}, {animate: true, direction: "forward"});
} else {
this.navCtrl.setRoot(WizardPage);
}
3 changes: 2 additions & 1 deletion src/theme/variables.scss
Original file line number Diff line number Diff line change
@@ -58,7 +58,8 @@ $colors: (
secondary: #2e4256,
danger: #f53d3d,
light: #f4f4f4,
dark: #222
dark: #222,
none: #00000000
);

// $alert-min-width: (