-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal-bottom.vue
49 lines (42 loc) · 1.13 KB
/
global-bottom.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
<!-- filepath: /Users/stevenhill/Projects/slidev_template/theme/components/Footer.vue -->
<template>
<footer class="custom-footer">
<div class="footer-left">
<span>{{ author }}</span> | <span>{{ currentDate }}</span>
</div>
<div v-if="$nav.currentLayout !== 'cover'" class="footer-right">
{{ $nav.currentPage }} / {{ $nav.total }}
</div>
</footer>
</template>
<script setup>
import { useRoute } from 'vue-router'
// Access the frontmatter globally
const author = $slidev.themeConfigs.author || 'Unknown Author'
// Get the current date
const currentDate = new Date().toLocaleDateString()
// Get the current page number
const route = useRoute()
const pageNumber = route.meta?.slide || 1
</script>
<style scoped>
.custom-footer {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
font-size: 14px;
background-color: transparent; /* Transparent background */
position: fixed;
bottom: 0;
width: 100%;
z-index: 1000;
color: var(--text-color, #000); /* Use the main text color */
}
.footer-left {
margin-left: 20px;
}
.footer-right {
margin-right: 20px;
}
</style>