{"version":3,"file":"ScrollSwap.SwugahO2.mjs","names":["useState","useRef","useState"],"sources":["https:/framerusercontent.com/modules/jhCWnAr1xqA0Ae5EcTbT/xszpsnFnOqkMTAPkAVcB/ImageAnimator.js","https:/framerusercontent.com/modules/z65up7YWNALJyw5JIKvB/aXIAa1sZoaAQYTu1sPbJ/ScrollSwap.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth auto\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight auto\n */export default function GIFStyleImageAnimator(props){const{images=[],delay=500,backgroundColor=\"#FFFFFF\",borderRadius=8,padding=\"0px\",objectFit=\"cover\",shadows=\"\"}=props;const isStatic=useIsStaticRenderer();const[index,setIndex]=useState(0);const timer=useRef(null);// Fallback default images if none provided\nconst fallbackImages=[{src:\"https://assets.lummi.ai/assets/QmPMpwSUHWz4kvfpTn7CmXY4Wjf5yqt3kP9ii9Pj9Nv8jV?auto=format&w=1500\"},{src:\"https://assets.lummi.ai/assets/QmaMkjxCinCmhuZ3sH3f5Efs67S8XpNwfgpjmWjFtxcgnm?auto=format&w=1500\"},{src:\"https://assets.lummi.ai/assets/QmbkXk5ACkbxG8rUoLwRjjG1RNS2wd1mHp5x3az8TrpsgZ?auto=format&w=1500\"}];const imgs=images.length>0?images:fallbackImages;useEffect(()=>{if(typeof window===\"undefined\"||isStatic||imgs.length<=1)return;const startTimer=()=>{if(timer.current)clearTimeout(timer.current);timer.current=window.setTimeout(()=>{startTransition(()=>setIndex(i=>(i+1)%imgs.length));},Math.max(100,delay));};startTimer();return()=>{if(timer.current)clearTimeout(timer.current);};},[imgs.length,isStatic,delay]);// Separate effect for index changes to restart timer\nuseEffect(()=>{if(typeof window===\"undefined\"||isStatic||imgs.length<=1)return;if(timer.current)clearTimeout(timer.current);timer.current=window.setTimeout(()=>{startTransition(()=>setIndex(i=>(i+1)%imgs.length));},Math.max(100,delay));},[index,imgs.length,isStatic,delay]);const current=imgs[index];return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",minWidth:\"100px\",minHeight:\"100px\",maxWidth:\"100%\",maxHeight:\"100%\",position:\"relative\",overflow:\"hidden\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:shadows,borderRadius:borderRadius},children:/*#__PURE__*/_jsx(\"div\",{style:{...props.style,width:\"100%\",height:\"100%\",overflow:props.overflow,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:backgroundColor,borderRadius:borderRadius,padding:padding,boxSizing:\"border-box\"},children:/*#__PURE__*/_jsx(\"img\",{src:current.src,alt:\"\",style:{width:\"100%\",height:\"100%\",objectFit:objectFit,display:\"block\",maxWidth:\"100%\",maxHeight:\"100%\",// Radius gambar disesuaikan dengan mengurangi padding\nborderRadius:`max(0px, ${borderRadius}px - ${parseInt(padding)||0}px)`},onError:e=>{e.currentTarget.src=fallbackImages[0].src;}})})});}addPropertyControls(GIFStyleImageAnimator,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},defaultValue:[{src:\"https://assets.lummi.ai/assets/QmPMpwSUHWz4kvfpTn7CmXY4Wjf5yqt3kP9ii9Pj9Nv8jV?auto=format&w=1500\",alt:\"\"},{src:\"https://assets.lummi.ai/assets/QmaMkjxCinCmhuZ3sH3f5Efs67S8XpNwfgpjmWjFtxcgnm?auto=format&w=1500\",alt:\"\"},{src:\"https://assets.lummi.ai/assets/QmbkXk5ACkbxG8rUoLwRjjG1RNS2wd1mHp5x3az8TrpsgZ?auto=format&w=1500\",alt:\"\"}],maxCount:10},delay:{type:ControlType.Number,title:\"Delay (ms)\",defaultValue:500,min:100,max:5e3,step:50},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:64,step:1},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"0px\"},objectFit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale Down\"],defaultValue:\"cover\"},overflow:{type:ControlType.Enum,title:\"Overflow\",options:[\"visible\",\"hidden\",\"scroll\",\"auto\"],optionTitles:[\"Visible\",\"Hidden\",\"Scroll\",\"Auto\"],defaultValue:\"hidden\"},shadows:{type:ControlType.BoxShadow,title:\"Shadows\"}});GIFStyleImageAnimator.displayName=\"GIF Image Animator\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GIFStyleImageAnimator\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"auto\",\"framerIntrinsicHeight\":\"auto\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageAnimator.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useScroll}from\"framer-motion\";/**\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth 600\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 400\n */export default function ScrollImages(props){const{scrollYProgress}=useScroll();const[currentIndex,setCurrentIndex]=useState(0);const images=props.images||[{src:\"https://source.unsplash.com/random/800x600\",alt:\"Preview Image\"}];const totalImages=images.length;useEffect(()=>{const unsubscribe=scrollYProgress.onChange(latest=>{const scaled=latest*props.speed;const index=Math.floor(scaled*totalImages%totalImages);setCurrentIndex(index);});return()=>unsubscribe();},[scrollYProgress,totalImages,props.speed]);return /*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\",height:\"100%\",position:\"relative\",borderRadius:props.borderRadius,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(motion.img,{src:images[currentIndex]?.src,srcSet:images[currentIndex]?.srcSet,alt:images[currentIndex]?.alt,style:{width:\"100%\",height:\"100%\",objectFit:props.objectFit}})});}ScrollImages.defaultProps={speed:1,objectFit:\"cover\",borderRadius:0};addPropertyControls(ScrollImages,{images:{type:ControlType.Array,control:{type:ControlType.ResponsiveImage}},speed:{type:ControlType.Number,min:.1,max:10,step:.1,defaultValue:1,title:\"Speed\"},objectFit:{type:ControlType.Enum,options:[\"contain\",\"cover\",\"fill\",\"none\",\"scale-down\"],defaultValue:\"cover\"},borderRadius:{type:ControlType.BorderRadius,defaultValue:0,description:\"v1.0 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollImages\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollSwap.map"],"mappings":"yQAMG,SAAwB,EAAsB,EAAM,CAAC,GAAK,CAAC,SAAO,EAAE,CAAC,QAAM,IAAI,kBAAgB,UAAU,eAAa,EAAE,UAAQ,MAAM,YAAU,QAAQ,UAAQ,IAAI,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAO,EAAMC,EAAO,KAAK,CACtQ,EAAe,CAAC,CAAC,IAAI,mGAAmG,CAAC,CAAC,IAAI,mGAAmG,CAAC,CAAC,IAAI,mGAAmG,CAAC,CAAO,EAAK,EAAO,OAAO,EAAE,EAAO,EAAe,MAAyB,IAAS,QAAa,GAAU,EAAK,QAAQ,EAA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