@@ -49,7 +49,7 @@ export const HoverNavigation = ({
4949 className ?: string ;
5050} ) => {
5151 const [ hoveredIndex , setHoveredIndex ] = useState < number | null > ( null ) ;
52- const { scrollYProgress } = useScroll ( ) ;
52+ const { scrollY } = useScroll ( ) ;
5353 const [ navVisible , setNavVisible ] = useState ( true ) ;
5454 const [ availableVisible , setAvailableVisible ] = useState ( false ) ;
5555
@@ -68,13 +68,13 @@ export const HoverNavigation = ({
6868
6969 const updateNavBarState = (
7070 width : number ,
71- scrollProgress : number = 0 ,
71+ scrollPosition : number = 0 ,
7272 scrollUp : boolean = false ,
7373 ) => {
7474 if ( width && width < 1024 ) {
7575 setNavVisible ( false ) ;
7676 setAvailableVisible ( true ) ;
77- } else if ( scrollProgress < 0.05 ) {
77+ } else if ( scrollPosition < 50 ) {
7878 setNavVisible ( true ) ;
7979 setAvailableVisible ( false ) ;
8080 } else if ( ! onContactPage ) {
@@ -86,12 +86,12 @@ export const HoverNavigation = ({
8686 }
8787 } ;
8888
89- useMotionValueEvent ( scrollYProgress , "change" , ( current ) => {
89+ useMotionValueEvent ( scrollY , "change" , ( current ) => {
9090 // Check if current is not undefined and is a number
9191 if ( typeof current === "number" ) {
92- let direction = current ! - scrollYProgress . getPrevious ( ) ! ;
92+ let direction = current ! - scrollY . getPrevious ( ) ! ;
9393 let scrollUp = direction <= 0 ;
94- let scrollProgress = scrollYProgress . get ( ) ;
94+ let scrollProgress = scrollY . get ( ) ;
9595
9696 updateNavBarState ( width , scrollProgress , scrollUp ) ;
9797 }
0 commit comments