{"version":3,"file":"VideoModal.CEUZehgf.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/rtGijqKBGvMGb25ssR27/xXeEcxMBC799T4W3qsq3/VideoModal.js"],"sourcesContent":["// YouTube video modal with autoplay that stops when closed\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoModal(props){const{videoId=\"dQw4w9WgXcQ\",thumbnailImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video thumbnail\"},buttonText=\"Play Video\",bottomText=\"AFTERMOVIE\",buttonColor=\"#FF0000\",bottomTextColor=\"#FFFFFF\",autoplay=true,muted=true,buttonFont,bottomTextFont,useCustomIcon=false,customIcon={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Custom play icon\"},bottomTextPadding=80,borderRadius=60}=props;const[isOpen,setIsOpen]=useState(false);const[videoKey,setVideoKey]=useState(0);const isStatic=useIsStaticRenderer();const openModal=()=>{if(isStatic)return;startTransition(()=>{setIsOpen(true);setVideoKey(prev=>prev+1);});};const closeModal=()=>{startTransition(()=>{setIsOpen(false);setVideoKey(prev=>prev+1);});};const handleOverlayClick=e=>{if(e.target===e.currentTarget){closeModal();}};// Expose openModal function to parent components\nuseEffect(()=>{if(typeof window!==\"undefined\"){// Store the openModal function globally so external buttons can access it\nwindow.openVideoModal=openModal;}},[openModal]);useEffect(()=>{const handleEscape=e=>{if(e.key===\"Escape\"&&isOpen){closeModal();}};if(typeof window!==\"undefined\"){window.addEventListener(\"keydown\",handleEscape);return()=>window.removeEventListener(\"keydown\",handleEscape);}},[isOpen]);const videoSrc=`https://www.youtube.com/embed/${videoId}?${autoplay?\"autoplay=1&\":\"\"}rel=0&modestbranding=1&showinfo=0`;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"button\",{onClick:openModal,style:{position:\"relative\",width:\"100%\",height:\"100%\",border:\"none\",borderRadius:borderRadius,overflow:\"hidden\",cursor:\"pointer\",background:\"transparent\",padding:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},\"aria-label\":`Play video: ${buttonText}`,children:[/*#__PURE__*/_jsx(\"img\",{src:thumbnailImage.src,alt:thumbnailImage.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",position:\"absolute\",top:0,left:0}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,background:`linear-gradient(to top, #004587 0%, #00458700 50%, transparent 100%)`,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",zIndex:1},children:[/*#__PURE__*/_jsxs(\"div\",{style:{background:buttonColor,color:\"#FFFFFF\",padding:\"12px 24px\",borderRadius:100,display:\"flex\",alignItems:\"center\",gap:8,backdropFilter:\"blur(6px)\",WebkitBackdropFilter:\"blur(6px)\",...buttonFont},children:[useCustomIcon?/*#__PURE__*/_jsx(\"img\",{src:customIcon.src,alt:customIcon.alt,style:{width:12,height:12,objectFit:\"contain\"}}):/*#__PURE__*/_jsx(\"svg\",{width:\"12\",height:\"12\",viewBox:\"0 0 24 24\",fill:\"currentColor\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5v14l11-7z\"})}),buttonText]}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:bottomTextPadding,left:0,right:0,color:bottomTextColor,textTransform:\"uppercase\",textAlign:\"center\",...bottomTextFont},children:bottomText})]})]}),/*#__PURE__*/_jsx(AnimatePresence,{children:isOpen&&!isStatic&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,background:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:1e3,padding:20},onClick:handleOverlayClick,children:/*#__PURE__*/_jsxs(motion.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},transition:{duration:.2},style:{position:\"relative\",width:\"95vw\",maxWidth:1e3,aspectRatio:\"16/9\",background:\"#000000\",borderRadius:12,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:closeModal,style:{position:\"absolute\",top:16,right:16,background:\"rgba(0, 0, 0, 0.5)\",border:\"none\",borderRadius:\"50%\",width:40,height:40,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",zIndex:10,color:\"#FFFFFF\"},\"aria-label\":\"Close video\",children:/*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",children:[/*#__PURE__*/_jsx(\"line\",{x1:\"18\",y1:\"6\",x2:\"6\",y2:\"18\"}),/*#__PURE__*/_jsx(\"line\",{x1:\"6\",y1:\"6\",x2:\"18\",y2:\"18\"})]})}),/*#__PURE__*/_jsx(\"iframe\",{src:videoSrc,style:{width:\"100%\",height:\"100%\",border:\"none\"},allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true,title:\"YouTube video player\"},videoKey)]})})})]});}addPropertyControls(VideoModal,{videoId:{type:ControlType.String,title:\"YouTube Video ID\",defaultValue:\"dQw4w9WgXcQ\",placeholder:\"Enter YouTube video ID\"},thumbnailImage:{type:ControlType.ResponsiveImage,title:\"Thumbnail Image\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Play Video\"},bottomText:{type:ControlType.String,title:\"Bottom Text\",defaultValue:\"AFTERMOVIE\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#FF0000\"},bottomTextColor:{type:ControlType.Color,title:\"Bottom Text Color\",defaultValue:\"#FFFFFF\"},buttonFont:{type:ControlType.Font,title:\"Button Font\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},bottomTextFont:{type:ControlType.Font,title:\"Bottom Text Font\",defaultValue:{fontSize:\"48px\",variant:\"Bold\",letterSpacing:\"0.05em\",lineHeight:\"1em\",textAlign:\"center\"},controls:\"extended\",defaultFontType:\"sans-serif\"},useCustomIcon:{type:ControlType.Boolean,title:\"Custom Play Icon\",defaultValue:false,enabledTitle:\"Custom\",disabledTitle:\"Default\"},customIcon:{type:ControlType.ResponsiveImage,title:\"Play Icon Image\",hidden:({useCustomIcon})=>!useCustomIcon},bottomTextPadding:{type:ControlType.Number,title:\"Bottom Text Position\",defaultValue:80,min:0,max:200,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:60,min:0,max:100,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoModal\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoModal.map"],"mappings":"qcAIG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,cAAc,iBAAe,CAAC,IAAI,sEAAsE,IAAI,kBAAkB,CAAC,aAAW,aAAa,aAAW,aAAa,cAAY,UAAU,kBAAgB,UAAU,WAAS,GAAK,QAAM,GAAK,aAAW,iBAAe,gBAAc,GAAM,aAAW,CAAC,IAAI,sEAAsE,IAAI,mBAAmB,CAAC,oBAAkB,GAAG,eAAa,IAAI,EAAW,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAM,CAAC,EA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