{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/wdzqOCbUp8yRhm0nqg75/M08ZrZsgkCAEGN2hYUOY/MouseParallax.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{createContext,useContext,useRef}from\"react\";import{motion,useMotionValue,useTransform,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const absoluteFill={position:\"absolute\",top:0,right:0,bottom:0,left:0};const ParallaxContext=/*#__PURE__*/createContext(null);export function withContainer(Component){return props=>{var _ref_current;const x=useMotionValue(0);const y=useMotionValue(0);const ref=useRef();const rect=(_ref_current=ref.current)===null||_ref_current===void 0?void 0:_ref_current.getBoundingClientRect();const handleMouseMove=e=>{if(!rect)return;const{clientX,clientY,target}=e;// Mouse position\nconst xx=(clientX-rect.left)/rect.width;const yy=(clientY-rect.top)/rect.height;x.set(xx);y.set(yy);};return /*#__PURE__*/_jsx(ParallaxContext.Provider,{value:{x,y},children:/*#__PURE__*/_jsx(Component,{...props,onMouseMove:handleMouseMove,ref:ref})});};}const useHoverParallax=({level})=>{const mouse=useContext(ParallaxContext);if(!mouse)return{x:null,y:null};const x=useSpring(useTransform(mouse.x,[0,.01,1],[0,-level,level]));const y=useSpring(useTransform(mouse.y,[0,.01,1],[0,-level,level]));return{x,y};};export function withHover3(Component){return props=>{const{x,y}=useHoverParallax({level:3});return /*#__PURE__*/_jsx(Component,{...props,style:{x,y,...props.style?props.style:{}}});};}export function withHover5(Component){return props=>{const{x,y}=useHoverParallax({level:5});return /*#__PURE__*/_jsx(Component,{...props,style:{x,y,...props.style?props.style:{}}});};}export function withHover7(Component){return props=>{const{x,y}=useHoverParallax({level:7});return /*#__PURE__*/_jsx(Component,{...props,style:{x,y,...props.style?props.style:{}}});};}export function withHover10(Component){return props=>{const{x,y}=useHoverParallax({level:10});return /*#__PURE__*/_jsx(Component,{...props,style:{x,y,...props.style?props.style:{}}});};}export function withHover20(Component){return props=>{const{x,y}=useHoverParallax({level:20});return /*#__PURE__*/_jsx(Component,{...props,style:{x,y,...props.style?props.style:{}}});};}export default function ParallaxLayer(props){const{level,...otherProps}=props;const{x,y}=useHoverParallax({level});return /*#__PURE__*/_jsx(motion.div,{...otherProps,style:{x,y,...props.style?props.style:{}}});}ParallaxLayer.defaultProps={level:5};addPropertyControls(ParallaxLayer,{level:{title:\"Parallax Level\",type:ControlType.Number},children:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},maxCount:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"withContainer\":{\"type\":\"reactHoc\",\"name\":\"withContainer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover7\":{\"type\":\"reactHoc\",\"name\":\"withHover7\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover20\":{\"type\":\"reactHoc\",\"name\":\"withHover20\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover10\":{\"type\":\"reactHoc\",\"name\":\"withHover10\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover5\":{\"type\":\"reactHoc\",\"name\":\"withHover5\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"ParallaxLayer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover3\":{\"type\":\"reactHoc\",\"name\":\"withHover3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MouseParallax.map"],
  "mappings": "0IAAiS,IAAMA,EAA6BC,EAAc,IAAI,EAAS,SAASC,EAAcC,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAIC,EAAa,IAAMC,EAAEC,EAAe,CAAC,EAAQC,EAAED,EAAe,CAAC,EAAQE,EAAIC,EAAO,EAAQC,GAAMN,EAAaI,EAAI,WAAW,MAAMJ,IAAe,OAAO,OAAOA,EAAa,sBAAsB,EAAQO,EAAgBC,GAAG,CAAC,GAAG,CAACF,EAAK,OAAO,GAAK,CAAC,Q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EAAW,MAAM,CAAC,EAAA1B,EAAE,EAAAE,EAAE,GAAGJ,EAAM,MAAMA,EAAM,MAAM,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC2B,EAAc,aAAa,CAAC,MAAM,CAAC,EAAEG,EAAoBH,EAAc,CAAC,MAAM,CAAC,MAAM,iBAAiB,KAAKI,EAAY,MAAM,EAAE,SAAS,CAAC,KAAKA,EAAY,MAAM,QAAQ,CAAC,KAAKA,EAAY,iBAAiB,EAAE,SAAS,CAAC,CAAC,CAAC",
  "names": ["ParallaxContext", "z", "withContainer", "Component", "props", "_ref_current", "x", "useMotionValue", "y", "ref", "pe", "rect", "handleMouseMove", "e", "clientX", "clientY", "target", "xx", "yy", "p", "useHoverParallax", "level", "mouse", "re", "useSpring", "useTransform", "withHover3", "withHover5", "withHover7", "withHover10", "withHover20", "ParallaxLayer", "otherProps", "motion", "addPropertyControls", "ControlType"]
}
