{"version":3,"file":"Flip.BTWyyL3j.mjs","names":["Children"],"sources":["https:/framerusercontent.com/modules/bmv0hIBfDZtANPW07xgp/yQocToPi6O0X9bugXhZb/Flip.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";import{Children,cloneElement}from\"react\";/**\n *\n * FLIP\n * By Benjamin\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n *\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */ export default function Flip(props){var ref,ref1;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const hasChildren=Children.count(props.children)>0;const hasOneChild=Children.count(props.children)===1;const variants={initial:{rotateY:0},hover:{rotateY:180}};/* Empty state */ if(!hasChildren){return /*#__PURE__*/ _jsxs(\"section\",{style:placeholderStyles,children:[/*#__PURE__*/ _jsx(\"div\",{style:emojiStyles,children:\"☂️\"}),/*#__PURE__*/ _jsx(\"p\",{style:titleStyles,children:\"Connect to Content\"}),/*#__PURE__*/ _jsx(\"p\",{style:subtitleStyles,children:\"Add two layers to flip between on hover.\"})]});}if(hasOneChild){return /*#__PURE__*/ _jsxs(\"section\",{style:placeholderStyles,children:[/*#__PURE__*/ _jsx(\"div\",{style:emojiStyles,children:\"✅\"}),/*#__PURE__*/ _jsx(\"p\",{style:titleStyles,children:\"One more!\"}),/*#__PURE__*/ _jsx(\"p\",{style:subtitleStyles,children:\"Add two layers to flip between on hover.\"})]});}return /*#__PURE__*/ _jsx(motion.div,{style:{width:\"100%\",height:\"100%\",position:\"relative\",perspective:1200,...props.style},whileHover:\"hover\",children:/*#__PURE__*/ _jsxs(motion.div,{style:{width:\"100%\",height:\"100%\",position:\"absolute\",userSelect:\"none\",transformStyle:\"preserve-3d\"},variants:variants,transition:props.hoverTransition,children:[/*#__PURE__*/ _jsx(\"div\",{style:{...childStyles},children:/*#__PURE__*/ cloneElement(props.children[0],{...props.children[0].props,style:{...(ref=props.children[0].props)===null||ref===void 0?void 0:ref.style,width:\"100%\",height:\"100%\"}})}),/*#__PURE__*/ _jsx(\"div\",{style:{...childStyles,transform:\"rotateY(180deg)\"},children:/*#__PURE__*/ cloneElement(props.children[1],{...props.children[1].props,style:{...(ref1=props.children[1].props)===null||ref1===void 0?void 0:ref1.style,width:\"100%\",height:\"100%\"}})})]})});};Flip.displayName=\"Flip\";addPropertyControls(Flip,{children:{type:ControlType.Array,title:\"Content\",control:{type:ControlType.ComponentInstance},maxCount:2},hoverTransition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{spring:350,damping:30}}});const childStyles={width:\"100%\",height:\"100%\",position:\"absolute\",backfaceVisibility:\"hidden\"};/* Placeholder Styles */ const placeholderStyles={display:\"flex\",width:\"100%\",height:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",color:\"#96F\",background:\"rgba(136, 85, 255, 0.1)\",fontSize:11,overflow:\"hidden\",padding:\"20px 20px 30px 20px\"};const emojiStyles={fontSize:32,marginBottom:10};const titleStyles={margin:0,marginBottom:10,fontWeight:600,textAlign:\"center\"};const subtitleStyles={margin:0,opacity:.7,maxWidth:120,lineHeight:1.5,textAlign:\"center\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Flip\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Flip.map"],"mappings":"gPAYI,SAAwB,EAAK,EAAM,CAA6B,EAAa,SAAS,CAAG,EAAa,OAAO,IAAM,EAAYA,EAAS,MAAM,EAAM,SAAS,CAAC,EAAQ,EAAYA,EAAS,MAAM,EAAM,SA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