{"version":3,"file":"Slider.DMYuJjc7.mjs","names":["useState","useRef","moveX"],"sources":["https:/framerusercontent.com/modules/ARha2oAvKrau1S2JYJFs/zn00nijxu04yV0QUXiV0/Slider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect}from\"react\";import{inView,motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Slider({imageOne,imageTwo,children}){// This is a React component containing an Example component\n// - Replace <Example /> with your own code\n// - Find inspiration: https://www.framer.com/developers/\nconst[leftInView,setLeftInView]=useState(false);const[rightInView,setRightInView]=useState(false);const[moveX,setMoveX]=useState(0);const[isMobile,setIsMobile]=useState(false);const refLeft=useRef(null);const refRight=useRef(null);function handleLeftClick(){setMoveX(moveX=>moveX+400);setRightInView(false);}function handleRightClick(){setMoveX(moveX=>moveX-400);setLeftInView(false);}useEffect(function(){inView(refLeft.current,()=>{setLeftInView(true);});inView(refRight.current,()=>{setRightInView(true);});const mobile=window.innerWidth<900;if(mobile){setIsMobile(true);}else{setIsMobile(false);}},[leftInView,rightInView,inView,moveX,setIsMobile]);return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[!isMobile&&/*#__PURE__*/_jsx(Button,{image:imageOne,isInView:leftInView,onClick:handleLeftClick}),/*#__PURE__*/_jsx(\"div\",{style:isMobile?silderStyleMobile:silderStyle,children:/*#__PURE__*/_jsxs(motion.div,{animate:{x:moveX},transition:{type:\"srping\",damping:\"900\",duration:.7},style:sliderContainer,children:[/*#__PURE__*/_jsx(\"div\",{style:sliderEmptyBlock,ref:refLeft}),children,/*#__PURE__*/_jsx(\"div\",{style:sliderEmptyBlock,ref:refRight})]})}),!isMobile&&/*#__PURE__*/_jsx(Button,{image:imageTwo,isInView:rightInView,onClick:handleRightClick})]});}function Button({image,isInView,onClick}){const[mouseEnter,setMouseEnter]=useState(false);function handleHoverIn(){setMouseEnter(true);}function handleHoverOut(){setMouseEnter(false);}return /*#__PURE__*/_jsx(\"button\",{onClick:onClick,disabled:isInView,style:!mouseEnter?buttonStyle:buttonStyleHover,onMouseEnter:handleHoverIn,onMouseLeave:handleHoverOut,children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:isInView?imageStyleDisabled:imageStyle})});}// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle={width:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",paddingTop:\"20px\",paddingBottom:\"20px\",overflow:\"hidden\",gap:\"0px\"};const silderStyle={width:\"100%\",display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",gap:\"0px\",overflow:\"hidden\",paddingTop:\"20px\",paddingBottom:\"20px\"};const silderStyleMobile={width:\"100%\",display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",gap:\"0px\",overflow:\"auto\",paddingTop:\"20px\",paddingBottom:\"20px\"};const sliderContainer={display:\"flex\",justifyContent:\"flex-start\",alignItems:\"center\",wrap:\"now-rap\",width:\"fit-content\",height:\"fit-content\",gap:\"0px\",minWdith:\"100px\",touchAction:\"pan-x pan-y\"};const sliderEmptyBlock={width:\"2px\",height:\"20px\",border:\"none\"};const buttonStyle={width:\"60px\",height:\"60px\",backgroundColor:\"transparent\",border:\"none\",transition:\"transform .3s\"};const buttonStyleHover={width:\"60px\",height:\"60px\",backgroundColor:\"transparent\",border:\"none\",transform:\"scale(0.9)\",transition:\"transform .3s\"};const imageStyle={width:\"100%\",objectFit:\"cover\",cursor:\"pointer\"};const imageStyleDisabled={width:\"100%\",objectFit:\"cover\",filter:\"greyscale(1)\",cursor:\"not-allowed\",opacity:\"0.6\"};addPropertyControls(Slider,{imageOne:{type:ControlType.ResponsiveImage,defaultValue:\"\"},imageTwo:{type:ControlType.ResponsiveImage,defaultValue:\"\"},children:{type:ControlType.ComponentInstance}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Slider\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Slider.map"],"mappings":"6ZAMG,SAAwB,EAAO,CAAC,WAAS,WAAS,YAAU,CAG/D,GAAK,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAO,EAAQC,EAAO,KAAK,CAAO,EAASA,EAAO,KAAK,CAAC,SAAS,GAAiB,CAAC,EAAS,GAAOC,EAAM,IAAI,CAAC,EAAe,GAAM,CAAE,SAAS,GAAkB,CAAC,EAAS,GAAOA,EAAM,IAAI,CAAC,EAAc,GAAM,CAA8Q,OAA5Q,EAAU,UAAU,CAAC,EAAO,EAAQ,YAAY,CAAC,EAAc,GAAK,EAAG,CAAC,EAAO,EAAS,YAAY,CAAC,EAAe,GAAK,EAAG,CAAc,EAAO,WAAW,IAAe,EAAY,GAAK,CAAO,EAAY,GAAM,EAAI,CAAC,EAAW,EAAY,EAAO,EAAM,EAAY,CAAC,CAAqB,EAAM,MAAM,CAAC,MAAM,EAAe,SAAS,CAAC,CAAC,GAAuB,EAAK,EAAO,CAAC,MAAM,EAAS,SAAS,EAAW,QAAQ,EAAgB,CAAC,CAAc,EAAK,MAAM,CAAC,MAAM,EAAS,EAAkB,EAAY,SAAsB,EAAM,EAAO,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAM,CAAC,WAAW,CAAC,KAAK,SAAS,QAAQ,MAAM,SAAS,GAAG,CAAC,MAAM,EAAgB,SAAS,CAAc,EAAK,MAAM,CAAC,MAAM,EAAiB,IAAI,EAAQ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