{"version":3,"file":"ScrollScale.TPBVFudM.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/CT02ayjRbl0eO9epGhVf/QPolhs6eoXsQDZwpXago/ScrollScale.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useMotionValue,useTransform,useSpring,useMotionValueEvent}from\"framer-motion\";import{useEffect,useState}from\"react\";// Apply this to the BIG hero name\nexport function withHeroName(Component){return props=>{const scrollY=useMotionValue(0);const opacity=useTransform(scrollY,[0,250],[1,0]);const scale=useTransform(scrollY,[0,250],[1,.4]);useEffect(()=>{const onScroll=()=>scrollY.set(window.scrollY);window.addEventListener(\"scroll\",onScroll,true);return()=>window.removeEventListener(\"scroll\",onScroll,true);},[]);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,opacity,scale,transformOrigin:\"top left\"}});};}// Apply this to the SMALL nav logo\nexport function withNavLogo(Component){return props=>{const scrollY=useMotionValue(0);const rawOpacity=useTransform(scrollY,[220,300],[0,1]);const[hasAppeared,setHasAppeared]=useState(false);const[wasVisible,setWasVisible]=useState(false);const wiggle=useSpring(0,{stiffness:300,damping:8});useEffect(()=>{const onScroll=()=>scrollY.set(window.scrollY);window.addEventListener(\"scroll\",onScroll,true);return()=>window.removeEventListener(\"scroll\",onScroll,true);},[]);useMotionValueEvent(rawOpacity,\"change\",latest=>{const isVisible=latest>.95;if(isVisible&&!wasVisible){wiggle.set(6);setTimeout(()=>wiggle.set(0),50);}setWasVisible(isVisible);});const rotate=wiggle;return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,opacity:rawOpacity,rotate,transformOrigin:\"center center\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withHeroName\":{\"type\":\"reactHoc\",\"name\":\"withHeroName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withNavLogo\":{\"type\":\"reactHoc\",\"name\":\"withNavLogo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# source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