{"version":3,"file":"ShapeImage.DMd48aCH.mjs","names":["useRef","__esmMin","de","p","c","init_jsx_runtime","init_npm_react_18_3_1","useScroll","useTransform","init_framer_motion_DhsWWWsN","motion","useInView","addPropertyControls","RenderTarget","ControlType","init_framer_BL70qLPA","useIsStaticRenderer","clipFor","shape","roof","ShapeImage","props","ref","still","inView","y","scrollYProgress","src","image","alt","frame","radius","show","reveal","outline","outlineColor","parallax","curtain","init_ShapeImage"],"sources":["https:/framerusercontent.com/modules/wl9IJIv3EhFBDeIuvM6b/QyIemSQqRN7BUhB5MQE1/ShapeImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,useIsStaticRenderer}from\"framer\";import{motion,useInView,useScroll,useTransform}from\"framer-motion\";import{useRef}from\"react\";function clipFor(shape,roof){if(shape===\"house\")return`polygon(50% 0%, 100% ${roof}%, 100% 100%, 0% 100%, 0% ${roof}%)`;return undefined;}/**\n * Shape Image — a photo framed as a house gable, an arch, a door or a plain panel.\n * Reveals with a lifting curtain and drifts with scroll.\n *\n * @framerIntrinsicWidth 420\n * @framerIntrinsicHeight 540\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ShapeImage(props){const{image,shape=\"house\",roof=26,radius=4,curtain=\"#E8EAEB\",reveal=true,parallax=true,outline=true,outlineColor=\"rgba(19, 20, 21, 0.35)\"}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const still=isStatic||RenderTarget.current()===RenderTarget.canvas;const inView=useInView(ref,{once:true,amount:.3});const{scrollYProgress}=useScroll({target:ref,offset:[\"start end\",\"end start\"]});const y=useTransform(scrollYProgress,[0,1],[\"-6%\",\"6%\"]);const src=typeof image===\"string\"?image:image?.src;const alt=typeof image===\"string\"?\"\":image?.alt||\"\";const clip=clipFor(shape,roof);const br=shape===\"arch\"?\"2000px 2000px \"+radius+\"px \"+radius+\"px\":shape===\"door\"?\"2000px 2000px 0px 0px\":shape===\"rect\"?radius+\"px\":\"0px\";const frame={position:\"absolute\",inset:0,clipPath:clip,borderRadius:br,overflow:\"hidden\"};const show=still||!reveal||inView;return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:\"100%\",...props.style},children:[outline&&/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 100 100\",preserveAspectRatio:\"none\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",overflow:\"visible\",transform:\"translate(14px, -14px)\",pointerEvents:\"none\"},children:shape===\"house\"?/*#__PURE__*/_jsx(\"polygon\",{points:`50,0 100,${roof} 100,100 0,100 0,${roof}`,fill:\"none\",stroke:outlineColor,strokeWidth:\"1\",vectorEffect:\"non-scaling-stroke\",strokeDasharray:\"4 4\"}):/*#__PURE__*/_jsx(\"rect\",{x:\"0\",y:\"0\",width:\"100\",height:\"100\",fill:\"none\",stroke:outlineColor,strokeWidth:\"1\",vectorEffect:\"non-scaling-stroke\",strokeDasharray:\"4 4\"})}),/*#__PURE__*/_jsxs(\"div\",{style:frame,children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",inset:parallax&&!still?\"-8% 0%\":0,backgroundImage:src?`url(${src})`:undefined,backgroundColor:\"#C5CACE\",backgroundSize:\"cover\",backgroundPosition:\"center\",y:parallax&&!still?y:0},initial:false,animate:{scale:show?1:1.2},transition:{duration:1.6,ease:[.22,1,.36,1]},role:\"img\",\"aria-label\":alt}),reveal&&!still&&/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",inset:0,background:curtain,transformOrigin:\"50% 0%\"},initial:{scaleY:1},animate:{scaleY:inView?0:1},transition:{duration:1.2,ease:[.76,0,.24,1],delay:.1}})]})]});}addPropertyControls(ShapeImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},shape:{type:ControlType.Enum,title:\"Shape\",options:[\"house\",\"arch\",\"door\",\"rect\"],optionTitles:[\"House\",\"Arch\",\"Door\",\"Panel\"],defaultValue:\"house\"},roof:{type:ControlType.Number,title:\"Roof\",defaultValue:26,min:8,max:50,unit:\"%\",hidden:p=>p.shape!==\"house\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:4,min:0,max:40},curtain:{type:ControlType.Color,title:\"Curtain\",defaultValue:\"#E8EAEB\"},reveal:{type:ControlType.Boolean,title:\"Reveal\",defaultValue:true},parallax:{type:ControlType.Boolean,title:\"Parallax\",defaultValue:true},outline:{type:ControlType.Boolean,title:\"Outline\",defaultValue:true},outlineColor:{type:ControlType.Color,title:\"Outline Color\",defaultValue:\"rgba(19, 20, 21, 0.35)\",hidden:p=>!p.outline}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShapeImage\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"420\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"540\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShapeImage.map"],"mappings":"A,uQAA2O,SAASiB,EAAQ,EAAM,EAAK,CAAC,GAAGC,IAAQ,QAAQ,MAAM,wBAAwBC,EAAK,4BAA4BA,EAAK,GAAqB,CAQjX,SAAwBC,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,QAAQ,OAAK,GAAG,SAAO,EAAE,UAAQ,UAAU,SAAO,GAAK,WAAS,GAAK,UAAQ,GAAK,eAAa,0BAA0BC,EAAYC,EAAItB,EAAO,IAAI,EAA6CuB,EAA5BP,EAAyC,GAAGH,EAAa,QAAQ,IAAIA,EAAa,OAAaW,EAAOb,EAAUW,EAAI,CAAC,KAAK,GAAK,OAAO,EAAE,CAAC,EAAO,CAAC,mBAAiBf,EAAU,CAAC,OAAOe,EAAI,OAAO,CAAC,YAAY,WAAW,CAAC,CAAC,EAAQG,EAAEjB,EAAakB,EAAgB,CAAC,EAAE,CAAC,EAA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