1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-12 13:48:23 +09:00
This commit is contained in:
syuilo 2018-10-15 05:28:35 +09:00
parent 63f7941073
commit 2582b8d132
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
2 changed files with 173 additions and 131 deletions

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="header" :class="$store.state.device.navbar"> <div class="header" :class="navbar">
<div class="body">
<div class="post"> <div class="post">
<button @click="post" title="%i18n:@post%">%fa:pencil-alt%</button> <button @click="post" title="%i18n:@post%">%fa:pencil-alt%</button>
</div> </div>
@ -23,7 +24,7 @@
<div> <div>
<a @click="drive">%fa:cloud%</a> <a @click="drive">%fa:cloud%</a>
</div> </div>
<div ref="notificationsButton" :class="{ active: showNotifications }" style="z-index:1;"> <div ref="notificationsButton" :class="{ active: showNotifications }">
<a @click="notifications">%fa:R bell%</a> <a @click="notifications">%fa:R bell%</a>
</div> </div>
<div> <div>
@ -54,9 +55,10 @@
<a @click="dark"><template v-if="$store.state.device.darkmode">%fa:moon%</template><template v-else>%fa:R moon%</template></a> <a @click="dark"><template v-if="$store.state.device.darkmode">%fa:moon%</template><template v-else>%fa:R moon%</template></a>
</div> </div>
</div> </div>
</div>
<transition name="slide"> <transition :name="`slide-${navbar}`">
<div class="notifications" v-if="showNotifications" ref="notifications"> <div class="notifications" v-if="showNotifications" ref="notifications" :class="navbar">
<mk-notifications/> <mk-notifications/>
</div> </div>
</transition> </transition>
@ -85,7 +87,11 @@ export default Vue.extend({
computed: { computed: {
hasUnreadMessagingMessage(): boolean { hasUnreadMessagingMessage(): boolean {
return this.$store.getters.isSignedIn && this.$store.state.i.hasUnreadMessagingMessage; return this.$store.getters.isSignedIn && this.$store.state.i.hasUnreadMessagingMessage;
} },
navbar(): string {
return this.$store.state.device.navbar;
},
}, },
mounted() { mounted() {
@ -204,14 +210,22 @@ export default Vue.extend({
z-index 1000 z-index 1000
width $width width $width
height 100% height 100%
background var(--desktopHeaderBg)
box-shadow var(--shadowRight)
&.left &.left
left 0 left 0
box-shadow var(--shadowRight)
&.right &.right
right 0 right 0
box-shadow var(--shadowLeft)
> .body
position fixed
top 0
z-index 1
width $width
height 100%
background var(--desktopHeaderBg)
> .post > .post
width $width width $width
@ -245,27 +259,6 @@ export default Vue.extend({
background var(--primaryDarken10) !important background var(--primaryDarken10) !important
transition background 0s ease transition background 0s ease
.nav
> *
&.active
box-shadow -4px 0 var(--primary) inset
> *
display block
width $width
line-height 52px
text-align center
font-size 18px
color var(--desktopHeaderFg)
&:hover
background rgba(0, 0, 0, 0.05)
color var(--desktopHeaderHoverFg)
text-decoration none
&:active
background rgba(0, 0, 0, 0.1)
> .nav.bottom > .nav.bottom
position absolute position absolute
bottom 128px bottom 128px
@ -310,20 +303,66 @@ export default Vue.extend({
> .notifications > .notifications
position fixed position fixed
top 0 top 0
left $width
width 350px width 350px
height 100% height 100%
overflow auto overflow auto
background var(--face) background var(--face)
&.left
left $width
box-shadow var(--shadowRight) box-shadow var(--shadowRight)
.slide-enter-active, &.right
.slide-leave-active { right $width
box-shadow var(--shadowLeft)
.nav
> *
> *
display block
width $width
line-height 52px
text-align center
font-size 18px
color var(--desktopHeaderFg)
&:hover
background rgba(0, 0, 0, 0.05)
color var(--desktopHeaderHoverFg)
text-decoration none
&:active
background rgba(0, 0, 0, 0.1)
&.left
.nav
> *
&.active
box-shadow -4px 0 var(--primary) inset
&.right
.nav
> *
&.active
box-shadow 4px 0 var(--primary) inset
.slide-left-enter-active,
.slide-left-leave-active {
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.slide-enter, .slide-leave-to { .slide-left-enter, .slide-left-leave-to {
transform: translateX(-16px); transform: translateX(-16px);
opacity: 0; opacity: 0;
} }
.slide-right-enter-active,
.slide-right-leave-active {
transition: all 0.2s ease;
}
.slide-right-enter, .slide-right-leave-to {
transform: translateX(16px);
opacity: 0;
}
</style> </style>

View File

@ -125,13 +125,16 @@ export default (callback: (launch: (router: VueRouter, api?: (os: MiOS) => API)
//#region shadow //#region shadow
const shadow = '0 3px 8px rgba(0, 0, 0, 0.2)'; const shadow = '0 3px 8px rgba(0, 0, 0, 0.2)';
const shadowRight = '4px 0 4px rgba(0, 0, 0, 0.1)'; const shadowRight = '4px 0 4px rgba(0, 0, 0, 0.1)';
const shadowLeft = '-4px 0 4px rgba(0, 0, 0, 0.1)';
if (os.store.state.settings.useShadow) document.documentElement.style.setProperty('--shadow', shadow); if (os.store.state.settings.useShadow) document.documentElement.style.setProperty('--shadow', shadow);
if (os.store.state.settings.useShadow) document.documentElement.style.setProperty('--shadowRight', shadowRight); if (os.store.state.settings.useShadow) document.documentElement.style.setProperty('--shadowRight', shadowRight);
if (os.store.state.settings.useShadow) document.documentElement.style.setProperty('--shadowLeft', shadowLeft);
os.store.watch(s => { os.store.watch(s => {
return s.settings.useShadow; return s.settings.useShadow;
}, v => { }, v => {
document.documentElement.style.setProperty('--shadow', v ? shadow : 'none'); document.documentElement.style.setProperty('--shadow', v ? shadow : 'none');
document.documentElement.style.setProperty('--shadowRight', v ? shadowRight : 'none'); document.documentElement.style.setProperty('--shadowRight', v ? shadowRight : 'none');
document.documentElement.style.setProperty('--shadowLeft', v ? shadowLeft : 'none');
}); });
//#endregion //#endregion