-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.vue
More file actions
71 lines (62 loc) · 1.96 KB
/
app.vue
File metadata and controls
71 lines (62 loc) · 1.96 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
<template>
<v-app>
<v-layout>
<v-app-bar flat border class="position-fixed" :density="mobile ? 'compact' : 'comfortable'">
<v-toolbar border color="white" :density="mobile ? 'compact' : 'comfortable'">
<template #prepend>
<v-btn v-if="$vuetify.display.mobile && sidebarLabel" icon="mdi-menu" variant="text" @click="toggleSidebar" />
<v-icon v-else class="ma-3" icon="mdi-school" />
</template>
<v-toolbar-title :class="$vuetify.display.mobile ? 'text-body-1' : ''" @click="navigateTo('/')">{{ config.public.siteTitle
}}</v-toolbar-title>
<v-spacer class="d-none d-md-block" />
<template #append>
<TopTabs />
</template>
</v-toolbar>
</v-app-bar>
<NuxtPage :sidebar="sidebarDrawer" />
</v-layout>
</v-app>
</template>
<script lang="ts" setup>
import TopTabs from '~/components/TopTabs.vue';
const config = useRuntimeConfig();
const router = useRouter();
const route = useRoute();
const mobile = useNuxtApp().$vuetify.display.smAndDown;
const sidebarLabel = computed(() => {
const path = route.path.includes("edit");
return path || route.params.major;
})
const sidebarDrawer = ref(false);
function toggleSidebar() {
sidebarDrawer.value = !sidebarDrawer.value;
}
watch(() => route.path, () => {
if (mobile)
sidebarDrawer.value = false;
})
function navigateTo(path: string) {
router.push(path);
}
</script>
<style>
::-webkit-scrollbar {
-webkit-appearance: none;
width: 3px;
height: 3px;
}
::-webkit-scrollbar-thumb {
cursor: pointer;
border-radius: 5px;
background: rgba(0, 0, 0, 0.15);
transition: color 0.2s ease;
}
.site-title {
font-weight: bold;
font-size: 1.25rem;
cursor: pointer;
min-width: 200px;
}
</style>