Repository navigation
Expand file tree
/
Copy pathglobal-top.vue
More file actions
77 lines (71 loc) · 1.73 KB
/
Copy pathglobal-top.vue
File metadata and controls
77 lines (71 loc) · 1.73 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
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useNav } from '@slidev/client'
const { currentSlideNo } = useNav()
const visible = ref(false)
const dismissed = ref(false)
function isShowcaseDeployment() {
if (typeof window === 'undefined') return false
return window.location.hostname === 'itenium-be.github.io'
&& window.location.pathname.startsWith('/Presentations/')
}
onMounted(() => {
if (currentSlideNo.value === 1 && isShowcaseDeployment()) {
visible.value = true
setTimeout(() => { visible.value = false }, 6000)
}
})
function dismiss() {
visible.value = false
dismissed.value = true
}
</script>
<template>
<Transition name="fade">
<div v-if="visible && !dismissed" class="nav-hint" @click="dismiss">
<span>Use <kbd>←</kbd> <kbd>→</kbd> arrow keys to navigate</span>
<span class="nav-hint-sep">·</span>
<span>Hover bottom-left for controls</span>
</div>
</Transition>
</template>
<style>
.nav-hint {
position: fixed;
top: 12px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.75);
color: rgba(255, 255, 255, 0.9);
font-family: 'Inter', system-ui, sans-serif;
font-size: 0.8rem;
padding: 0.45rem 1rem;
border-radius: 6px;
z-index: 100;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
backdrop-filter: blur(4px);
white-space: nowrap;
}
.nav-hint kbd {
background: rgba(255, 255, 255, 0.15);
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 3px;
padding: 0 0.3rem;
font-family: inherit;
font-size: 0.85em;
}
.nav-hint-sep {
opacity: 0.4;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
</style>