Skip to content
Snippets Groups Projects
Commit 778221ee authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Merge branch 'navbar-density-scroll-down' into 'dev'

Navbar density scroll down

See merge request !29
parents cd5a6661 a3c6b33e
No related branches found
No related tags found
1 merge request!29Navbar density scroll down
Pipeline #114817 canceled
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
// import { useCustomTheme } from '~/composables/useCustomTheme' // import { useCustomTheme } from '~/composables/useCustomTheme'
import { useDisplay, useTheme } from "vuetify"; import { useDisplay, useTheme } from "vuetify";
export interface Props {
density: 'prominent' | 'compact'
}
const runtimeConfig = useRuntimeConfig(); const runtimeConfig = useRuntimeConfig();
const { navigation } = useContent(); const { navigation } = useContent();
...@@ -9,6 +12,10 @@ const { mobile } = useDisplay(); ...@@ -9,6 +12,10 @@ const { mobile } = useDisplay();
const theme = useTheme(); const theme = useTheme();
const props = withDefaults(defineProps<Props>(), {
density: "prominent"
});
function toggleTheme() { function toggleTheme() {
theme.global.name.value = theme.global.current.value.dark ? "light" : "dark"; theme.global.name.value = theme.global.current.value.dark ? "light" : "dark";
} }
...@@ -38,7 +45,7 @@ const computedNavigation = computed(() => { ...@@ -38,7 +45,7 @@ const computedNavigation = computed(() => {
}); });
</script> </script>
<template> <template>
<v-app-bar :elevation="0" border density="prominent" scroll-behavior="hide" scroll-threshold="150"> <v-app-bar :elevation="0" border :density="density">
<template #prepend> <template #prepend>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon> <v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<!-- <Logo height="45px" /> --> <!-- <Logo height="45px" /> -->
......
...@@ -3,13 +3,15 @@ const { page } = useContent(); ...@@ -3,13 +3,15 @@ const { page } = useContent();
// import { useCustomTheme } from '~/composables/useCustomTheme' // import { useCustomTheme } from '~/composables/useCustomTheme'
import { useDisplay } from 'vuetify' import { useDisplay } from 'vuetify'
// const { isDark } = useCustomTheme()
// const { mobile } = useDisplay() const scrollThreshold = ref(200)
console.log("================================") const density = ref("prominent")
// console.log(surround) function onScroll(e) {
// console.log(prev) if (window.scrollY > scrollThreshold.value) {
// console.log(next) density.value = "compact"
console.log(page) }
else { density.value = "prominent" }
}
</script> </script>
<template> <template>
<VApp> <VApp>
...@@ -19,7 +21,7 @@ console.log(page) ...@@ -19,7 +21,7 @@ console.log(page)
<!-- <v-container class="fill-height w-auto" > --> <!-- <v-container class="fill-height w-auto" > -->
<!-- <v-card flat max-width="1000" min-height="300" color="transparent"> <!-- <v-card flat max-width="1000" min-height="300" color="transparent">
<v-card-text> --> <v-card-text> -->
<v-container> <v-container v-scroll="onScroll">
<slot /> <slot />
<!-- </v-card-text> <!-- </v-card-text>
</v-card> --> </v-card> -->
...@@ -28,7 +30,7 @@ console.log(page) ...@@ -28,7 +30,7 @@ console.log(page)
</v-container> </v-container>
<Footer></Footer> <Footer></Footer>
</v-main> </v-main>
<NavNavbar /> <NavNavbar :density="density" />
<NavTableOfContent :links="page.body.toc.links" /> <NavTableOfContent :links="page.body.toc.links" />
<nav-back-to-top /> <nav-back-to-top />
</VApp> </VApp>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment