Updated
This commit is contained in:
@@ -8,15 +8,7 @@ import useHomeData from "~/composables/api/home/useHomeData";
|
||||
|
||||
// state
|
||||
|
||||
const { $gsap: gsap } = useNuxtApp();
|
||||
|
||||
const { data: homeData } = useHomeData();
|
||||
|
||||
const sectionTarget = ref(null);
|
||||
const isSectionInsideViewport = useElementVisibility(sectionTarget, {
|
||||
rootMargin: "0% 0px -100% 0px"
|
||||
});
|
||||
|
||||
const swiper_instance = ref<SwiperClass | null>(null);
|
||||
|
||||
// methods
|
||||
@@ -25,28 +17,6 @@ const onSwiper = (swiper: SwiperClass) => {
|
||||
swiper_instance.value = swiper;
|
||||
};
|
||||
|
||||
// watch
|
||||
|
||||
watch(() => isSectionInsideViewport.value, (newValue) => {
|
||||
if (newValue) {
|
||||
gsap.fromTo("#header-navbar", {
|
||||
background: "white",
|
||||
filter: "invert(0%)"
|
||||
}, {
|
||||
background: "transparent",
|
||||
filter: "invert(100%)"
|
||||
});
|
||||
} else {
|
||||
gsap.fromTo("#header-navbar", {
|
||||
background: "transparent",
|
||||
filter: "invert(100%)"
|
||||
}, {
|
||||
background: "white",
|
||||
filter: "invert(0%)"
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user