2018-11-27 10:51:33 +00:00
|
|
|
// Copyright (C) 2018 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2018-11-05 15:26:18 +00:00
|
|
|
<template>
|
2018-11-26 15:57:11 +00:00
|
|
|
<div class="login-container">
|
2018-11-28 16:20:23 +00:00
|
|
|
<div class="login-container__wrapper">
|
|
|
|
<img class="login-container__logo" src="../../static/images/login/Logo.svg" alt="logo">
|
|
|
|
<div class="login-area">
|
|
|
|
<div class="login-area__title-container">
|
|
|
|
<h1>Welcome to Storj</h1>
|
|
|
|
</div>
|
|
|
|
<HeaderlessInput
|
|
|
|
class="login-area__email-input"
|
|
|
|
placeholder="Email"
|
|
|
|
@setData="setEmail"
|
|
|
|
height="46px"
|
|
|
|
width="100%">
|
|
|
|
</HeaderlessInput>
|
|
|
|
<HeaderlessInput
|
|
|
|
class="login-area__password-input"
|
|
|
|
placeholder="Password"
|
|
|
|
@setData="setPassword"
|
|
|
|
width="100%"
|
|
|
|
height="46px"
|
|
|
|
isPassword>
|
|
|
|
</HeaderlessInput>
|
|
|
|
<Button class="login-area__login-button" label="Login" width="100%" height="48px" :onPress="onLogin"/>
|
|
|
|
<!-- start of navigation area -->
|
|
|
|
<div class="login-area__navigation-area">
|
|
|
|
<router-link to="/register" class="login-area__navigation-area__nav-link bold" exact><h3>Create
|
|
|
|
account</h3></router-link>
|
|
|
|
<router-link to="" class="login-area__navigation-area__nav-link" exact><h3><strong>Forgot
|
|
|
|
password</strong></h3></router-link>
|
|
|
|
</div>
|
|
|
|
<!-- end of navigation area -->
|
2018-11-26 15:57:11 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-11-05 15:26:18 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2018-12-18 14:43:23 +00:00
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
2018-11-26 15:57:11 +00:00
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
import HeaderlessInput from '@/components/common/HeaderlessInput.vue';
|
|
|
|
import Button from '@/components/common/Button.vue';
|
|
|
|
import { setToken } from '@/utils/tokenManager';
|
|
|
|
import ROUTES from '../utils/constants/routerConstants';
|
|
|
|
import { getTokenRequest } from '@/api/users';
|
2018-11-26 15:57:11 +00:00
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
@Component({
|
|
|
|
data: function () {
|
2018-11-26 15:57:11 +00:00
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
return {
|
|
|
|
email: '',
|
|
|
|
password: '',
|
|
|
|
token: ''
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
setEmail: function (value: string) {
|
|
|
|
this.$data.email = value;
|
2018-11-26 15:57:11 +00:00
|
|
|
},
|
2018-12-18 14:43:23 +00:00
|
|
|
setPassword: function (value: string) {
|
|
|
|
this.$data.password = value;
|
2018-11-26 15:57:11 +00:00
|
|
|
},
|
2018-12-18 14:43:23 +00:00
|
|
|
onLogin: async function () {
|
2018-12-20 16:18:08 +00:00
|
|
|
let loginData = await getTokenRequest(this.$data.email, this.$data.password);
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-12-20 16:18:08 +00:00
|
|
|
if (!loginData) {
|
|
|
|
// TODO: show popup here
|
|
|
|
return;
|
2018-12-18 14:43:23 +00:00
|
|
|
}
|
2018-12-20 16:18:08 +00:00
|
|
|
|
|
|
|
setToken(loginData.data.token.token);
|
|
|
|
this.$router.push(ROUTES.DASHBOARD.path);
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
},
|
|
|
|
components: {
|
|
|
|
HeaderlessInput,
|
|
|
|
Button
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
export default class Login extends Vue {
|
|
|
|
}
|
2018-11-05 15:26:18 +00:00
|
|
|
</script>
|
2018-11-14 14:57:21 +00:00
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2018-11-26 15:57:11 +00:00
|
|
|
.login-container {
|
|
|
|
position: fixed;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
left: 0;
|
|
|
|
top: 0;
|
|
|
|
background: rgba(51, 51, 51, 0.7);
|
|
|
|
z-index: 10;
|
2018-11-28 16:20:23 +00:00
|
|
|
background-image: url(../../static/images/login/1920.svg);
|
2018-11-26 15:57:11 +00:00
|
|
|
background-repeat: no-repeat;
|
2018-11-28 16:20:23 +00:00
|
|
|
background-size: contain;
|
2018-11-26 15:57:11 +00:00
|
|
|
display: flex;
|
|
|
|
justify-content: flex-start;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: flex-start;
|
|
|
|
padding: 60px 0px 190px 104px;
|
|
|
|
|
|
|
|
&__logo {
|
2018-12-18 14:43:23 +00:00
|
|
|
width: 139px;
|
|
|
|
height: 62px;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.login-area {
|
|
|
|
background-color: #fff;
|
|
|
|
margin-top: 50px;
|
2018-11-28 16:20:23 +00:00
|
|
|
max-width: 500px;
|
2018-11-26 15:57:11 +00:00
|
|
|
width: 100%;
|
|
|
|
padding: 120px;
|
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: flex-start;
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&__title-container {
|
2018-12-18 14:43:23 +00:00
|
|
|
height: 48px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: flex-start;
|
|
|
|
align-items: flex-start;
|
|
|
|
margin-bottom: 32px;
|
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
h1 {
|
|
|
|
font-family: 'montserrat_bold';
|
|
|
|
font-size: 32px;
|
|
|
|
color: #384B65;
|
|
|
|
line-height: 39px;
|
|
|
|
margin-block-start: 0;
|
|
|
|
margin-block-end: 0;
|
|
|
|
}
|
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&__password-input {
|
2018-12-18 14:43:23 +00:00
|
|
|
margin-top: 22px;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&__login-button {
|
2018-12-18 14:43:23 +00:00
|
|
|
margin-top: 22px;
|
|
|
|
align-self: center;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&__login-button.container {
|
2018-12-18 14:43:23 +00:00
|
|
|
display: block;
|
|
|
|
text-align: center;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&__navigation-area {
|
2018-12-18 14:43:23 +00:00
|
|
|
margin-top: 24px;
|
|
|
|
width: 100%;
|
|
|
|
height: 48px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&__nav-link {
|
2018-12-18 14:43:23 +00:00
|
|
|
font-family: 'montserrat_regular';
|
|
|
|
font-size: 14px;
|
|
|
|
line-height: 20px;
|
|
|
|
color: #2683FF;
|
|
|
|
height: 48px;
|
|
|
|
text-align: center;
|
|
|
|
text-justify: center;
|
|
|
|
padding-left: 15px;
|
|
|
|
padding-right: 15px;
|
|
|
|
min-width: 140px;
|
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
&:hover {
|
2018-12-18 14:43:23 +00:00
|
|
|
text-decoration: underline;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
.bold {
|
|
|
|
font-family: 'montserrat_medium';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-28 16:20:23 +00:00
|
|
|
@media screen and (max-width: 1440px) {
|
|
|
|
.login-container {
|
|
|
|
background-size: auto;
|
|
|
|
background-image: url(../../static/images/login/Background.svg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 1280px) {
|
|
|
|
.login-container {
|
|
|
|
background-image: url(../../static/images/login/1280.svg);
|
|
|
|
background-size: auto;
|
|
|
|
}
|
|
|
|
.login-area {
|
|
|
|
padding: 86px;
|
|
|
|
max-width: 444px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 1024px) {
|
|
|
|
.login-container {
|
|
|
|
background-image: url(../../static/images/login/1024.svg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
@media screen and (max-width: 800px) {
|
|
|
|
.login-container {
|
|
|
|
padding: 0;
|
2018-11-28 16:20:23 +00:00
|
|
|
justify-content: flex-start;
|
|
|
|
display: block;
|
|
|
|
padding: 77px 50px 0 50px;
|
|
|
|
background-image: url(../../static/images/login/800.svg);
|
|
|
|
background-position-y: 0px;
|
|
|
|
width: auto;
|
|
|
|
height: 1450px;
|
|
|
|
position: relative;
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-28 16:20:23 +00:00
|
|
|
&__wrapper {
|
2018-12-18 14:43:23 +00:00
|
|
|
margin: 0 auto;
|
|
|
|
max-width: 600px;
|
2018-11-28 16:20:23 +00:00
|
|
|
}
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
.login-area {
|
2018-11-28 16:20:23 +00:00
|
|
|
max-width: auto;
|
|
|
|
width: auto;
|
|
|
|
margin: 0 auto;
|
|
|
|
margin-top: 80px;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
}
|
2018-11-14 14:57:21 +00:00
|
|
|
</style>
|