{"version":3,"file":"VideoCarousel.BGoXLMho.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/fpMsRzh1Wf2jsMYX2ECU/e8p2La6dU2XbYSjuWtX7/VideoCarousel.js"],"sourcesContent":["// Short-form video player in a carousel\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const defaultVideos=[{src:\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",poster:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",title:\"Video 1\"},{src:\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",poster:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",title:\"Video 2\"},{src:\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",poster:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",title:\"Video 3\"}];/**\n * Short-form video player in a carousel\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoCarousel(props){const{videos=defaultVideos,background,borderRadius,showTitles,style}=props;const[current,setCurrent]=useState(0);const videoRefs=useRef([]);const isStatic=useIsStaticRenderer();useEffect(()=>{// Pause all except current\nvideoRefs.current.forEach((ref,idx)=>{if(ref&&idx!==current)ref.pause();});// Autoplay current\nif(videoRefs.current[current]&&!isStatic){videoRefs.current[current].play().catch(()=>{});}},[current,isStatic,videos]);function prev(){startTransition(()=>setCurrent(c=>(c-1+videos.length)%videos.length));}function next(){startTransition(()=>setCurrent(c=>(c+1)%videos.length));}return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",height:\"100%\",background,borderRadius,overflow:\"hidden\",position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Previous video\",onClick:prev,style:{position:\"absolute\",left:10,top:\"50%\",transform:\"translateY(-50%)\",zIndex:2,background:\"rgba(0,0,0,0.4)\",color:\"#fff\",border:\"none\",borderRadius:20,width:36,height:36,cursor:\"pointer\"},children:\"←\"}),/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:videos.map((video,idx)=>{// Calculate position relative to current\nconst offset=idx-current;// Only render up to 3 videos: previous, current, next\nif(Math.abs(offset)>1)return null;// Center video is in focus, sides are smaller and faded\nconst isCenter=offset===0;const scale=isCenter?1:.8;const opacity=isCenter?1:.5;const zIndex=isCenter?2:1;const translateX=offset*120// px, adjust for spacing\n;return /*#__PURE__*/_jsx(\"video\",{ref:el=>videoRefs.current[idx]=el,src:video.src,poster:video.poster,style:{position:\"absolute\",left:\"50%\",top:\"50%\",transform:`translate(-50%, -50%) translateX(${translateX}px) scale(${scale})`,width:isCenter?\"70%\":\"50%\",height:isCenter?\"80%\":\"60%\",objectFit:\"cover\",borderRadius:20,boxShadow:isCenter?\"0 4px 24px rgba(0,0,0,0.18)\":\"0 2px 8px rgba(0,0,0,0.10)\",opacity,zIndex,transition:\"all 0.35s cubic-bezier(.4,1.2,.4,1)\",pointerEvents:isCenter?\"auto\":\"none\",background:\"#000\"},controls:isCenter,muted:true,playsInline:true,loop:true,tabIndex:isCenter?0:-1,\"aria-label\":video.title||`Video ${idx+1}`},idx);})}),/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Next video\",onClick:next,style:{position:\"absolute\",right:10,top:\"50%\",transform:\"translateY(-50%)\",zIndex:2,background:\"rgba(0,0,0,0.4)\",color:\"#fff\",border:\"none\",borderRadius:20,width:36,height:36,cursor:\"pointer\"},children:\"→\"}),showTitles&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:16,left:0,width:\"100%\",textAlign:\"center\",color:\"#fff\",textShadow:\"0 2px 8px rgba(0,0,0,0.7)\",fontSize:18,fontWeight:600,pointerEvents:\"none\"},children:videos[current]?.title}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:10,left:0,width:\"100%\",display:\"flex\",justifyContent:\"center\",gap:8},children:videos.map((_,idx)=>/*#__PURE__*/_jsx(\"div\",{style:{width:8,height:8,borderRadius:4,background:idx===current?\"#fff\":\"rgba(255,255,255,0.4)\",transition:\"background 0.2s\"}},idx))})]});}addPropertyControls(VideoCarousel,{videos:{type:ControlType.Array,title:\"Videos\",control:{type:ControlType.Object,controls:{src:{type:ControlType.File,allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},poster:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"webp\"]},title:{type:ControlType.String,defaultValue:\"Video Title\"}}},defaultValue:defaultVideos},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},showTitles:{type:ControlType.Boolean,title:\"Show Titles\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoCarousel.map"],"mappings":"yTAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,SAAO,EAAc,aAAW,eAAa,aAAW,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAS,EAAE,CAAO,EAAUC,EAAO,EAAE,CAAC,CAAO,EAAS,GAAqB,CAAC,MAAc,CAC/O,EAAU,QAAQ,SAAS,EAAI,IAAM,CAAI,GAAK,IAAM,GAAQ,EAAI,OAAO,EAAG,CACvE,EAAU,QAAQ,IAAU,CAAC,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