{"version":3,"file":"shared-lib.qB2ODqxM.mjs","names":["React.useState","React.useRef","metadata","siteMetadata","metadataVersion","__FramerMetadata__","metadata","siteMetadata"],"sources":["https:/framerusercontent.com/modules/OdY2SiIOc1s3nQJsFIMQ/ODq3atjuYvnWcDGHO5wN/ShadowFollower.js","https:/framerusercontent.com/modules/gOhsccODTCEKODfdKDTV/ySMVfBXz3FZfCAE70owo/siteMetadata.js","https:/framerusercontent.com/modules/avFYO7tQXKZA26RqJs8m/d92dIHCX15WCw67EfVsg/augiA20Il.js","https:/framerusercontent.com/modules/RBEfSbnZvuKUudLC1mX8/cA52Ks6eSnpN7l1QFMmL/l21V3vgtH.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{useMotionValue,useSpring,useTransform,useAnimationFrame}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";function ShadowFollower(props){const{image,isVideo,shadowColor,borderRadius,shadowOffset,shadowBlur,invertDirection,shadowSpeed}=props;const[orientationAlpha,setOrientationAlpha]=React.useState(1);const[showGyroButton,setShowGyroButton]=React.useState(false);const containerRef=React.useRef(null);const mouseX=useMotionValue(.5);const mouseY=useMotionValue(.5);const smoothX=useSpring(mouseX,{stiffness:shadowSpeed,damping:40});const smoothY=useSpring(mouseY,{stiffness:shadowSpeed,damping:40});const multiplier=invertDirection?-1:1;const shadowX=useTransform(smoothX,[0,1],[multiplier*-shadowOffset,multiplier*shadowOffset]);const shadowY=useTransform(smoothY,[0,1],[multiplier*-shadowOffset,multiplier*shadowOffset]);const distance=useTransform([smoothX,smoothY],([x,y])=>{const dx=x-.5;const dy=y-.5;return Math.sqrt(dx*dx+dy*dy);});const opacity=useTransform(distance,[0,.5],[0,1]);const[boxShadow,setBoxShadow]=React.useState(\"\");const[highlight,setHighlight]=React.useState(\"\");const handleOrientation=e=>{const gamma=e.gamma||0;const beta=e.beta||0;const normalizedGamma=Math.max(0,Math.min(1,(gamma+45)/90));const normalizedBeta=Math.max(0,Math.min(1,(beta-60)/60));mouseX.set(normalizedGamma);mouseY.set(normalizedBeta);const tilt=Math.sqrt(beta**2+gamma**2);setOrientationAlpha(Math.min(tilt/30,1));};useAnimationFrame(()=>{const x=shadowX.get().toFixed(1);const y=shadowY.get().toFixed(1);const alpha=opacity.get()*orientationAlpha;const match=shadowColor.match(/rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)/);const finalShadow=match?`rgba(${match[1]},${match[2]},${match[3]},${alpha.toFixed(2)})`:shadowColor;const highlightAlpha=(1-alpha).toFixed(2);setHighlight(`${-x}px ${-y}px ${shadowBlur*.5}px rgba(255,255,255,${highlightAlpha})`);setBoxShadow(`${x}px ${y}px ${shadowBlur}px ${finalShadow}`);});React.useEffect(()=>{const updateMouse=(x,y)=>{const bounds=containerRef.current?.getBoundingClientRect();if(!bounds)return;const px=(x-bounds.left)/bounds.width;const py=(y-bounds.top)/bounds.height;mouseX.set(Math.max(0,Math.min(1,px)));mouseY.set(Math.max(0,Math.min(1,py)));};const handleMouseMove=e=>updateMouse(e.clientX,e.clientY);const handleLeave=()=>{mouseX.set(.5);mouseY.set(.5);};if(/Mobi|Android/i.test(navigator.userAgent)){if(typeof DeviceOrientationEvent?.requestPermission===\"function\"){setShowGyroButton(true);}else{window.addEventListener(\"deviceorientation\",handleOrientation);}}else{document.addEventListener(\"mousemove\",handleMouseMove);document.addEventListener(\"mouseleave\",handleLeave);}return()=>{document.removeEventListener(\"mousemove\",handleMouseMove);document.removeEventListener(\"mouseleave\",handleLeave);window.removeEventListener(\"deviceorientation\",handleOrientation);};},[]);return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\"},children:[showGyroButton&&/*#__PURE__*/_jsx(\"button\",{onClick:async()=>{const res=await DeviceOrientationEvent.requestPermission();if(res===\"granted\"){window.addEventListener(\"deviceorientation\",handleOrientation);setShowGyroButton(false);}},style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",padding:\"8px 16px\",background:\"black\",color:\"white\",border:\"none\",borderRadius:8,zIndex:10,fontSize:14},children:\"Enable Gyroscope\"}),image?isVideo?/*#__PURE__*/_jsx(\"video\",{src:image,autoPlay:true,muted:true,loop:true,playsInline:true,style:{width:\"100%\",height:\"100%\",borderRadius,objectFit:\"cover\",boxShadow:`${boxShadow}, ${highlight}`,filter:\"blur(0.1px)\"}}):/*#__PURE__*/_jsx(\"img\",{src:image,alt:\"Media\",style:{width:\"100%\",height:\"100%\",borderRadius,objectFit:\"cover\",boxShadow:`${boxShadow}, ${highlight}`,filter:\"blur(0.1px)\"}}):/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",borderRadius,background:\"#ccc\",color:\"#555\",fontSize:14,fontFamily:\"sans-serif\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:`${boxShadow}, ${highlight}`},children:\"Set an image or video ↗️\"})]});}addPropertyControls(ShadowFollower,{image:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"png\",\"jpeg\",\"mp4\",\"webm\"],title:\"Media\"},isVideo:{type:ControlType.Boolean,title:\"Is Video\",defaultValue:false},shadowColor:{type:ControlType.Color,title:\"Shadow\",defaultValue:\"#3B3B3B\"},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:50,defaultValue:40},shadowOffset:{type:ControlType.Number,title:\"Shadow Offset\",min:0,max:100,defaultValue:50},shadowBlur:{type:ControlType.Number,title:\"Shadow Blur\",min:0,max:200,defaultValue:40},invertDirection:{type:ControlType.Boolean,title:\"Push Shadow\",defaultValue:true},shadowSpeed:{type:ControlType.Number,title:\"Shadow Speed\",min:10,max:300,defaultValue:150}});export default ShadowFollower;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShadowFollower\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShadowFollower.map","// Generated by Framer (e0edd7a)\nexport default function metadata(params,activeLocale){return{description:\"Framer component called Shadow Follower. It creates a dreamy soft-shadow that follows your mouse on desktop, and your phone’s gyroscope on mobile 🤯\",favicon:\"https://framerusercontent.com/assets/5zwepc0wULt604s2aNU5J4RL1M.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/RP7qkNp1dstIrR2HpibYUiup1M4.jpg\",title:\"Framer Shadow Follower - Memselon\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (571faa6)\nimport siteMetadata from\"https://framerusercontent.com/modules/gOhsccODTCEKODfdKDTV/ySMVfBXz3FZfCAE70owo/siteMetadata.js\";export default function metadata(params,activeLocale){return{breakpoints:[{hash:\"72rtr7\",mediaQuery:\"(min-width: 1200px)\"},{hash:\"1p07cc\",mediaQuery:\"(min-width: 810px) and (max-width: 1199.98px)\"},{hash:\"1qh1vbn\",mediaQuery:\"(max-width: 809.98px)\"}],description:siteMetadata(params,activeLocale).description,elements:{},framerSearch:{index:false},robots:\"max-image-preview:large\",serializationId:\"framer-y9ngi\",socialImage:\"https://framerusercontent.com/assets/RP7qkNp1dstIrR2HpibYUiup1M4.jpg\",title:siteMetadata(params,activeLocale).title||\"Home\",viewport:\"width=device-width\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (571faa6)\nimport siteMetadata from\"https://framerusercontent.com/modules/gOhsccODTCEKODfdKDTV/ySMVfBXz3FZfCAE70owo/siteMetadata.js\";export default function metadata(params,activeLocale){return{breakpoints:[{hash:\"rxgysc\",mediaQuery:\"(min-width: 1200px)\"},{hash:\"k7rr7l\",mediaQuery:\"(min-width: 810px) and (max-width: 1199.98px)\"},{hash:\"108hi22\",mediaQuery:\"(max-width: 809.98px)\"}],description:siteMetadata(params,activeLocale).description,elements:{},framerSearch:{index:false},robots:\"noindex\",serializationId:\"framer-t5M4T\",socialImage:\"https://framerusercontent.com/assets/RP7qkNp1dstIrR2HpibYUiup1M4.jpg\",title:siteMetadata(params,activeLocale).title||\"Player\",viewport:\"width=device-width\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"geAA4N,SAAS,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,cAAY,eAAa,eAAa,aAAW,kBAAgB,eAAa,EAAW,CAAC,EAAiB,GAAqBA,EAAe,EAAE,CAAM,CAAC,EAAe,GAAmBA,EAAe,GAAM,CAAO,EAAaC,EAAa,KAAK,CAAO,EAAO,EAAe,GAAG,CAAO,EAAO,EAAe,GAAG,CAAO,EAAQ,EAAU,EAAO,CAAC,UAAU,EAAY,QAAQ,GAAG,CAAC,CAAO,EAAQ,EAAU,EAAO,CAAC,UAAU,EAAY,QAAQ,GAAG,CAAC,CAAO,EAAW,EAAgB,GAAG,EAAQ,EAAQ,EAAa,EAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAW,CAAC,EAAa,EAAW,EAAa,CAAC,CAAO,EAAQ,EAAa,EAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAW,CAAC,EAAa,EAAW,EAAa,CAAC,CAAO,EAAS,EAAa,CAAC,EAAQ,EAAQ,EAAE,CAAC,EAAE,KA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