HM-78 Добавил страницу логина (#39)

This commit is contained in:
mrPadre
2020-07-30 23:55:09 +03:00
committed by GitHub
parent cf045379d8
commit 281ec56288
4 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,43 @@
.Login__page {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
display: flex;
align-items: center;
justify-content: center;
}
.Login__page-container {
max-width: 700px;
margin: 10px;
display: flex;
flex-direction: column;
flex: 1;
}
.Login__title {
text-align: center;
}
.Login__input {
margin: 10px;
}
.Login__check {
margin: 0 10px;
}
.Login__submit {
align-self: center;
margin: 10px;
}
.Login__form {
display: flex;
flex-direction: column;
}
.Login__logo {
max-width: 100px;
margin: 20px auto;
}
.Login__logo-box {
display: flex;
align-items: center;
}

View File

@ -0,0 +1,38 @@
import Component from '../component/index';
import './LoginPage.css';
import {createElement} from '../../utils/elementUtils';
import Image from '../../img/logo.svg';
class LoginPage extends Component {
constructor () {
super('#login-page', document.body);
this.logoBox = this.mainNode.querySelector('.Login__logo-box');
this.form = this.mainNode.querySelector('.Login__form');
this.submitBtn = this.mainNode.querySelector('.Login__submit');
this.logoImg = createElement({
tagName: 'img',
parentNode: this.logoBox,
options: {
className: 'Login__logo',
},
args: {
src: Image,
alt: 'logo'
}
});
this.addEventListener(this.form, 'submit', (evt) => {
this.send(evt);
});
this.addEventListener(this.submitBtn, 'click', (evt) => {
this.send(evt);
});
}
send = (evt) => {
evt.preventDefault();
}
}
export default LoginPage;