summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/StartPage.vue
blob: 2b3dc1204cad379a7b1b6c7954184193ea7579b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<i18n>
{
  "en": {
  },
  "de": {
  }
}
</i18n>

<template>
  <v-app class="grey darken-4 non-selectable">

    <div class="setting-buttons">
      <v-btn class="ma-2" icon @click="$store.commit('saveSetting', { name: 'dark', value: !settings.dark })">
        <v-icon>invert_colors</v-icon>
      </v-btn>
    </div>

    <div dark class="start-page">
      <img v-if="settings.dark" class="logo" src="@/assets/logo.svg"/>
      <img v-else class="logo" src="@/assets/logo-light.svg"/>
      <router-view></router-view>
    </div>
    <notifications-snackbars></notifications-snackbars>
  </v-app>
</template>

<script>
import { mapState } from 'vuex'
import NotificationsSnackbars from '@/components/NotificationsSnackbars'
import StartPageLogin from '@/components/StartPageLogin'
import StartPageSetup from '@/components/StartPageSetup'

export default {
  name: 'StartPage',
  routes () {
    return [
      { name: 'login', path: 'login', component: StartPageLogin },
      { name: 'setup', path: 'setup', component: StartPageSetup }
    ]
  },
  components: {
    NotificationsSnackbars
  },
  computed: {
    ...mapState(['settings', 'user']),
    dark () { return this.settings.dark }
  },
  watch: {
    dark (value) {
      this.$vuetify.theme.dark = value
    }
  }
}
</script>

<style scoped>
.setting-buttons {
  position: absolute;
  top: 0;
  right: 0;
}

.start-page {
  height: 100%;
  width: 100%;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 180px;
  margin-bottom: 60px;
}
</style>