-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal-top.vue
45 lines (40 loc) · 1001 Bytes
/
global-top.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
<template>
<header class="custom-header">
<img v-if="logo" :src="logo" alt="Logo" class="logo" />
<img v-if="avatar" :src="avatar" alt="Avatar" class="avatar" />
</header>
</template>
<script setup>
// Access the theme configuration using $slidev.themeConfigs
const logo = $slidev.themeConfigs.logo || ''
const avatar = $slidev.themeConfigs.avatar || ''
</script>
<style scoped>
.custom-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: transparent; /* Transparent background */
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1000;
}
.logo {
height: 40px;
}
.avatar {
height: 40px;
width: 40px;
border-radius: 50%; /* Makes the avatar circular */
object-fit: cover; /* Ensures the image fits within the circle */
}
</style>
<style>
/* Add global spacing below the header */
.slidev-layout {
padding-top: 60px; /* Adjust this value to match the height of the header */
}
</style>