-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHeader.vue
49 lines (42 loc) · 932 Bytes
/
Header.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
<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;
background-color: rgba(255, 255, 255, 0.9);
box-shadow: 0 0 8px rgba(198, 202, 207, 0.8);
}
.header-root {
padding: 20px 80px;
display: flex;
align-items: center;
justify-content: space-between;
}
.link {
line-height: 0;
}
</style>