This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
AppLayout.vue
175 lines (151 loc) · 3.56 KB
/
AppLayout.vue
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<div
:class="{
[$style.app]: true,
[$style.app__osMac]: $options.isMac,
[$style.app__osWin]: $options.isWin,
[$style.app__layoutLeft_compact]: !isLayoutInverted && !displaysTabLabels,
[$style.app__layoutLeft_extended]: !isLayoutInverted && displaysTabLabels,
[$style.app__layoutRight_compact]: isLayoutInverted && !displaysTabLabels,
[$style.app__layoutRight_extended]: isLayoutInverted && displaysTabLabels,
}"
>
<div
:class="{
[$style.titleBarSpacer]: true,
[$style.titleBarSpacer__osMac]: $options.isMac,
[$style.titleBarSpacer__osWin]: $options.isWin,
}"
/>
<the-title-bar :class="$style.titleBar" />
<the-side-bar :class="$style.sideBar" />
<div
:class="{
[$style.main]: true,
[$style.main__sideBarLeft]: !isLayoutInverted,
[$style.main__sideBarRight]: isLayoutInverted,
}"
>
<slot name="main" />
</div>
<slot name="overlays" />
</div>
</template>
<script>
import TheSideBar from '@/components/TheSideBar.vue';
import TheTitleBar from '@/components/TheTitleBar.vue';
export default {
isMac: process.platform === 'darwin',
isWin: process.platform !== 'darwin',
components: {
TheSideBar,
TheTitleBar,
},
computed: {
isLayoutInverted() {
return this.$store.getters['Settings/byKey']('layout.sideBarLocation') === 'right';
},
displaysTabLabels() {
return this.$store.getters['Settings/byKey']('navigation.displayTabLabels');
},
},
};
</script>
<style lang="postcss" module>
@tailwind preflight;
@tailwind components;
.app {
@apply
font-sans text-grey
bg-black select-none;
display: grid;
grid-template-columns: min-content min-content 1fr min-content min-content;
grid-template-rows: 2.4rem auto;
height: 100vh;
}
.app__osMac.app__layoutLeft_compact {
grid-template-areas:
"space space title title title"
"aside main main main main"
;
}
.app__osMac.app__layoutLeft_extended {
grid-template-areas:
"space space title title title"
"aside aside main main main"
;
}
.app__osMac.app__layoutRight_compact {
grid-template-areas:
"space space title title ....."
"main main main main aside"
;
}
.app__osMac.app__layoutRight_extended {
grid-template-areas:
"space space title ..... ....."
"main main main aside aside"
;
}
.app__osWin.app__layoutLeft_compact {
grid-template-areas:
"title title title space space"
"aside main main main main"
;
}
.app__osWin.app__layoutLeft_extended {
grid-template-areas:
"title title title space space"
"aside aside main main main"
;
}
.app__osWin.app__layoutRight_compact {
grid-template-areas:
"title title title space space"
"main main main main aside"
;
}
.app__osWin.app__layoutRight_extended {
grid-template-areas:
"title title title space space"
"main main main aside aside"
;
}
.titleBarSpacer {
grid-area: space;
max-width: config('width.64');
}
.titleBarSpacer__osMac {
min-width: 5rem;
}
.titleBarSpacer__osWin {
min-width: config('width.32');
}
.titleBar {
grid-area: title;
}
.sideBar {
@apply flex flex-col overflow-y-auto;
grid-area: aside;
max-width: config('width.64');
}
.main {
@apply overflow-y-auto bg-grey-darkest;
grid-area: main;
}
.main__sideBarLeft {
@apply rounded-tl-sm;
}
.main__sideBarRight {
@apply rounded-tr-sm;
}
</style>
<style lang="postcss">
body {
@apply h-screen overflow-hidden bg-black;
}
button:focus,
button:active:focus {
outline: none !important;
}
</style>