-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpHeader.vue
61 lines (56 loc) · 1.1 KB
/
SpHeader.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
<script setup lang="ts">
import Logo from './Logo.vue'
import { useHeader } from '@vuejs-jp/composable'
type HeaderProps = {
top?: number
}
withDefaults(defineProps<HeaderProps>(), {
top: 0,
})
const { headerRef } = useHeader()
const siteRoot = process.env.NODE_ENV === 'production' ? '/2024/' : '/'
</script>
<template>
<header ref="headerRef" :style="{ top }">
<div class="header-root">
<a class="link" :href="siteRoot" aria-label="Vue Fes Japan 2024">
<Logo class="logo" color="vue-blue" />
</a>
<slot />
</div>
</header>
</template>
<style scoped>
header {
position: fixed;
z-index: 10;
width: 100%;
padding: 0;
margin: 0;
box-shadow: 0 0 8px rgba(198, 202, 207, 0.8);
background-color: #fff;
}
.header-root {
padding: 16px 0;
display: flex;
align-items: center;
justify-content: space-between;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--color-white);
z-index: 5;
}
}
.link {
line-height: 0;
z-index: 10;
}
.logo {
height: 32px;
}
</style>