{"version":3,"file":"Flip.B3BTARYy.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,QAAQ,EAAI,EAAa,OAAO,IAAM,EAAYA,EAAS,MAAM,EAAM,QAAQ,EAAE,EAAQ,EAAYA,EAAS,MAAM,EAAM,Q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