|
|
@ -1,4 +1,6 @@
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
|
|
|
import { useWindowScroll } from '@vueuse/core'
|
|
|
|
import { useSidebar } from '../composables/sidebar.js'
|
|
|
|
import { useSidebar } from '../composables/sidebar.js'
|
|
|
|
import VPNavBarTitle from './VPNavBarTitle.vue'
|
|
|
|
import VPNavBarTitle from './VPNavBarTitle.vue'
|
|
|
|
import VPNavBarSearch from './VPNavBarSearch.vue'
|
|
|
|
import VPNavBarSearch from './VPNavBarSearch.vue'
|
|
|
@ -17,11 +19,17 @@ defineEmits<{
|
|
|
|
(e: 'toggle-screen'): void
|
|
|
|
(e: 'toggle-screen'): void
|
|
|
|
}>()
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { y } = useWindowScroll()
|
|
|
|
const { hasSidebar } = useSidebar()
|
|
|
|
const { hasSidebar } = useSidebar()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const classes = computed(() => ({
|
|
|
|
|
|
|
|
'has-sidebar': hasSidebar.value,
|
|
|
|
|
|
|
|
fill: y.value > 0
|
|
|
|
|
|
|
|
}))
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="VPNavBar" :class="{ 'has-sidebar' : hasSidebar }">
|
|
|
|
<div class="VPNavBar" :class="classes">
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
|
<div class="title">
|
|
|
|
<div class="title">
|
|
|
|
<VPNavBarTitle>
|
|
|
|
<VPNavBarTitle>
|
|
|
@ -32,6 +40,7 @@ const { hasSidebar } = useSidebar()
|
|
|
|
|
|
|
|
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
<div class="curtain" />
|
|
|
|
<div class="curtain" />
|
|
|
|
|
|
|
|
<div class="content-body">
|
|
|
|
<slot name="nav-bar-content-before" />
|
|
|
|
<slot name="nav-bar-content-before" />
|
|
|
|
<VPNavBarSearch class="search" />
|
|
|
|
<VPNavBarSearch class="search" />
|
|
|
|
<VPNavBarMenu class="menu" />
|
|
|
|
<VPNavBarMenu class="menu" />
|
|
|
@ -44,18 +53,24 @@ const { hasSidebar } = useSidebar()
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
<style scoped>
|
|
|
|
.VPNavBar {
|
|
|
|
.VPNavBar {
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
border-bottom: 1px solid var(--vp-c-gutter);
|
|
|
|
border-bottom: 1px solid transparent;
|
|
|
|
padding: 0 8px 0 24px;
|
|
|
|
padding: 0 8px 0 24px;
|
|
|
|
height: var(--vp-nav-height);
|
|
|
|
height: var(--vp-nav-height);
|
|
|
|
transition: border-color 0.5s, background-color 0.5s;
|
|
|
|
transition: border-color 0.5s, background-color 0.5s;
|
|
|
|
pointer-events: none;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.VPNavBar.has-sidebar,
|
|
|
|
|
|
|
|
.VPNavBar.fill {
|
|
|
|
|
|
|
|
border-bottom-color: var(--vp-c-gutter);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 768px) {
|
|
|
|
@media (min-width: 768px) {
|
|
|
|
.VPNavBar {
|
|
|
|
.VPNavBar {
|
|
|
|
padding: 0 32px;
|
|
|
|
padding: 0 32px;
|
|
|
@ -78,6 +93,10 @@ const { hasSidebar } = useSidebar()
|
|
|
|
pointer-events: none;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.container :deep(*) {
|
|
|
|
|
|
|
|
pointer-events: auto;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 960px) {
|
|
|
|
@media (min-width: 960px) {
|
|
|
|
.VPNavBar.has-sidebar .container {
|
|
|
|
.VPNavBar.has-sidebar .container {
|
|
|
|
max-width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
@ -86,6 +105,12 @@ const { hasSidebar } = useSidebar()
|
|
|
|
|
|
|
|
|
|
|
|
.title {
|
|
|
|
.title {
|
|
|
|
flex-shrink: 0;
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
height: calc(var(--vp-nav-height) - 1px);
|
|
|
|
|
|
|
|
transition: background-color 0.5s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.VPNavBar.fill .title {
|
|
|
|
|
|
|
|
background-color: var(--vp-nav-bg-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 960px) {
|
|
|
|
@media (min-width: 960px) {
|
|
|
@ -97,7 +122,7 @@ const { hasSidebar } = useSidebar()
|
|
|
|
padding: 0 32px;
|
|
|
|
padding: 0 32px;
|
|
|
|
width: var(--vp-sidebar-width);
|
|
|
|
width: var(--vp-sidebar-width);
|
|
|
|
height: var(--vp-nav-height);
|
|
|
|
height: var(--vp-nav-height);
|
|
|
|
background-color: var(--vp-c-bg-alt);
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -108,14 +133,7 @@ const { hasSidebar } = useSidebar()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.container :deep(*) {
|
|
|
|
|
|
|
|
pointer-events: auto;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
.content {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -135,6 +153,25 @@ const { hasSidebar } = useSidebar()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.content-body {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
height: calc(var(--vp-nav-height) - 1px);
|
|
|
|
|
|
|
|
transition: background-color 0.5s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.VPNavBar.fill .content-body {
|
|
|
|
|
|
|
|
background-color: var(--vp-nav-bg-color);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 960px) {
|
|
|
|
|
|
|
|
.VPNavBar.has-sidebar .content-body {
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
background-color: var(--vp-nav-bg-color);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.menu + .translations::before,
|
|
|
|
.menu + .translations::before,
|
|
|
|
.menu + .appearance::before,
|
|
|
|
.menu + .appearance::before,
|
|
|
|
.menu + .social-links::before,
|
|
|
|
.menu + .social-links::before,
|
|
|
@ -165,7 +202,7 @@ const { hasSidebar } = useSidebar()
|
|
|
|
.VPNavBar.has-sidebar .curtain {
|
|
|
|
.VPNavBar.has-sidebar .curtain {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
right: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: -32px;
|
|
|
|
bottom: -31px;
|
|
|
|
width: calc(100% - var(--vp-sidebar-width));
|
|
|
|
width: calc(100% - var(--vp-sidebar-width));
|
|
|
|
height: 32px;
|
|
|
|
height: 32px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|