{"version":3,"file":"TypewriterEffect.BbQbzPce.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/NQA9WTWXBxKycP8PnEEa/r5qr99dbimbtHhXU5ifA/TypewriterEffect.js"],"sourcesContent":["// Video Player with Customizable Play Button and Blur Background\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Video Player with Customizable Play Button and Blur Background\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 180\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function TypewriterEffect(props){const{videoFile=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",posterImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Poster\"},poster=\"\",showControls,loop,muted,autoPlay,playIcon={src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Play\"},iconSize,background,borderRadius,blurAmount,iconBackground,style}=props;const videoRef=useRef(null);const[isPlaying,setIsPlaying]=useState(autoPlay);const[showOverlay,setShowOverlay]=useState(!autoPlay);useEffect(()=>{if(autoPlay&&videoRef.current){videoRef.current.play();setIsPlaying(true);setShowOverlay(false);}},[autoPlay]);function handlePlayPause(){if(!videoRef.current)return;if(isPlaying){videoRef.current.pause();startTransition(()=>{setIsPlaying(false);setShowOverlay(true);});}else{videoRef.current.play();startTransition(()=>{setIsPlaying(true);setShowOverlay(false);});}}function handleVideoClick(){if(isPlaying)handlePlayPause();}function handlePlay(){startTransition(()=>{setIsPlaying(true);setShowOverlay(false);});}function handlePause(){startTransition(()=>{setIsPlaying(false);setShowOverlay(true);});}// Use poster prop if provided, otherwise use posterImage\nconst posterSrc=poster&&poster.length>0?poster:posterImage.src;return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",background,borderRadius,overflow:\"hidden\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:videoFile,poster:posterSrc,controls:showControls,loop:loop,muted:muted,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius,display:\"block\",background,cursor:isPlaying?\"pointer\":\"inherit\"},onClick:isPlaying?handleVideoClick:undefined,onPlay:handlePlay,onPause:handlePause,tabIndex:0,\"aria-label\":\"Video player\"}),showOverlay&&/*#__PURE__*/_jsx(\"button\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",border:\"none\",borderRadius:\"50%\",padding:0,width:iconSize,height:iconSize,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",background:\"transparent\",backdropFilter:blurAmount?`blur(${blurAmount}px)`:undefined},\"aria-label\":\"Play video\",onClick:handlePlayPause,children:/*#__PURE__*/_jsx(\"img\",{src:playIcon.src,alt:playIcon.alt,style:{width:iconSize*.7,height:iconSize*.7,pointerEvents:\"none\"},draggable:false})})]});}addPropertyControls(TypewriterEffect,{videoFile:{type:ControlType.File,allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},posterImage:{type:ControlType.ResponsiveImage,title:\"Poster Image\"},poster:{type:ControlType.String,title:\"Poster (URL)\",defaultValue:\"\",placeholder:\"Paste poster URL…\"},showControls:{type:ControlType.Boolean,title:\"Show Controls\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},playIcon:{type:ControlType.ResponsiveImage,title:\"Play Icon\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:64,min:24,max:200,step:1,unit:\"px\"},blurAmount:{type:ControlType.Number,title:\"Play Icon Blur\",defaultValue:0,min:0,max:32,step:1,unit:\"px\"},iconBackground:{type:ControlType.Color,title:\"Play Icon Background\",defaultValue:\"rgba(0,0,0,0.3)\",hidden:()=>true},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:64,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypewriterEffect\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"180\",\"framerIntrinsicWidth\":\"320\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypewriterEffect.map"],"mappings":"sMASG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,YAAU,uEAAuE,cAAY,CAAC,IAAI,sEAAsE,IAAI,SAAS,CAAC,SAAO,GAAG,eAAa,OAAK,QAAM,WAAS,WAAS,CAAC,IAAI,oEAAoE,IAAI,OAAO,CAAC,WAAS,aAAW,eAAa,aAAW,iBAAe,SAAO,EAAY,EAASA,EAAO,KAAK,CAAM,CAAC,EAAU,GAAcC,EAAS,EAAS,CAAM,CAAC,EAAY,GAAgBA,EAAS,CAAC,EAAS,CAAC,MAAc,CAAI,GAAU,EAAS,UAAS,EAAS,QAAQ,MAAM,CAAC,EAAa,GAAK,CAAC,EAAe,GAAM,GAAI,CAAC,EAAS,CAAC,CAAC,SAAS,GAAiB,CAAK,EAAS,UAAkB,GAAW,EAAS,QAAQ,OAAO,CAAC,MAAoB,CAAC,EAAa,GAAM,CAAC,EAAe,GAAK,EAAG,GAAO,EAAS,QAAQ,MAAM,CAAC,MAAoB,CAAC,EAAa,GAAK,CAAC,EA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