storj/web/satellite/src/App.vue

129 lines
2.8 KiB
Vue
Raw Normal View History

2019-01-24 20:15:10 +00:00
// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<div id="app" @click="onClick">
<router-view/>
<!-- Area for displaying notification -->
<NotificationArea/>
</div>
</template>
<script lang="ts">
2019-09-09 11:33:39 +01:00
import { Component, Vue } from 'vue-property-decorator';
import NotificationArea from '@/components/notifications/NotificationArea.vue';
import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
import { MetaUtils } from '@/utils/meta';
2019-09-09 11:33:39 +01:00
@Component({
components: {
NotificationArea,
2019-09-09 11:33:39 +01:00
},
})
export default class App extends Vue {
private ids: string[] = [
'accountDropdown',
'accountDropdownButton',
'projectDropdown',
'projectDropdownButton',
'sortTeamMemberByDropdown',
'sortTeamMemberByDropdownButton',
'notificationArea',
'successfulRegistrationPopup',
'paymentSelectButton',
'paymentSelect',
2019-09-09 11:33:39 +01:00
];
public mounted(): void {
const satelliteName = MetaUtils.getMetaContent('satellite-name');
const segmentioId = MetaUtils.getMetaContent('segment-io');
if (satelliteName) {
this.$store.dispatch(APP_STATE_ACTIONS.SET_SATELLITE_NAME, satelliteName);
}
if (segmentioId) {
this.$segment.init(segmentioId);
}
}
public onClick(e: Event): void {
let target: any = e.target;
2019-09-09 11:33:39 +01:00
while (target) {
if (this.ids.includes(target.id)) {
2019-09-09 11:33:39 +01:00
return;
}
2019-09-09 11:33:39 +01:00
target = target.parentNode;
}
2019-09-09 11:33:39 +01:00
this.$store.dispatch(APP_STATE_ACTIONS.CLOSE_POPUPS);
}
2019-09-09 11:33:39 +01:00
}
</script>
<style lang="scss">
body {
margin: 0 !important;
height: 100vh;
zoom: 100%;
}
img,
a {
-webkit-user-drag: none;
}
@font-face {
font-family: 'font_regular';
font-display: swap;
src: url('../static/fonts/font_regular.ttf');
}
@font-face {
font-family: 'font_medium';
font-display: swap;
src: url('../static/fonts/font_medium.ttf');
}
@font-face {
font-family: 'font_bold';
font-display: swap;
src: url('../static/fonts/font_bold.ttf');
}
a {
cursor: pointer;
}
input,
textarea {
font-family: inherit;
font-weight: 600;
border: 1px solid rgba(56, 75, 101, 0.4);
color: #354049;
caret-color: #2683ff;
}
2019-05-29 17:22:16 +01:00
/* width */
2019-05-29 17:22:16 +01:00
::-webkit-scrollbar {
width: 4px;
}
/* Track */
2019-05-29 17:22:16 +01:00
::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px #fff;
}
/* Handle */
2019-05-29 17:22:16 +01:00
::-webkit-scrollbar-thumb {
background: #afb7c1;
2019-05-29 17:22:16 +01:00
border-radius: 6px;
height: 5px;
}
</style>