{"version":3,"file":"ImageAppearScroll.QEo5L0Yv.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","_e","de","motion","useMotionValue","useScroll","useMotionValueEvent","init_framer_motion_DhsWWWsN","init_framer_Bf4_tcb2","addPropertyControls","ControlType","ScrollDirectionClipPath","lastScrollY","animationDirection","realTimeDirection","forceUpdate","scrollY","diff","latest","isVisible","radius","currentDir","easing","delay","image","init_ImageAppearScroll"],"sources":["https:/framerusercontent.com/modules/WpvmDz7w5r6lVYS9tDEt/URdbjTgHT5ExxxUSa0Qt/ImageAppearScroll.js"],"sourcesContent":["/**\n * @framerDisableUnlink\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{motion,useScroll,useMotionValueEvent,useMotionValue}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useEffect,useState}from\"react\";export default function ScrollDirectionClipPath({image,radius,duration,easing,delay,isVisible}){const{scrollY}=useScroll();const lastScrollY=useRef(0);const animationDirection=useMotionValue(\"down\");const realTimeDirection=useRef(\"down\");const[,forceUpdate]=useState([]);useMotionValueEvent(scrollY,\"change\",latest=>{const diff=latest-lastScrollY.current;if(Math.abs(diff)<2)return;realTimeDirection.current=diff>0?\"down\":\"up\";lastScrollY.current=latest;});useEffect(()=>{animationDirection.set(realTimeDirection.current);forceUpdate([]);},[isVisible]);const getAnimation=()=>{const currentDir=animationDirection.get();if(isVisible){return currentDir===\"down\"?{clipPath:[\"polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)\",\"polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)\"]}:{clipPath:[\"polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%)\",\"polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)\"]};}else{return currentDir===\"down\"?{clipPath:[\"polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)\",\"polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%)\"]}:{clipPath:[\"polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)\",\"polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)\"]};}};return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:radius,backgroundColor:\"transparent\"},children:/*#__PURE__*/_jsx(motion.div,{initial:false,animate:getAnimation(),transition:{duration:duration,ease:easing,delay:delay*.1},style:{width:\"100%\",height:\"100%\",backgroundImage:image?`url(${image})`:\"none\",backgroundSize:\"cover\",backgroundPosition:\"center\",willChange:\"clip-path\",transform:\"translateZ(0)\",WebkitTransform:\"translateZ(0)\"}})});}addPropertyControls(ScrollDirectionClipPath,{image:{type:ControlType.Image,title:\"Image\"},isVisible:{type:ControlType.Boolean,title:\"Visible\",defaultValue:true},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.8},delay:{type:ControlType.Number,title:\"Delay * 0.1\",defaultValue:0},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"easeOut\",\"easeIn\",\"easeInOut\",\"circOut\",\"linear\"],defaultValue:\"easeInOut\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollDirectionClipPath\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageAppearScroll.map"],"mappings":"A,8PAE8N,SAAwBiB,EAAwB,CAAC,QAAM,SAAO,WAAS,SAAO,QAAM,aAAW,CAAC,GAAK,CAAC,WAASN,EAAU,EAAQO,EAAYlB,EAAO,CAAC,EAAQmB,EAAmBT,EAAe,MAAM,EAAQU,EAAkBpB,EAAO,MAAM,EAAO,EAAEqB,GAAapB,EAAS,CAAC,CAAC,EAA+0B,OAA70BW,EAAoBU,EAAQ,SAAS,GAAQ,CAAC,IAAMC,EAAKC,EAAON,EAAY,QAAW,KAAK,IAAIK,CAAI,EAAE,IAAS,EAAkB,QAAQ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