This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduced cleaner layout strategy
- Loading branch information
Showing
18 changed files
with
361 additions
and
222 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,27 @@ | ||
<template> | ||
<div | ||
:class="{ | ||
[$style.app]: true, | ||
[$style['app--sidebar-right']]: isLayoutInverted, | ||
}" | ||
> | ||
<aside :class="$style.aside"> | ||
<window-controls | ||
:class="$style.aside__header" | ||
/> | ||
<tabs-nav :class="$style.aside__body" /> | ||
</aside> | ||
<tabs-list :class="$style.main" /> | ||
<div :class="$style.main"> | ||
<app-layout> | ||
<template slot="main"> | ||
<tabs-list /> | ||
<router-view :key="$route.path" /> | ||
</div> | ||
<window-dimmer /> | ||
</div> | ||
</template> | ||
<template slot="overlays"> | ||
<window-dimmer /> | ||
</template> | ||
</app-layout> | ||
</template> | ||
|
||
<script> | ||
import AppLayout from '@/components/AppLayout.vue'; | ||
import TabsList from '@/components/TabsList.vue'; | ||
import TabsNav from '@/components/TabsNav.vue'; | ||
import WindowControls from '@/components/WindowControls.vue'; | ||
import WindowDimmer from '@/components/WindowDimmer.vue'; | ||
import NotificationSchedule from '@/utils/mixinNotificationSchedule'; | ||
export default { | ||
components: { | ||
AppLayout, | ||
TabsList, | ||
TabsNav, | ||
WindowControls, | ||
WindowDimmer, | ||
}, | ||
mixins: [NotificationSchedule], | ||
computed: { | ||
isLayoutInverted() { | ||
return this.$store.getters['Settings/byKey']('layout.sideBarLocation') === 'right'; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="postcss" module> | ||
@tailwind preflight; | ||
@tailwind components; | ||
.app { | ||
@apply | ||
font-sans text-grey | ||
bg-black select-none; | ||
display: grid; | ||
grid-auto-flow: dense; | ||
grid-template-columns: [aside] min-content [main] auto; | ||
grid-template-rows: 100vh; | ||
} | ||
.app--sidebar-right { | ||
direction: rtl; | ||
} | ||
.aside { | ||
@apply relative flex flex-col; | ||
grid-column: aside; | ||
max-width: config('width.64'); | ||
direction: ltr; | ||
} | ||
.aside__header { | ||
@apply flex-no-shrink; | ||
} | ||
.aside__body { | ||
@apply flex-grow; | ||
} | ||
.main { | ||
@apply relative z-10 overflow-hidden; | ||
grid-column: main; | ||
direction: ltr; | ||
} | ||
.main:after { | ||
@apply absolute pin-y z-20 w-px pointer-events-none; | ||
content: ""; | ||
background-color: #fff1; | ||
} | ||
.app:not(.app--sidebar-right) .main:after { | ||
@apply pin-l; | ||
} | ||
.app.app--sidebar-right .main:after { | ||
@apply pin-r; | ||
} | ||
</style> | ||
|
||
<style lang="postcss"> | ||
body { | ||
@apply h-screen overflow-hidden bg-black; | ||
} | ||
button:focus, | ||
button:active:focus { | ||
outline: none !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,4 +57,8 @@ export default { | |
.size-5 { | ||
@apply w-5 h-5; | ||
} | ||
.size-6 { | ||
@apply w-6 h-6; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<template> | ||
<div | ||
:class="{ | ||
[$style.app]: true, | ||
[$style.app__osMac]: $options.isMac, | ||
[$style.app__osWin]: $options.isWin, | ||
[$style.app__layoutLeft_extended]: !isLayoutInverted, | ||
[$style.app__layoutRight_extended]: isLayoutInverted, | ||
}" | ||
> | ||
<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'; | ||
}, | ||
}, | ||
}; | ||
</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_extended { | ||
grid-template-areas: | ||
"space space title title title" | ||
"aside aside main main main" | ||
; | ||
} | ||
.app__osMac.app__layoutRight_extended { | ||
grid-template-areas: | ||
"space space title ..... ....." | ||
"main main main aside aside" | ||
; | ||
} | ||
.app__osWin.app__layoutLeft_extended { | ||
grid-template-areas: | ||
"title title title space space" | ||
"aside aside main main main" | ||
; | ||
} | ||
.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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<router-link | ||
:active-class="$style.active" | ||
:class="$style.btn" | ||
:to="to" | ||
tag="button" | ||
> | ||
<app-icon | ||
:face="icon" | ||
:size="6" | ||
/> | ||
</router-link> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
icon: { | ||
type: String, | ||
required: true, | ||
}, | ||
to: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="postcss" module> | ||
.btn { | ||
@apply | ||
block w-full p-2 | ||
text-grey-darkest text-center; | ||
} | ||
.active { | ||
@apply text-grey-darker; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.