{"version":3,"file":"Hover3D_Prod.DH-RvIXy.mjs","names":["useStore"],"sources":["https:/framer.com/m/framer/store.js@^1.0.0","https:/framer.com/m/Utils-QTIc.js@hDBsItohjMEOACix8wDv","https:/framerusercontent.com/modules/5iVhojCo17A7sAu0ue9z/C2y0irNf7hRmU1AVIALB/Hover3D_Prod.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";export const updateChildren=(children,properties)=>{return[{...children,props:{...children.props,children:{...children.props.children,props:{...children.props.children.props,children:{...children.props.children.props.children,props:{...children.props.children.props.children.props,...properties}}}}}}];};export const SettingsMessage=({title,description,containerStyle})=>{return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",textAlign:\"center\",justifyContent:\"center\",backgroundColor:\"rgba(136, 85, 255, 0.1)\",overflow:\"hidden\",...containerStyle},children:[/*#__PURE__*/_jsx(\"span\",{role:\"img\",\"aria-label\":\"icon\",style:{fontSize:\"32px\"},children:\"✨\"}),/*#__PURE__*/_jsxs(\"div\",{style:{maxWidth:\"240px\"},children:[/*#__PURE__*/_jsx(\"h1\",{style:{fontSize:11,color:\"#96F\",fontWeight:600},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{fontSize:11,color:\"rgba(153, 102, 255, 0.7)\",lineHeight:1.5},children:description})]})]});};export const getBorder=border=>{if(!border)return{border:\"none\"};const{width,color,style}=border;return{borderWidth:width,borderColor:color,borderStyle:style};};export const borderProperty=(title=\"Border\",width=\"0px\",color=\"#fff\")=>({title,type:ControlType.Object,controls:{width:{title:\"Width\",type:ControlType.Padding,defaultValue:width},color:{title:\"Color\",type:ControlType.Color,defaultValue:color},style:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}});export const getBoxShadow=property=>{const{x,y,blur,color}=property.shadow;return`${x}px ${y}px ${blur}px ${color}`;};export const shadowProperty={type:ControlType.Object,controls:{color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#bfbfbf\"},x:{title:\"X\",type:ControlType.Number,defaultValue:0,min:-100,max:100},y:{title:\"Y\",type:ControlType.Number,defaultValue:0,min:-100,max:100},blur:{title:\"Blur\",type:ControlType.Number,defaultValue:0,min:0,max:100}}};export const heightProperty={height:{type:ControlType.Enum,defaultValue:\"auto\",displaySegmentedControl:true,options:[\"auto\",\"fixed\"],optionTitles:[\"Auto\",\"Fixed\"]},heightNumber:{title:\" \",type:ControlType.Number,defaultValue:50,hidden(props){return props.height===\"auto\";}}};export const getHeight=property=>{if(property.height===\"auto\"){return property.height;}else{return`${property.heightNumber}px`;}};export const getPageQueryParam=()=>{const urlParams=new URLSearchParams(window.location.search);const pageParam=urlParams.get(\"page\");return pageParam?parseInt(pageParam,10):1;};export const updatePageQueryParam=newPage=>{const url=new URL(window.location.href);url.searchParams.set(\"page\",newPage);window.history.replaceState({},\"\",url.toString());};export const useStore=createStore({initialLimit:undefined,initialOffset:undefined,limit:undefined,offset:undefined,totalItems:undefined,page:1,searchQuery:\"\",totalPages:undefined});export const scrollToTop=(withScroll,scrollTop,scrollBehavior)=>{if(withScroll){window.scrollTo({top:scrollTop,behavior:scrollBehavior});}};\nexport const __FramerMetadata__ = {\"exports\":{\"heightProperty\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"updatePageQueryParam\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getHeight\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getBoxShadow\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"updateChildren\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"borderProperty\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shadowProperty\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getBorder\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SettingsMessage\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getPageQueryParam\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"scrollToTop\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Utils.map","import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useMotionValue}from\"framer-motion\";import{SettingsMessage}from\"https://framer.com/m/Utils-QTIc.js@hDBsItohjMEOACix8wDv\";/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-auto\n * @framerSupportedLayoutHeight any-prefer-auto\n */export default function Hover3D(props){const ref=React.useRef(null);const rotateX=useMotionValue(0);const rotateY=useMotionValue(0);React.useEffect(()=>{if(ref.current){ref.current.style.transform=`perspective(${props.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`;}},[props.perspective]);function debounce(func,wait){let timeout;return function executedFunction(...args){const later=()=>{clearTimeout(timeout);func(...args);};clearTimeout(timeout);timeout=setTimeout(later,wait);};}const handleMouseMove=React.useCallback(debounce(e=>{const{width,height,top,left}=ref.current.getBoundingClientRect();const multiplier=props.effect===\"evade\"?-1:1;const tiltX=((e.clientY-top)/height-.5)*(props.tiltLimit*2)*multiplier;const tiltY=((e.clientX-left)/width-.5)*-(props.tiltLimit*2)*multiplier;rotateX.set(tiltX);rotateY.set(tiltY);ref.current.style.transform=`perspective(${props.perspective}px) rotateX(${tiltX}deg) rotateY(${tiltY}deg) scale3d(${props.scale}, ${props.scale}, ${props.scale})`;},2),[props.tiltLimit,props.scale,props.perspective,props.effect]);const handleMouseLeave=()=>{if(ref.current){rotateX.set(0);rotateY.set(0);ref.current.style.transform=`perspective(${props.perspective}px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)`;}};if(React.Children.count(props.children)===0){return /*#__PURE__*/_jsx(SettingsMessage,{title:\"Set Up the Component\",description:\"Connect a frame to the component.\",containerStyle:{...props.style,width:\"400px\",height:\"200px\"}});}return /*#__PURE__*/_jsx(\"div\",{ref:ref,onMouseMove:handleMouseMove,onMouseLeave:handleMouseLeave,style:{width:\"100%\",height:\"100%\",transition:\"transform 0.2s ease-out\",position:\"relative\",overflow:\"visible\",borderRadius:props.borderRadius,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",willChange:\"transform\"},children:props.children});}Hover3D.displayName=\"3D Hover\";Hover3D.defaultProps={tiltLimit:15,effect:\"evade\",scale:1.1,perspective:500,borderRadius:0};addPropertyControls(Hover3D,{children:{type:ControlType.ComponentInstance,title:\"Frame\"},effect:{type:ControlType.Enum,title:\"Effect\",options:[\"gravitate\",\"evade\"],optionTitles:[\"Gravitate\",\"Evade\"],defaultValue:\"evade\",displaySegmentedControl:true},tiltLimit:{type:ControlType.Number,title:\"Tilt Limit\",min:1,max:100,step:1,defaultValue:15,displayStepper:true},scale:{type:ControlType.Number,title:\"Scale\",min:1,max:10,step:.1,defaultValue:1.1,displayStepper:true},perspective:{type:ControlType.Number,title:\"Perspective\",min:500,max:5e3,step:10,defaultValue:500},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:1e3,step:1,defaultValue:0,displayStepper:true,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Hover3D\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-auto\",\"framerIntrinsicHeight\":\"200\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Hover3D_Prod.map"],"mappings":"0bAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,CAAO,EAAC,AAAC,EAAC,CAClD,EAAa,GAAU,CACwC,OAA3D,GAAW,aAAY,EAAS,EAAS,EAA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