2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-11-27 10:51:33 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2018-11-05 15:26:18 +00:00
|
|
|
<template>
|
2019-01-25 13:09:46 +00:00
|
|
|
<div class="login-container" v-on:keyup.enter="onLogin">
|
2019-03-20 16:16:30 +00:00
|
|
|
<div v-bind:class="loadingClassName">
|
2019-03-26 16:56:38 +00:00
|
|
|
<img class="loading-overlay__logo" src="../../static/images/Logo.svg" alt="loading-logo">
|
2019-03-20 16:16:30 +00:00
|
|
|
</div>
|
|
|
|
<img class="planet" src="../../static/images/Mars.png" alt="" >
|
2018-11-28 16:20:23 +00:00
|
|
|
<div class="login-container__wrapper">
|
2019-03-20 16:16:30 +00:00
|
|
|
<div class="login-container__header">
|
2019-03-26 16:56:38 +00:00
|
|
|
<img class="login-container__logo" src="../../static/images/Logo.svg" alt="logo" v-on:click="onLogoClick">
|
2019-03-20 16:16:30 +00:00
|
|
|
<div class="login-container__register-button" v-on:click.prevent="onSignUpClick">
|
|
|
|
<p>Create Account</p>
|
2018-11-28 16:20:23 +00:00
|
|
|
</div>
|
2019-03-20 16:16:30 +00:00
|
|
|
</div>
|
|
|
|
<div class="login-area-wrapper">
|
|
|
|
<div class="login-area">
|
|
|
|
<div class="login-area__title-container">
|
|
|
|
<h1>Login to Storj</h1>
|
|
|
|
<p>Satellite:<b>Mars</b></p>
|
|
|
|
</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>
|
|
|
|
<div class="login-area__submit-area">
|
|
|
|
<router-link to="" class="login-area__navigation-area__nav-link" exact>
|
|
|
|
<h3><strong>Forgot password?</strong></h3>
|
|
|
|
</router-link>
|
|
|
|
<div class="login-area__submit-area__login-button" v-on:click.prevent="onLogin">
|
|
|
|
<p>Login</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="login-area__info-area">
|
|
|
|
<p class="login-area__info-area__signature">Storj Labs Inc 2019.</p>
|
|
|
|
<a class="login-area__info-area__terms">Terms & Conditions</a>
|
|
|
|
<a class="login-area__info-area__help">Help</a>
|
|
|
|
</div>
|
2018-11-28 16:20:23 +00:00
|
|
|
</div>
|
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';
|
|
|
|
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';
|
2019-03-20 16:16:30 +00:00
|
|
|
import { NOTIFICATION_ACTIONS } from '@/utils/constants/actionNames';
|
2018-12-18 14:43:23 +00:00
|
|
|
import { getTokenRequest } from '@/api/users';
|
2019-03-20 16:16:30 +00:00
|
|
|
import { LOADING_CLASSES } from '@/utils/constants/classConstants';
|
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: '',
|
2019-03-20 16:16:30 +00:00
|
|
|
loadingClassName: LOADING_CLASSES.LOADING_OVERLAY,
|
2018-12-18 14:43:23 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
2019-01-14 15:39:21 +00:00
|
|
|
onLogoClick: function (): void {
|
|
|
|
location.reload();
|
|
|
|
},
|
2019-03-20 16:16:30 +00:00
|
|
|
setEmail: function (value: string): void {
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.email = value;
|
2018-11-26 15:57:11 +00:00
|
|
|
},
|
2019-03-20 16:16:30 +00:00
|
|
|
setPassword: function (value: string): void {
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.password = value;
|
2018-11-26 15:57:11 +00:00
|
|
|
},
|
2019-03-20 16:16:30 +00:00
|
|
|
activateLoadingOverlay: function(): void {
|
|
|
|
this.$data.loadingClassName = LOADING_CLASSES.LOADING_OVERLAY_ACTIVE;
|
|
|
|
setTimeout(() => {
|
|
|
|
this.$data.loadingClassName = LOADING_CLASSES.LOADING_OVERLAY;
|
|
|
|
}, 2000);
|
|
|
|
},
|
|
|
|
onLogin: async function (): Promise<any> {
|
|
|
|
if (!this.$data.email || !this.$data.password) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
(this as any).activateLoadingOverlay();
|
|
|
|
|
2018-12-24 12:52:52 +00:00
|
|
|
let loginResponse = await getTokenRequest(this.$data.email, this.$data.password);
|
|
|
|
if (!loginResponse.isSuccess) {
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, loginResponse.errorMessage);
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-12-20 16:18:08 +00:00
|
|
|
return;
|
2018-12-18 14:43:23 +00:00
|
|
|
}
|
2018-12-20 16:18:08 +00:00
|
|
|
|
2018-12-24 12:52:52 +00:00
|
|
|
setToken(loginResponse.data);
|
2018-12-20 16:18:08 +00:00
|
|
|
this.$router.push(ROUTES.DASHBOARD.path);
|
2019-03-20 16:16:30 +00:00
|
|
|
},
|
|
|
|
onSignUpClick: function (): void {
|
|
|
|
this.$router.push(ROUTES.REGISTER.path);
|
|
|
|
},
|
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;
|
|
|
|
z-index: 10;
|
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;
|
2019-03-20 16:16:30 +00:00
|
|
|
padding: 60px 0px 0px 104px;
|
|
|
|
background-image: url("../../static/images/Background.png");
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: auto;
|
|
|
|
|
|
|
|
&__wrapper {
|
|
|
|
min-width: 50%;
|
|
|
|
height: 86vh;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__header {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-direction: row;
|
|
|
|
width: 100%;
|
|
|
|
}
|
2018-11-26 15:57:11 +00:00
|
|
|
|
|
|
|
&__logo {
|
2019-03-20 16:16:30 +00:00
|
|
|
cursor: pointer;
|
2018-12-18 14:43:23 +00:00
|
|
|
width: 139px;
|
|
|
|
height: 62px;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2019-03-20 16:16:30 +00:00
|
|
|
|
|
|
|
&__register-button {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background-color: transparent;
|
|
|
|
border-radius: 6px;
|
|
|
|
border: 1px solid white;
|
|
|
|
cursor: pointer;
|
|
|
|
width: 160px;
|
|
|
|
height: 48px;
|
|
|
|
|
|
|
|
p {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2019-03-20 16:16:30 +00:00
|
|
|
font-size: 14px;
|
|
|
|
line-height: 19px;
|
|
|
|
margin-block-start: 0;
|
|
|
|
margin-block-end: 0;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: white;
|
|
|
|
|
|
|
|
p {
|
|
|
|
color: #2683FF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
|
2019-03-20 16:16:30 +00:00
|
|
|
.planet {
|
|
|
|
position: absolute;
|
|
|
|
top: -161px;
|
|
|
|
right: -257px;
|
|
|
|
z-index: -100;
|
|
|
|
}
|
|
|
|
|
|
|
|
.login-area-wrapper {
|
2018-11-26 15:57:11 +00:00
|
|
|
width: 100%;
|
2019-03-20 16:16:30 +00:00
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-end;
|
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
|
|
|
|
.login-area {
|
|
|
|
background-color: transparent;
|
|
|
|
width: 620px;
|
2018-11-26 15:57:11 +00:00
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: flex-start;
|
2019-03-20 16:16:30 +00:00
|
|
|
padding-bottom: 50px;
|
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;
|
2019-03-20 16:16:30 +00:00
|
|
|
justify-content: space-between;
|
|
|
|
align-items: flex-end;
|
|
|
|
flex-direction: row;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
width: 100%;
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
h1 {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2019-03-20 16:16:30 +00:00
|
|
|
font-size: 22px;
|
|
|
|
color: white;
|
|
|
|
line-height: 27px;
|
|
|
|
margin-block-start: 0;
|
|
|
|
margin-block-end: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
p {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_regular';
|
2019-03-20 16:16:30 +00:00
|
|
|
font-size: 16px;
|
|
|
|
color: white;
|
|
|
|
line-height: 21px;
|
2018-11-26 15:57:11 +00:00
|
|
|
margin-block-start: 0;
|
|
|
|
margin-block-end: 0;
|
2019-03-20 16:16:30 +00:00
|
|
|
|
|
|
|
b {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2019-03-20 16:16:30 +00:00
|
|
|
margin-left: 7px;
|
|
|
|
}
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
2019-03-20 16:16:30 +00:00
|
|
|
&__submit-area {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
2018-12-18 14:43:23 +00:00
|
|
|
margin-top: 22px;
|
2019-03-20 16:16:30 +00:00
|
|
|
|
|
|
|
&__login-button {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
background-color: #2683FF;
|
|
|
|
border-radius: 6px;
|
|
|
|
cursor: pointer;
|
|
|
|
width: 160px;
|
|
|
|
height: 48px;
|
|
|
|
box-shadow: 0px 16px 24px #3A54DF;
|
|
|
|
|
|
|
|
p {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2019-03-20 16:16:30 +00:00
|
|
|
font-size: 14px;
|
|
|
|
line-height: 19px;
|
|
|
|
margin-block-start: 0;
|
|
|
|
margin-block-end: 0;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__info-area {
|
|
|
|
width: 100%;
|
|
|
|
height: 42px;
|
|
|
|
margin-top: 300px;
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-end;
|
|
|
|
justify-content: flex-start;
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
|
|
p {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_regular';
|
2019-03-20 16:16:30 +00:00
|
|
|
font-size: 12px;
|
|
|
|
line-height: 18px;
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
|
|
|
color: white;
|
|
|
|
margin-block-start: 0;
|
|
|
|
margin-block-end: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_regular';
|
2019-03-20 16:16:30 +00:00
|
|
|
font-size: 15px;
|
|
|
|
line-height: 22px;
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__signature {
|
|
|
|
margin-right: 50px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__terms {
|
|
|
|
margin-right: 35px;
|
|
|
|
}
|
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 {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_regular';
|
2018-12-18 14:43:23 +00:00
|
|
|
font-size: 14px;
|
|
|
|
line-height: 20px;
|
|
|
|
height: 48px;
|
|
|
|
text-align: center;
|
|
|
|
padding-left: 15px;
|
|
|
|
padding-right: 15px;
|
|
|
|
min-width: 140px;
|
2019-03-20 16:16:30 +00:00
|
|
|
text-decoration: none;
|
|
|
|
color: white;
|
2018-12-18 14:43:23 +00:00
|
|
|
|
2018-11-26 15:57:11 +00:00
|
|
|
.bold {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_medium';
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-20 16:16:30 +00:00
|
|
|
.loading-overlay {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
left: 0;
|
|
|
|
height: 100vh;
|
|
|
|
width: 0;
|
|
|
|
z-index: 100;
|
|
|
|
background-color: rgba(134, 134, 148, 0.7);
|
|
|
|
visibility: hidden;
|
|
|
|
opacity: 0;
|
|
|
|
-webkit-transition: all 0.5s linear;
|
|
|
|
-moz-transition: all 0.5s linear;
|
|
|
|
-o-transition: all 0.5s linear;
|
|
|
|
transition: all 0.5s linear;
|
2018-11-28 16:20:23 +00:00
|
|
|
|
2019-03-20 16:16:30 +00:00
|
|
|
&__logo {
|
|
|
|
width: 240px;
|
|
|
|
height: 110px;
|
|
|
|
z-index: 200;
|
2018-11-28 16:20:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-20 16:16:30 +00:00
|
|
|
.loading-overlay.active {
|
|
|
|
width: 100vw;
|
|
|
|
visibility: visible;
|
|
|
|
opacity: 1;
|
2018-11-26 15:57:11 +00:00
|
|
|
}
|
2018-11-14 14:57:21 +00:00
|
|
|
</style>
|