{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/A4rdhq7VabjF9YEx1fsj/AA0PvEN9svF5CugbDUKx/PeekyNavbar.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{useScroll,useVelocity}from\"framer-motion\";/**\n * This override allows to show and hide the navbar if the user scrolls up,\n * or if the mouse is at the top of the screen.\n *\n * @author Joe From Framer Today, Stanislas Laurent\n * @see <a>https://framer.today/6/</a>\n */ export function reactToScroll(Component){/** The sensitivity to the scroll gesture. The lower the more sentsitive. */ const SCROLL_SENSITIVITY=1;/** The height of the visible navbar */ const VISUAL_NAVBAR_HEIGHT=76;/** The height of the navbar's hitbox */ const NAVBAR_HITBOX_HEIGHT=294;/**\n     * The parameters of the animation used to show/hide the navbar.\n     * Make sure they are consistent with other animations across the rest of the website.\n     */ const slideAnimation={duration:.2,ease:\"spring\",stiffness:400,damping:30,mass:1,//Leave below properties as is for better visual effect\ndelay:.25};/**\n     * Helper hook to obtain the current mouse Y coordinate.\n     *\n     * @author Josh Comeau\n     * @see <a>https://www.joshwcomeau.com/snippets/react-hooks/use-mouse-position/</a>\n     */ const useMousePositionY=()=>{const[mousePosition,setMousePosition]=useState(null);useEffect(()=>{const updateMousePosition=ev=>{setMousePosition(ev.clientY);};window.addEventListener(\"mousemove\",updateMousePosition);return()=>{window.removeEventListener(\"mousemove\",updateMousePosition);};},[]);return mousePosition;};/**\n     * Handles detecting scroll direction and position\n     */ return props=>{const{scrollY}=useScroll();const scrollVelocity=useVelocity(scrollY);const mousePositionY=useMousePositionY();/** True if the scroll gesture is towards the top. */ const[isScrollingUp,setIsScrollingUp]=useState(false);/** True if the scroll position is at the top of the page. */ const[isAtTop,setIsAtTop]=useState(true);/** True if the navbar is visible. */ const[navBarVisible,setNavBarVisible]=useState(true);/**\n         * Determine if user is scrolling up when the scroll position changes\n         */ useEffect(()=>scrollVelocity.onChange(latest=>{if(latest>0){setIsScrollingUp(false);return;}if(latest<-SCROLL_SENSITIVITY){setIsScrollingUp(true);return;}}),[]);/**\n         * Determine if the scroll position is at the top of the page when the scroll position changes\n         */ useEffect(()=>scrollY.onChange(latest=>setIsAtTop(latest<=0)),[]);/**\n         * Handles the navbar visibility based on the scoll direction and position, and the ouse position\n         * whenever the scroll position, scroll direction or mouse position changes.\n         */ useEffect(()=>{const isMouseInHitbox=mousePositionY<NAVBAR_HITBOX_HEIGHT;setNavBarVisible(isScrollingUp||isAtTop||isMouseInHitbox);},[isScrollingUp,isAtTop,mousePositionY]);return /*#__PURE__*/ _jsx(Component,{...props,animate:{y:navBarVisible?0:-VISUAL_NAVBAR_HEIGHT},transition:slideAnimation});};}\nexport const __FramerMetadata__ = {\"exports\":{\"reactToScroll\":{\"type\":\"reactHoc\",\"name\":\"reactToScroll\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PeekyNavbar.map"],
  "mappings": "gJAMW,SAASA,EAAcC,EAAU,CAGpC,IAAMC,EAAe,CAAC,SAAS,GAAG,KAAK,SAAS,UAAU,IAAI,QAAQ,GAAG,KAAK,EACtF,MAAM,GAAG,EAKKC,EAAkB,IAAI,CAAC,GAAK,CAACC,EAAcC,CAAgB,EAAEC,EAAS,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAC,IAAMC,EAAoBC,GAAI,CAACJ,EAAiBI,EAAG,OAAO,CAAE,EAAE,OAAAC,EAAO,iBAAiB,YAAYF,CAAmB,EAAQ,IAAI,CAACE,EAAO,oBAAoB,YAAYF,CAAmB,CAAE,CAAE,EAAE,CAAC,CAAC,EAASJ,CAAc,EAE5T,OAAOO,GAAO,CAAC,GAAK,CAAC,QAAAC,CAAO,EAAEC,EAAU,EAAQC,EAAeC,EAAYH,CAAO,EAAQI,EAAeb,EAAkB,EAA6D,CAACc,EAAcC,CAAgB,EAAEZ,EAAS,EAAK,EAAqE,CAACa,EAAQC,CAAU,EAAEd,EAAS,EAAI,EAA6C,CAACe,EAAcC,CAAgB,EAAEhB,EAAS,EAAI,EAEra,OAAAC,EAAU,IAAIO,EAAe,SAASS,GAAQ,CAAC,GAAGA,EAAO,EAAE,CAACL,EAAiB,EAAK,EAAE,MAAO,CAAC,GAAGK,EAAO,GAAoB,CAACL,EAAiB,EAAI,EAAE,MAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAE/JX,EAAU,IAAIK,EAAQ,SAASW,GAAQH,EAAWG,GAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAGhEhB,EAAU,IAAI,CAAC,IAAMiB,EAAgBR,EAAe,IAAqBM,EAAiBL,GAAeE,GAASK,CAAe,CAAE,EAAE,CAACP,EAAcE,EAAQH,CAAc,CAAC,EAAuBS,EAAKxB,EAAU,CAAC,GAAGU,EAAM,QAAQ,CAAC,EAAEU,EAAc,EAAE,GAAqB,EAAE,WAAWnB,CAAc,CAAC,CAAE,CAAE",
  "names": ["reactToScroll", "Component", "slideAnimation", "useMousePositionY", "mousePosition", "setMousePosition", "ye", "ue", "updateMousePosition", "ev", "window", "props", "scrollY", "useScroll", "scrollVelocity", "useVelocity", "mousePositionY", "isScrollingUp", "setIsScrollingUp", "isAtTop", "setIsAtTop", "navBarVisible", "setNavBarVisible", "latest", "isMouseInHitbox", "p"]
}
