Login css fix
parent
60917acd2a
commit
0f47ebeb21
|
@ -7,6 +7,13 @@ mat-card {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.elements-card{
|
||||||
|
margin: 10px;
|
||||||
|
width: 800px;
|
||||||
|
background-color: #fafafa;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.groups-button-row {
|
.groups-button-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
@ -39,9 +46,3 @@ button {
|
||||||
color: #212121;
|
color: #212121;
|
||||||
}
|
}
|
||||||
|
|
||||||
.elements-card{
|
|
||||||
margin: 10px;
|
|
||||||
width: 800px;
|
|
||||||
background-color: #fafafa;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,16 +1,17 @@
|
||||||
.login {
|
.login {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: rgb(255, 255, 255);
|
background-color: #fff;
|
||||||
border: 1px solid grey;
|
border: 1px solid rgba(128, 128, 128, 0.801);
|
||||||
padding: 40px 30px 30px 30px;
|
padding: 40px 30px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: 400px;
|
width: 300px;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
transition: transform 300ms, box-shadow 300ms;
|
transition: transform 300ms, box-shadow 300ms;
|
||||||
box-shadow: 5px 10px 10px rgba(2, 128, 144, 0.2);
|
box-shadow: 5px 10px 10px rgba(2, 128, 144, 0.2);
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login::before, .login::after {
|
.login::before, .login::after {
|
||||||
|
@ -18,13 +19,17 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 600px;
|
width: 600px;
|
||||||
height: 600px;
|
height: 600px;
|
||||||
border-top-left-radius: 40%;
|
border-radius: 40% 45% 35% 40%;
|
||||||
border-top-right-radius: 45%;
|
|
||||||
border-bottom-left-radius: 35%;
|
|
||||||
border-bottom-right-radius: 40%;
|
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login-logo {
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.login input {
|
.login input {
|
||||||
font-family: "Asap", sans-serif;
|
font-family: "Asap", sans-serif;
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -32,8 +37,9 @@
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
background: rgba(230, 230, 230);
|
background: rgba(230, 230, 230);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px 10px;
|
padding: 10px;
|
||||||
margin: 15px -10px;
|
margin: 15px -10px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login button {
|
.login button {
|
||||||
|
@ -48,7 +54,7 @@
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-left: -5px;
|
margin-left: -5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: #0084ff;
|
background-color: #3f51b5;
|
||||||
transition: background-color 300ms;
|
transition: background-color 300ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,3 +70,17 @@
|
||||||
color: red;
|
color: red;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@keyframes rotate360 {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.rotating {
|
||||||
|
animation: rotate360 0.6s cubic-bezier(.42,0,1,1) infinite;
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
<div>
|
<div>
|
||||||
<form class="login" (ngSubmit)="onLogin()" #loginForm="ngForm">
|
<form class="login" (ngSubmit)="onLogin()" #loginForm="ngForm">
|
||||||
|
<img src="assets/images/logo.png" alt="Opengnsys"
|
||||||
|
class="login-logo" [class.rotating]="isLoading">
|
||||||
<h2>Opengnsys</h2>
|
<h2>Opengnsys</h2>
|
||||||
<input [(ngModel)]="loginObj.username" type="text" id="username" name="username" placeholder="usuario" required #usernameInput="ngModel" [ngClass]="{'invalid': !usernameInput.valid && usernameInput.touched}">
|
<input [(ngModel)]="loginObj.username" type="text" id="username" name="username" placeholder="usuario" required #usernameInput="ngModel" [ngClass]="{'invalid': !usernameInput.valid && usernameInput.touched}">
|
||||||
<input [(ngModel)]="loginObj.password" type="password" id="password" name="password" placeholder="contraseña" required #passwordInput="ngModel" [ngClass]="{'invalid': !passwordInput.valid && passwordInput.touched}">
|
<input [(ngModel)]="loginObj.password" type="password" id="password" name="password" placeholder="contraseña" required #passwordInput="ngModel" [ngClass]="{'invalid': !passwordInput.valid && passwordInput.touched}">
|
||||||
|
|
|
@ -13,10 +13,14 @@ export class LoginComponent {
|
||||||
"password": ""
|
"password": ""
|
||||||
};
|
};
|
||||||
errorMessage: string = '';
|
errorMessage: string = '';
|
||||||
|
isLoading: boolean = false;
|
||||||
|
|
||||||
constructor(private http: HttpClient, private router: Router) { }
|
constructor(private http: HttpClient, private router: Router) { }
|
||||||
|
|
||||||
onLogin() {
|
onLogin() {
|
||||||
|
this.errorMessage = '';
|
||||||
|
this.isLoading = true;
|
||||||
|
|
||||||
if (!this.loginObj.username || !this.loginObj.password) {
|
if (!this.loginObj.username || !this.loginObj.password) {
|
||||||
if (!this.loginObj.username) {
|
if (!this.loginObj.username) {
|
||||||
document.getElementById('username')?.classList.add('invalid');
|
document.getElementById('username')?.classList.add('invalid');
|
||||||
|
@ -29,6 +33,8 @@ export class LoginComponent {
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('password')?.classList.remove('invalid');
|
document.getElementById('password')?.classList.remove('invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.isLoading = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,8 +46,10 @@ export class LoginComponent {
|
||||||
localStorage.setItem('username', this.loginObj.username);
|
localStorage.setItem('username', this.loginObj.username);
|
||||||
this.router.navigateByUrl('/dashboard');
|
this.router.navigateByUrl('/dashboard');
|
||||||
}
|
}
|
||||||
|
this.isLoading = false;
|
||||||
},
|
},
|
||||||
error: (err) => {
|
error: (err) => {
|
||||||
|
this.isLoading = false;
|
||||||
if (err.status === 401) {
|
if (err.status === 401) {
|
||||||
this.errorMessage = 'Usuario o contraseña incorrectos';
|
this.errorMessage = 'Usuario o contraseña incorrectos';
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue