{"version":3,"file":"ParallaxSlideshow.mT5-eD2D.mjs","names":["useState","useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/voFy6WBXLBxnyGWllHdF/nwBpVkr54AL8z22zEMcc/ParallaxSlideshow.js"],"sourcesContent":["// Parallax Slideshow component with configurable parallax offsets and global scale\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef,useCallback,startTransition}from\"react\";import{motion,useScroll,useTransform,useInView}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Parallax Slideshow component with configurable parallax effects and slideshow controls\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ParallaxSlideshow(props){const{slides=[{image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"}},{image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\"}}],slideDuration=3e3,fadeDuration=500,randomOrder=false,autoplay=true,fadeStyle=\"direct\",timingOffset=0,startVerticalOffset=-100,endVerticalOffset=100,globalScale=1,tintColor=\"#FFFFFF\",tintAmount=30,brightness=100,blur=0,saturation=100}=props;const[currentSlide,setCurrentSlide]=useState(0);const[slideOrder,setSlideOrder]=useState([]);const[isTransitioning,setIsTransitioning]=useState(false);const containerRef=useRef(null);const isStatic=useIsStaticRenderer();const isInView=useInView(containerRef,{once:false,margin:\"0px 0px -50% 0px\"});// Parallax scroll tracking\nconst{scrollYProgress}=useScroll({target:containerRef,offset:[\"start end\",\"end start\"]});// Transform scroll progress to vertical offset\nconst yOffset=useTransform(scrollYProgress,[0,1],[startVerticalOffset*globalScale,endVerticalOffset*globalScale]);// Initialize slide order\nuseEffect(()=>{if(slides.length===0)return;const order=Array.from({length:slides.length},(_,i)=>i);if(randomOrder){for(let i=order.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[order[i],order[j]]=[order[j],order[i]];}}startTransition(()=>setSlideOrder(order));},[slides.length,randomOrder]);// Auto-advance slides\nuseEffect(()=>{if(isStatic||!autoplay||!isInView||slideOrder.length===0)return;const timer=setTimeout(()=>{startTransition(()=>{setIsTransitioning(true);setTimeout(()=>{setCurrentSlide(prev=>(prev+1)%slideOrder.length);setIsTransitioning(false);},fadeDuration/2);});},slideDuration+timingOffset);return()=>clearTimeout(timer);},[currentSlide,autoplay,slideDuration,timingOffset,fadeDuration,slideOrder.length,isInView,isStatic]);const getCurrentSlideIndex=useCallback(()=>{if(slideOrder.length===0)return 0;return slideOrder[currentSlide];},[slideOrder,currentSlide]);const getNextSlideIndex=useCallback(()=>{if(slideOrder.length===0)return 0;const nextIndex=(currentSlide+1)%slideOrder.length;return slideOrder[nextIndex];},[slideOrder,currentSlide]);if(slides.length===0){return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"#f0f0f0\",color:\"#666\",fontSize:\"16px\"},children:\"No slides available\"});}const currentSlideData=slides[getCurrentSlideIndex()];const nextSlideData=slides[getNextSlideIndex()];// Create filter styles\nconst filterStyle=`brightness(${brightness}%) blur(${blur}px) saturate(${saturation}%)`;const tintOverlayStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:tintColor,mixBlendMode:\"overlay\",opacity:tintAmount/100,pointerEvents:\"none\"};return /*#__PURE__*/_jsxs(motion.div,{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",y:isStatic?0:yOffset,scale:globalScale},children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundImage:`url(${currentSlideData?.image.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",backgroundRepeat:\"no-repeat\",filter:filterStyle},initial:{opacity:1},animate:{opacity:isTransitioning?fadeStyle===\"toBlack\"?0:0:1},transition:{duration:fadeDuration/1e3,ease:\"easeInOut\"},\"aria-label\":currentSlideData?.image.alt,role:\"img\"},`current-${getCurrentSlideIndex()}`),/*#__PURE__*/_jsx(motion.div,{style:tintOverlayStyle,initial:{opacity:tintAmount/100},animate:{opacity:isTransitioning?fadeStyle===\"toBlack\"?0:0:tintAmount/100},transition:{duration:fadeDuration/1e3,ease:\"easeInOut\"}}),fadeStyle===\"toBlack\"&&/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:\"#000000\",zIndex:1},initial:{opacity:0},animate:{opacity:isTransitioning?1:0},transition:{duration:fadeDuration/2e3,ease:\"easeInOut\"}}),fadeStyle===\"direct\"&&nextSlideData&&/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundImage:`url(${nextSlideData.image.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\",backgroundRepeat:\"no-repeat\",zIndex:1,filter:filterStyle},initial:{opacity:0},animate:{opacity:isTransitioning?1:0},transition:{duration:fadeDuration/1e3,ease:\"easeInOut\"},\"aria-label\":nextSlideData.image.alt,role:\"img\",children:/*#__PURE__*/_jsx(\"div\",{style:tintOverlayStyle})},`next-${getNextSlideIndex()}`)]});}addPropertyControls(ParallaxSlideshow,{slides:{type:ControlType.Array,title:\"Slides\",control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Image\"}}},defaultValue:[{image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"}},{image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2 - Purple\"}}]},slideDuration:{type:ControlType.Number,title:\"Slide Duration\",defaultValue:3e3,min:1e3,max:1e4,step:100,unit:\"ms\"},fadeDuration:{type:ControlType.Number,title:\"Fade Duration\",defaultValue:500,min:100,max:2e3,step:50,unit:\"ms\"},randomOrder:{type:ControlType.Boolean,title:\"Random Order\",defaultValue:false,enabledTitle:\"Random\",disabledTitle:\"Sequential\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},fadeStyle:{type:ControlType.Enum,title:\"Fade Style\",options:[\"direct\",\"toBlack\"],optionTitles:[\"Direct\",\"To Black\"],defaultValue:\"direct\",displaySegmentedControl:true},timingOffset:{type:ControlType.Number,title:\"Timing Offset\",defaultValue:0,min:0,max:2e3,step:50,unit:\"ms\"},startVerticalOffset:{type:ControlType.Number,title:\"Start Vertical Offset\",defaultValue:-100,min:-500,max:500,step:10,unit:\"px\"},endVerticalOffset:{type:ControlType.Number,title:\"End Vertical Offset\",defaultValue:100,min:-500,max:500,step:10,unit:\"px\"},globalScale:{type:ControlType.Number,title:\"Global Scale\",defaultValue:1,min:.1,max:3,step:.1},tintColor:{type:ControlType.Color,title:\"Tint Color\",defaultValue:\"#FFFFFF\"},tintAmount:{type:ControlType.Number,title:\"Tint Amount\",defaultValue:30,min:0,max:100,step:1,unit:\"%\"},brightness:{type:ControlType.Number,title:\"Brightness\",defaultValue:100,min:0,max:200,step:5,unit:\"%\"},blur:{type:ControlType.Number,title:\"Blur\",defaultValue:0,min:0,max:20,step:.5,unit:\"px\"},saturation:{type:ControlType.Number,title:\"Saturation\",defaultValue:100,min:0,max:200,step:5,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ParallaxSlideshow\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"600\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n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