|
1 | 1 | <template> |
2 | 2 | <div id="app"> |
3 | | - <div id="nav"> |
4 | | - <router-link to="/">Home</router-link> |
5 | | - <router-link v-if="user" :to="{ name: 'dashboard' }" |
6 | | - >Dashboard</router-link |
7 | | - > |
8 | | - <template v-if="!user"> |
9 | | - <router-link :to="{ name: 'authenticate' }" class="navButton"> |
10 | | - <span>Login</span> |
11 | | - </router-link> |
12 | | - </template> |
13 | | - |
14 | | - <template v-else> |
15 | | - <span>Hello, {{ user.name }}.</span> |
16 | | - <button type="button" @click="logout">Log out</button> |
17 | | - </template> |
18 | | - </div> |
19 | | - <router-view /> |
| 3 | + <app-nav /> |
| 4 | + <router-view class="page" /> |
20 | 5 | </div> |
21 | 6 | </template> |
22 | 7 |
|
23 | 8 | <script> |
| 9 | +import AppNav from './components/AppNav' |
| 10 | +
|
24 | 11 | export default { |
25 | | - computed: { |
26 | | - user() { |
27 | | - return this.$store.state.user |
28 | | - } |
29 | | - }, |
30 | | - methods: { |
31 | | - logout() { |
32 | | - this.$store.dispatch('logout') |
33 | | - } |
34 | | - } |
| 12 | + name: 'App', |
| 13 | + components: { AppNav } |
35 | 14 | } |
36 | 15 | </script> |
37 | 16 |
|
38 | | -<style> |
| 17 | +<style lang="scss"> |
| 18 | +@import "./assets/styles/global.scss"; |
39 | 19 | #app { |
40 | 20 | font-family: 'Avenir', Helvetica, Arial, sans-serif; |
41 | 21 | -webkit-font-smoothing: antialiased; |
42 | 22 | -moz-osx-font-smoothing: grayscale; |
43 | 23 | text-align: center; |
44 | 24 | color: #2c3e50; |
45 | 25 | } |
46 | | -#nav { |
| 26 | +
|
| 27 | +.page{ |
47 | 28 | display: flex; |
48 | | - flex-wrap: wrap; |
49 | | - padding: 0.2em; |
50 | | - margin-bottom: 3em; |
51 | | - background: linear-gradient(to right, #16c0b0, #84cf6a); |
52 | | -} |
53 | | -#nav a { |
54 | | - font-weight: bold; |
55 | | - color: #2c3e50; |
56 | | - margin: auto 0.8em auto 0.4em; |
57 | | -} |
58 | | -#nav a.router-link-exact-active { |
59 | | - color: white; |
60 | | -} |
61 | | -#nav button { |
62 | | - color: #2c3e50; |
63 | | - background: white; |
64 | | - margin-left: auto; |
65 | | -} |
66 | | -#nav span { |
67 | | - margin: auto 1em auto 0em; |
68 | | -} |
69 | | -#nav a span { |
70 | | - vertical-align: middle; |
71 | | - margin: auto !important; |
72 | | -} |
73 | | -a:visited { |
74 | | - color: #2c3e50; |
75 | | -} |
76 | | -body { |
77 | | - padding: 0em; |
78 | | - margin: 0em; |
79 | | -} |
80 | | -button { |
81 | | - width: 5em; |
82 | | - height: 2em; |
83 | | - border-radius: 5%; |
84 | | - margin: 0.5em; |
85 | | - font-size: 1em; |
86 | | - color: white; |
87 | | - background: linear-gradient(to right, #16c0b0, #84cf6a); |
88 | | -} |
89 | | -form { |
90 | | - display: block; |
91 | | - width: 14em; |
92 | | - margin: auto; |
93 | | -} |
94 | | -form p { |
95 | | - color: red; |
96 | | -} |
97 | | -input { |
98 | | - display: block; |
99 | | - width: 100%; |
100 | | - height: 1.6em; |
101 | | - padding: 0.5em; |
102 | | - margin-bottom: 1em; |
103 | | - font: 1em 'Avenir', Helvetica, sans-serif; |
104 | | -} |
105 | | -.authLink { |
106 | | - font-size: 0.8em; |
107 | | - text-decoration: underline; |
108 | | - color: #2c3e50; |
109 | | -} |
110 | | -.navButton { |
111 | | - background: white; |
112 | | - color: #2c3e50 !important; |
113 | | - text-decoration: none; |
114 | | - font-size: 1em; |
115 | | - font-weight: 500 !important; |
116 | | - width: 5em; |
117 | | - height: 1.8em; |
118 | | - border-radius: 5%; |
119 | | - margin: 0.5em 0.5em 0.5em auto !important; |
| 29 | + justify-content: center; |
| 30 | + flex-direction: column; |
| 31 | + align-items: center; |
| 32 | + min-height: calc(100vh - 56px); |
120 | 33 | } |
121 | 34 | </style> |
0 commit comments