{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/89cSFglclNracpvIBq8W/PfOOebVVwxtfLObxj7Fh/HorizontalScroll.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useState,useLayoutEffect}from\"react\";import{motion,useTransform,useScroll}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function HorizontalScroll(props){const{items,backgroundColor}=props;const targetRef=useRef(null);const contentRef=useRef(null);const[offset,setOffset]=useState(0);const{scrollYProgress}=useScroll({target:targetRef});useLayoutEffect(()=>{if(!contentRef.current||!window)return;const contentWidth=contentRef.current.scrollWidth;const viewportWidth=window.innerWidth;const distance=contentWidth-viewportWidth;setOffset(-distance);},[items]);const x=useTransform(scrollYProgress,[0,1],[\"0px\",`${offset}px`]);return /*#__PURE__*/_jsx(\"section\",{ref:targetRef,style:{height:\"100%\",backgroundColor},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"sticky\",top:0,left:0,right:0,display:\"flex\",height:\"100vh\",alignItems:\"center\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(motion.div,{ref:contentRef,style:{x,display:\"flex\"},children:items.map((item,index)=>/*#__PURE__*/_jsx(\"div\",{style:{flexShrink:0,height:\"100vh\"},children:item},index))})})});}HorizontalScroll.displayName=\"Horizontal Scroll\";addPropertyControls(HorizontalScroll,{items:{type:ControlType.Array,control:{type:ControlType.ComponentInstance}},backgroundColor:{type:ControlType.Color,title:\"Background Color\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HorizontalScroll\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HorizontalScroll.map"],
  "mappings": "4KAGkB,SAARA,EAAkCC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props", "items", "backgroundColor", "targetRef", "pe", "contentRef", "offset", "setOffset", "ye", "scrollYProgress", "useScroll", "fe", "window", "contentWidth", "viewportWidth", "distance", "x", "useTransform", "p", "motion", "item", "index", "addPropertyControls", "ControlType"]
}
