-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expand file tree
/
Copy pathVPNavScreen.vue
More file actions
97 lines (84 loc) · 2.12 KB
/
Copy pathVPNavScreen.vue
File metadata and controls
97 lines (84 loc) · 2.12 KB
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
<script setup lang="ts">
import { useScrollLock } from '@vueuse/core'
import { inBrowser } from 'vitepress'
import VPNavScreenAppearance from './VPNavScreenAppearance.vue'
import VPNavScreenMenu from './VPNavScreenMenu.vue'
import VPNavScreenSocialLinks from './VPNavScreenSocialLinks.vue'
import VPNavScreenTranslations from './VPNavScreenTranslations.vue'
defineProps<{
open: boolean
}>()
const isLocked = useScrollLock(inBrowser ? document.body : null)
</script>
<template>
<transition
name="fade"
@enter="isLocked = true"
@after-leave="isLocked = false"
>
<div v-if="open" class="VPNavScreen" id="VPNavScreen">
<div class="container">
<slot name="nav-screen-content-before" />
<VPNavScreenMenu class="menu" />
<VPNavScreenTranslations class="translations" />
<VPNavScreenAppearance class="appearance" />
<VPNavScreenSocialLinks class="social-links" />
<slot name="nav-screen-content-after" />
</div>
</div>
</transition>
</template>
<style scoped>
.VPNavScreen {
position: fixed;
top: 0;
/*rtl:ignore*/
right: 0;
bottom: 0;
/*rtl:ignore*/
left: 0;
padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 1px) 2rem 0;
width: 100%;
background-color: var(--vp-nav-screen-bg-color);
overflow-y: auto;
transition: background-color 0.25s;
pointer-events: auto;
}
.VPNavScreen.fade-enter-active,
.VPNavScreen.fade-leave-active {
transition: opacity 0.25s;
}
.VPNavScreen.fade-enter-active .container,
.VPNavScreen.fade-leave-active .container {
transition: transform 0.25s ease;
}
.VPNavScreen.fade-enter-from,
.VPNavScreen.fade-leave-to {
opacity: 0;
}
.VPNavScreen.fade-enter-from .container,
.VPNavScreen.fade-leave-to .container {
transform: translateY(-0.5rem);
}
@media (min-width: 48rem) {
.VPNavScreen {
display: none;
}
}
.container {
margin: 0 auto;
padding: 1.5rem 0 6rem;
max-width: 18rem;
}
.menu + .translations,
.menu + .appearance,
.translations + .appearance {
margin-top: 1.5rem;
}
.menu + .social-links {
margin-top: 1rem;
}
.appearance + .social-links {
margin-top: 1rem;
}
</style>