diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index ae41d89..cbb83d4 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -2,24 +2,13 @@ const isLargeScreen = useMediaQuery('(min-width: 1024px)') const appConfig = useAppConfig() +const { height } = useWindowSize() -const scrollThreshold = ref(0) - -onMounted(() => { - const updateThreshold = () => { - const viewportHeight = window.innerHeight || document.documentElement.clientHeight; - - scrollThreshold.value = Math.round(viewportHeight * 0.68); - } - - updateThreshold() +const scrollThreshold = computed(() => { + return Math.round(height.value * 0.68); }) -const effectiveScrollThreshold = computed(() => { - return import.meta.client ? scrollThreshold.value : 0; -}); - -const { isScrolled } = useScroll(effectiveScrollThreshold.value) +const { isScrolled } = useScroll(scrollThreshold.value)