{"version":3,"file":"VideoModal.Q31Sy2DS.mjs","names":["useState","_Fragment","__esmMin","init_npm_react_18_3_1","te","window","init_ssg_sandbox_shims","ce","init_jsx_runtime","p","_e","motion","AnimatePresence","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_BL70qLPA","useIsStaticRenderer","ControlType","VideoModal","props","isOpen","setIsOpen","videoKey","setVideoKey","isStatic","openModal","prev","closeModal","handleOverlayClick","handleEscape","videoSrc","videoId","autoplay","l","buttonText","thumbnailImage","buttonColor","buttonFont","useCustomIcon","customIcon","bottomTextPadding","bottomTextColor","bottomTextFont","bottomText","init_VideoModal"],"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"],"mapp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