{"version":3,"file":"Parallax_Image.BrWHPiQB.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/6G8FS9PeapSJIyuWLhrz/nBAAXZ2DUnriZkMJ2elx/Parallax_Image.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef}from\"react\";import{motion,useTransform,useScroll}from\"framer-motion\";/**\n * ImageParallax Component\n *\n * A Framer component that creates vertical parallax effects for images.\n * Features:\n * - Vertical parallax effect based on scroll position\n * - Configurable parallax amount and smoothing\n * - Image alignment controls\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n *\n */export default function ImageParallax(props){const{verticalParallaxAmount,image,imageAlignmentX,imageAlignmentY,transitionDuration,smoothingEnabled,style}=props;// Reference to the container element for position calculations\nconst containerRef=useRef(null);// Track vertical scroll progress using Framer Motion's useScroll\n// offset: [\"start end\", \"end start\"] means the effect runs from when the element's\n// top edge enters the bottom of the viewport until its bottom edge leaves the top\nconst{scrollYProgress}=useScroll({target:containerRef,offset:[\"start end\",\"end start\"]});// Transform scroll progress (0-1) to y-position movement\nconst y=useTransform(scrollYProgress,[0,1],[0,verticalParallaxAmount]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,position:\"relative\",overflow:\"hidden\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",// Extend beyond boundaries to allow room for vertical parallax movement\ntop:verticalParallaxAmount<0?0:-Math.abs(verticalParallaxAmount),left:0,right:0,bottom:verticalParallaxAmount>0?0:-Math.abs(verticalParallaxAmount),// Apply vertical transformation for parallax effect\ny:y,// Add spring physics for smoothing if enabled\ntransition:smoothingEnabled?{type:\"spring\",stiffness:400,damping:40}:undefined,backgroundImage:image?`url(${image})`:undefined,backgroundSize:\"cover\",backgroundPosition:`${imageAlignmentX} ${imageAlignmentY}`,// Optimize rendering performance\nwillChange:\"transform\",// Prevent text selection and mouse interactions with the parallax layer\nuserSelect:\"none\",pointerEvents:\"none\"}})});}// Default props with descriptive values\nImageParallax.defaultProps={verticalParallaxAmount:264,imageAlignmentX:\"center\",imageAlignmentY:\"center\",smoothingEnabled:false};// Property controls with descriptive tooltips and appropriate ranges\naddPropertyControls(ImageParallax,{image:{type:ControlType.Image,title:\"Image\",description:\"Background image for parallax effect\"},// Image alignment controls\nimageAlignmentX:{type:ControlType.Enum,title:\"Horizontal Alignment\",defaultValue:\"center\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],description:\"Horizontal alignment of the background image\"},imageAlignmentY:{type:ControlType.Enum,title:\"Vertical Alignment\",defaultValue:\"center\",options:[\"top\",\"center\",\"bottom\"],optionTitles:[\"Top\",\"Center\",\"Bottom\"],description:\"Vertical alignment of the background image\"},// Vertical parallax controls\nverticalParallaxAmount:{type:ControlType.Number,title:\"Vertical Parallax\",defaultValue:264,step:10,displayStepper:true,description:\"Amount of vertical movement in pixels. Positive values move down, negative values move up.\"},// Smoothing controls\nsmoothingEnabled:{type:ControlType.Boolean,title:\"Enable Smoothing\",defaultValue:false,description:\"Apply easing to parallax movement (may reduce performance on some devices)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageParallax\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Parallax_Image.map"],"mappings":"0OAaG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,yBAAuB,QAAM,kBAAgB,kBAAgB,qBAAmB,mBAAiB,SAAO,EACxJ,EAAaA,EAAO,KAAK,CAG1B,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAa,OAAO,CAAC,YAAY,YAAY,CAAC,CAAC,CAClF,EAAE,EAAa,EAAgB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