{"version":3,"file":"YoutubeSlider.BSqnV-Rg.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/mHNgkTZt3FJ25VmVqz1S/VhjLIZdpEikCu2TLflIo/YoutubeSlider.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function YoutubeSlider(props){const{imagesDesktop=[],imagesMobile=[],heading=\"How your promotion will look like?\",description=\"Your campaign can show up as In-Stream video ads and Display ad placements across YouTube.\"}=props;const[index,setIndex]=useState(0);const[isMobile,setIsMobile]=useState(false);const[isTablet,setIsTablet]=useState(false);const[isXLarge,setIsXLarge]=useState(false);useEffect(()=>{const check=()=>{const w=window.innerWidth;setIsMobile(w<640);setIsTablet(w>=640&&w<1024);setIsXLarge(w>1440);};check();window.addEventListener(\"resize\",check);return()=>window.removeEventListener(\"resize\",check);},[]);const images=isMobile&&imagesMobile.length>0?imagesMobile:imagesDesktop;useEffect(()=>{if(index>=images.length)setIndex(0);},[images.length]);if(images.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100vw\",minHeight:400,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",border:\"1px dashed #ddd\",color:\"#999\",fontSize:14,padding:30},children:\"Upload images\"});}const paginate=dir=>{setIndex(prev=>{let next=prev+dir;if(next<0)next=images.length-1;if(next>=images.length)next=0;return next;});};// Sizing\nconst slideWidth=isMobile?86:isTablet?50:30// vw\n;const slideAspect=isMobile?1.6:isTablet?1.4:1.1;const slideWidthPx=`calc(${slideWidth}vw)`;const slideWidthForHeight=isMobile?86:isTablet?50:20;const slideHeightPx=`calc(${slideWidthForHeight}vw / ${slideAspect})`;// Peek spacing (smaller = more overlap)\nconst spacing=isMobile?38:isTablet?50:55;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .heading-text {\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    font-family: \"Inter\", sans-serif;\n                    font-weight: 400;\n                    font-size: 40px;\n                    line-height: 48px;\n                    letter-spacing: -0.05em;\n                    color: #0F1115;\n                    margin-bottom: 16px;\n                    margin-top: 80px;\n                }\n                .sub-heading{\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    font-family: \"Inter\", sans-serif;\n                    font-weight: 500;\n                    font-size: 16px;\n                    line-height: 24px;\n                    letter-spacing: -0.03em;\n                    color: #555A68;\n                    text-align: center;\n                    padding: 0px 20px;\n                }\n                @media (min-width: 1441px) {\n                     .heading-text{\n                        font-size: 40px;\n                        margin-bottom: 16px;\n                     }\n                     .sub-heading{\n                        font-size: 16px;\n                          margin-bottom: 48px;\n                     }\n                }\n                @media (min-width: 810px) and (max-width: 1199px) {\n                     .heading-text{\n                        font-size: 32px;\n                        margin-bottom: 16px;\n                     }\n                      .sub-heading{\n                        font-size: 14px;\n                        margin-bottom: 30px;\n\n                     }\n                }\n                @media screen and (max-width: 809px) {\n                     .heading-text{\n                        font-size: 20px;\n                        margin-bottom: 16px;\n                     }\n                      .sub-heading{\n                        font-size: 14px;\n                        margin-bottom: 30px;\n\n                     }\n            `}),/*#__PURE__*/_jsx(\"h2\",{className:\"heading-text\",children:heading}),/*#__PURE__*/_jsxs(\"p\",{className:\"sub-heading\",children:[description,\" \"]}),/*#__PURE__*/_jsxs(\"div\",{style:{width:\"100vw\",position:\"relative\",overflowX:\"hidden\",overflowY:\"visible\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",marginBottom:\"55px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:slideHeightPx,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(motion.div,{drag:\"x\",dragConstraints:{left:0,right:0},dragElastic:0,onDragEnd:(e,{offset,velocity})=>{const swipe=Math.abs(offset.x)*velocity.x;if(swipe<-1e4)paginate(1);else if(swipe>1e4)paginate(-1);},style:{position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"grab\",width:\"100%\"},whileTap:{cursor:\"grabbing\"},children:images.map((img,i)=>{let position=i-index;if(position<-1)position=images.length+position;if(position>1)position=position-images.length;const isCenter=i===index;const isVisible=Math.abs(position)<=1;return /*#__PURE__*/_jsx(motion.div,{animate:{scale:isCenter?1:.9,opacity:isVisible?isCenter?1:.5:0,x:position*spacing+\"%\"},transition:{duration:.45,ease:[.4,0,.2,1]},style:{position:\"absolute\",width:slideWidthPx,height:slideHeightPx,maxWidth:isMobile?\"420px\":\"550px\",flexShrink:0,pointerEvents:\"auto\",cursor:\"grab\",zIndex:isCenter?4:1,filter:isCenter?\"blur(0px)\":\"blur(2px)\"},onClick:()=>!isCenter&&setIndex(i),children:/*#__PURE__*/_jsx(\"img\",{src:img,alt:`Slide ${i+1}`,style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",borderRadius:16,display:\"block\"},draggable:false})},i);})})})}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",gap:8,marginTop:isMobile?16:isTablet?20:isXLarge?12:16},children:images.map((_,i)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>setIndex(i),style:{width:i===index?24:8,height:8,borderRadius:4,background:i===index?\"#7118EE\":\"#DDDDDD\",cursor:\"pointer\",border:\"none\",padding:0,transition:\"all 0.3s ease\"},\"aria-label\":`Go to slide ${i+1}`},i))})]})]});}addPropertyControls(YoutubeSlider,{imagesDesktop:{type:ControlType.Array,title:\"Desktop Images\",control:{type:ControlType.Image}},imagesMobile:{type:ControlType.Array,title:\"Mobile Images\",control:{type:ControlType.Image}},heading:{type:ControlType.String,title:\"heading\",defaultValue:\"How your promotion will look like?\"},description:{type:ControlType.String,title:\"description\",defaultValue:\"Your campaign can show up as In-Stream video ads and Display ad placements across YouTube.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"YoutubeSlider\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./YoutubeSlider.map"],"mappings":"8PAA2M,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,gBAAc,EAAE,CAAC,eAAa,EAAE,CAAC,UAAQ,qCAAqC,cAAY,8FAA8F,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAC,MAAc,CAAC,IAAM,MAAU,CAAC,IAAM,EAAE,EAAO,WAAW,EAAY,EAAE,IAAI,CAAC,EAAY,GAAG,KAAK,EAAE,KAAK,CAAC,EAAY,EAAE,KAAK,EAAmD,OAAhD,GAAO,CAAC,EAAO,iBAAiB,SAAS,EAAM,KAAW,EAAO,oBAAoB,SAAS,EAAM,EAAG,EAAE,CAAC,CAAC,IAAM,EAAO,GAAU,EAAa,OAAO,EAAE,EAAa,EAAoF,GAAtE,MAAc,CAAI,GAAO,EAAO,QAAO,EAAS,EAAE,EAAG,CAAC,EAAO,OAAO,CAAC,CAAI,EAAO,SAAS,EAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,QAAQ,UAAU,IAAI,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,OAAO,kBAAkB,MAAM,OAAO,SAAS,GAAG,QAAQ,GAAG,CAAC,SAAS,gBAAgB,CAAC,CAAE,IAAM,EAAS,GAAK,CAAC,EAAS,GAAM,CAAC,IAAI,EAAK,EAAK,EAAiE,OAA1D,EAAK,IAAE,EAAK,EAAO,OAAO,GAAK,GAAM,EAAO,SAAO,EAAK,GAAS,GAAO,EACp0C,EAAW,EAAS,GAAG,EAAS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