{"version":3,"file":"BlogVideo.C3Bhy2uI.mjs","names":["useState","useRef","useEffect","_jsx","_jsxs","_Fragment","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","l","c","p","_e","de","addPropertyControls","init_framer_B3LLf74D","ControlType","BlogVideo","props","video","poster","label","frame","accent","radius","style","img","playing","setPlaying","hover","setHover","videoRef","box","RATIO","fill","FONT","__FramerMetadata__","init_BlogVideo","\"exports\"","\"default\"","\"type\"","\"name\"","\"slots\"","\"annotations\"","\"framerContractVersion\"","\"framerSupportedLayoutHeight\"","\"framerSupportedLayoutWidth\"","\"framerIntrinsicWidth\"","\"framerIntrinsicHeight\"","\"__FramerMetadata__\""],"sources":["https:/framerusercontent.com/modules/3yOANM8rbfPqeIbqIypR/it7PzSTotKI24zigmAhH/BlogVideo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const RATIO={\"Landscape 16:9\":\"16 / 9\",\"Vertical 9:16\":\"9 / 16\",\"Square 1:1\":\"1 / 1\"};const FONT=\"Montserrat, sans-serif\";/**\n * Blog video: shows a thumbnail with a centred play button. One click plays\n * the video in place with sound and player controls.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 720\n * @framerIntrinsicHeight 405\n */export default function BlogVideo(props){const{video,poster,label=\"Watch the example\",frame=\"Landscape 16:9\",accent=\"#A5F0B1\",radius=16,style}=props;const img=typeof poster===\"string\"?{src:poster}:poster||{};const[playing,setPlaying]=useState(false);const[hover,setHover]=useState(false);const videoRef=useRef(null);useEffect(()=>{if(playing)videoRef.current?.play().catch(()=>{});},[playing]);const box={position:\"relative\",width:\"100%\",maxWidth:frame===\"Vertical 9:16\"?380:undefined,aspectRatio:RATIO[frame]||\"16 / 9\",borderRadius:radius,overflow:\"hidden\",background:\"#0A0909\"};const fill={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\"};return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",display:\"flex\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"div\",{style:box,children:playing?/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:video,poster:img.src,controls:true,autoPlay:true,playsInline:true,style:{...fill,objectFit:\"contain\",display:\"block\"}}):/*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-label\":label?\"Play video: \"+label:\"Play video\",onClick:()=>video&&setPlaying(true),onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),style:{...fill,border:\"none\",padding:0,margin:0,background:\"transparent\",cursor:\"pointer\"},children:[img.src&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"img\",{src:img.src,\"aria-hidden\":\"true\",alt:\"\",style:{...fill,objectFit:\"cover\",filter:\"blur(28px) brightness(0.45)\",transform:\"scale(1.2)\"}}),/*#__PURE__*/_jsx(\"img\",{src:img.src,srcSet:img.srcSet,alt:img.alt||\"\",style:{...fill,objectFit:\"contain\"}})]}),/*#__PURE__*/_jsx(\"span\",{style:{...fill,background:\"linear-gradient(180deg, rgba(10,9,9,0) 55%, rgba(10,9,9,0.65) 100%)\"}}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",left:\"50%\",top:\"50%\",width:76,height:76,borderRadius:\"50%\",background:accent,display:\"grid\",placeItems:\"center\",transform:\"translate(-50%, -50%) scale(\"+(hover?1.08:1)+\")\",transition:\"transform 0.2s ease\",boxShadow:\"0 0 0 10px rgba(165,240,177,0.18), 0 8px 24px rgba(0,0,0,0.35)\"},children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",width:\"26\",height:\"26\",fill:\"#0A0909\",\"aria-hidden\":\"true\",style:{marginLeft:4},children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 4l13 8-13 8z\"})})}),label&&/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",left:16,bottom:16,padding:\"8px 14px\",borderRadius:999,background:\"rgba(10,9,9,0.72)\",border:\"1px solid rgba(255,255,255,0.12)\",color:\"#FFFFFF\",fontFamily:FONT,fontSize:13,fontWeight:600,letterSpacing:\"0.01em\"},children:label})]})})});}addPropertyControls(BlogVideo,{video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\"]},poster:{type:ControlType.ResponsiveImage,title:\"Thumbnail\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Watch the example\"},frame:{type:ControlType.Enum,title:\"Frame\",options:[\"Landscape 16:9\",\"Vertical 9:16\",\"Square 1:1\"],defaultValue:\"Landscape 16:9\"},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#A5F0B1\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:40}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlogVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"720\",\"framerIntrinsicHeight\":\"405\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogVideo.map"],"mappings":"A,sMAQG,SAAwBkB,EAAUC,EAAM,CAAC,GAAK,CAACC,QAAMC,SAAOC,QAAM,oBAAoBC,QAAM,iBAAiBC,SAAO,UAAUC,SAAO,GAAGC,SAAOP,EAAYQ,EAAI,OAAON,GAAS,SAAS,CAAC,IAAIA,CAAM,EAAEA,GAAQ,CAAC,EAAO,CAACO,EAAQC,GAAY7B,EAAS,EAAK,EAAO,CAAC8B,EAAMC,GAAU/B,EAAS,EAAK,EAAQgC,EAAS/B,EAAO,IAAI,EAAEC,MAAc,CAAI0B,GAAQI,EAAS,SAAS,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,EAAE,CAACJ,CAAO,CAAC,EAAE,IAAMK,EAAI,CAAC,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