{"version":3,"file":"ImageRevealMask.53_cP7FH.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/jPHO3Q860XYWaDLDWS0T/hUZC8yVnUvII6s4JJSK6/ImageRevealMask.js"],"sourcesContent":["// Image reveal mask effect with flat overlay that scales away to uncover the image\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";import{useRef,useState,useEffect,startTransition}from\"react\";/**\n * Image Reveal Mask\n * \n * A flat mask-reveal effect where a solid overlay scales away to uncover the image.\n * Supports multiple directions, triggers, and easing options.\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageRevealMask(props){const{contentType=\"Image\",image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},backgroundColor=\"#0099FF\",alt=\"\",duration=.8,delay=0,maskColor=\"#ffffff\",direction=\"Left→Right\",ease=\"Ease Out\",customCurve=\"\",trigger=\"Auto\",once=true,onComplete,borderRadius=0,style}=props;const isStatic=useIsStaticRenderer();// Determine axis and transform origin\nconst isHorizontal=direction===\"Left→Right\"||direction===\"Right→Left\";const hidden=isHorizontal?{scaleX:1}:{scaleY:1};const reveal=isHorizontal?{scaleX:0}:{scaleY:0};const origin=direction===\"Left→Right\"?\"left center\":direction===\"Right→Left\"?\"right center\":direction===\"Top→Bottom\"?\"top center\":\"bottom center\";// Easing configuration\nconst easeMap={\"Linear\":\"linear\",\"Ease In\":\"easeIn\",\"Ease Out\":\"easeOut\",\"Ease In-Out\":\"easeInOut\",\"Circ Out\":\"circOut\",\"Back Out\":\"backOut\",\"Anticipate\":\"anticipate\",\"Expo Out\":[.16,1,.3,1],\"Sine Out\":[.39,.575,.565,1],\"Custom\":customCurve?customCurve.split(\",\").map(n=>parseFloat(n.trim())):\"easeOut\"};// Animation variants\nconst variants={hidden,reveal:{...reveal,transition:{duration,delay,ease:easeMap[ease]}}};// Trigger handling\nconst containerRef=useRef(null);const inView=useInView(containerRef,{once});const[animState,setAnimState]=useState(trigger===\"Auto\"?\"reveal\":\"hidden\");useEffect(()=>{if(trigger===\"In View\"&&inView){startTransition(()=>setAnimState(\"reveal\"));}},[trigger,inView]);useEffect(()=>{if(animState===\"reveal\"&&onComplete){const timer=setTimeout(()=>{onComplete();},(duration+delay)*1e3);return()=>clearTimeout(timer);}},[animState,onComplete,duration,delay]);// Interactive props for hover/tap\nconst interactiveProps=trigger===\"Hover\"||trigger===\"Tap\"?{initial:isStatic?\"reveal\":\"hidden\",whileHover:trigger===\"Hover\"?\"reveal\":undefined,whileTap:trigger===\"Tap\"?\"reveal\":undefined}:{initial:isStatic?\"reveal\":\"hidden\",animate:isStatic?\"reveal\":animState};// Robust image source handling\nconst imgSrc=typeof image===\"string\"?image:image?.src;return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:`${borderRadius}px`,...style},children:[contentType===\"Image\"?/*#__PURE__*/_jsx(\"img\",{src:imgSrc,alt:alt||image?.alt||\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",borderRadius:`${borderRadius}px`}}):/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,borderRadius:`${borderRadius}px`}}),/*#__PURE__*/_jsx(motion.div,{variants:variants,...interactiveProps,style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,backgroundColor:maskColor,transformOrigin:origin,borderRadius:`${borderRadius}px`}})]});}addPropertyControls(ImageRevealMask,{contentType:{type:ControlType.Enum,title:\"Content Type\",defaultValue:\"Image\",options:[\"Image\",\"Color\"],displaySegmentedControl:true},image:{type:ControlType.ResponsiveImage,title:\"Image\",hidden:({contentType})=>contentType!==\"Image\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#0099FF\",hidden:({contentType})=>contentType!==\"Color\"},alt:{type:ControlType.String,title:\"Alt Text\",defaultValue:\"\",hidden:({contentType})=>contentType!==\"Image\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.8,min:0,max:5,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:5,step:.1,unit:\"s\"},maskColor:{type:ControlType.Color,title:\"Mask Color\",defaultValue:\"#ffffff\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"Left→Right\",options:[\"Left→Right\",\"Right→Left\",\"Top→Bottom\",\"Bottom→Top\"],optionTitles:[\"→\",\"←\",\"↓\",\"↑\"],displaySegmentedControl:true},ease:{type:ControlType.Enum,title:\"Easing\",defaultValue:\"Ease Out\",options:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In-Out\",\"Circ Out\",\"Back Out\",\"Anticipate\",\"Expo Out\",\"Sine Out\",\"Custom\"]},customCurve:{type:ControlType.String,title:\"Custom Bezier\",defaultValue:\"\",placeholder:\"0.33, 1, 0.68, 1\",hidden:({ease})=>ease!==\"Custom\"},trigger:{type:ControlType.Enum,title:\"Trigger\",defaultValue:\"Auto\",options:[\"Auto\",\"In View\",\"Hover\",\"Tap\"]},once:{type:ControlType.Boolean,title:\"Only Once\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\",hidden:({trigger})=>trigger!==\"In View\"},onComplete:{type:ControlType.EventHandler,title:\"On Complete\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:0,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageRevealMask\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"320\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\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