{"version":3,"file":"EmbedPlayer.DJ2ORBz5.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/2Rt8d2pUjDN2eJjDLWNK/2JZDGCZmVmqwxY50ZC8O/EmbedPlayer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function CustomYouTubeEmbed({videoId,aspectRatio,customThumbnail,customPlayButton,projectTitle,roleText,textColor}){const[isPlaying,setIsPlaying]=useState(false);const containerRef=useRef(null);const[containerHeight,setContainerHeight]=useState(0);const[w,h]=aspectRatio.split(\":\").map(Number);const ratio=w/h;const embedUrl=`https://www.youtube.com/embed/${videoId}?autoplay=1&controls=1&modestbranding=1&rel=0&iv_load_policy=3`;const defaultThumbnail=`https://img.youtube.com/vi/${videoId}/hqdefault.jpg`;const thumbnailSrc=customThumbnail||defaultThumbnail;useEffect(()=>{if(!containerRef.current)return;const updateSize=()=>setContainerHeight(containerRef.current.offsetHeight);updateSize();const observer=new ResizeObserver(updateSize);observer.observe(containerRef.current);return()=>observer.disconnect();},[]);const calculatedWidth=containerHeight*ratio;const isMobile=calculatedWidth<600;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\",cursor:\"pointer\"},children:!isPlaying?/*#__PURE__*/_jsxs(\"div\",{style:{backgroundImage:`url(${thumbnailSrc})`,backgroundSize:\"cover\",backgroundPosition:\"center\",position:\"absolute\",top:0,left:\"50%\",transform:\"translateX(-50%)\",width:`${calculatedWidth}px`,height:\"100%\"},onClick:()=>setIsPlaying(true),children:[(projectTitle||roleText)&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",top:isMobile?\"35%\":\"42%\",left:\"50%\",transform:\"translate(-50%, -100%)\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"2px\",textAlign:\"center\",pointerEvents:\"none\",paddingBottom:\"12px\"},children:[projectTitle&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:textColor||\"white\",fontSize:isMobile?`${calculatedWidth*.08}px`:`${calculatedWidth*.06}px`,fontWeight:800,letterSpacing:\"0.04em\",textTransform:\"uppercase\",textShadow:\".5px 1px 2px rgba(150,0,50,.75), 1px 2px 3px rgba(0,150,0,.5), 1px 2px 6px rgba(0,0,150,.5)\",fontFamily:\"Barlow Condensed\",whiteSpace:\"nowrap\"},children:projectTitle}),roleText&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:textColor||\"white\",fontSize:isMobile?`${calculatedWidth*.05}px`:`${calculatedWidth*.03}px`,fontWeight:100,letterSpacing:\"0.1em\",textTransform:\"uppercase\",textShadow:\".5px 1px 2px rgba(150,0,50,.75), 1px 2px 3px rgba(0,150,0,.5), 1px 2px 6px rgba(0,0,150,.5)\",fontFamily:\"Barlow Condensed\",whiteSpace:\"nowrap\"},children:roleText})]}),customPlayButton&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"img\",{src:customPlayButton,alt:\"Play Button\",style:{width:`$100px`,height:`100px`,objectFit:\"contain\",transition:\"transform 0.3s ease, opacity 0.3s ease\",pointerEvents:\"auto\",mixBlendMode:\"color-dodge\",opacity:.9},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.1)\";e.currentTarget.style.opacity=\"1\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";e.currentTarget.style.opacity=\"0.75\";}})})]}):/*#__PURE__*/_jsx(\"iframe\",{src:embedUrl,frameBorder:\"0\",allow:\"autoplay; encrypted-media\",allowFullScreen:true,style:{position:\"absolute\",top:0,left:\"50%\",transform:\"translateX(-50%)\",width:`${calculatedWidth}px`,height:\"100%\",border:\"none\"}})});}addPropertyControls(CustomYouTubeEmbed,{videoId:{type:ControlType.String,title:\"YouTube Video ID\",defaultValue:\"dQw4w9WgXcQ\"},aspectRatio:{type:ControlType.Enum,title:\"Aspect Ratio\",options:[\"16:9\",\"1:1\",\"9:16\"],optionTitles:[\"16:9 (Landscape)\",\"1:1 (Square)\",\"9:16 (Portrait)\"],defaultValue:\"16:9\"},customThumbnail:{type:ControlType.Image,title:\"Thumbnail Image\"},customPlayButton:{type:ControlType.Image,title:\"Play Button Image\"},projectTitle:{type:ControlType.String,title:\"Project Title\",defaultValue:\"\",placeholder:\"e.g. Those Beyond – Barren\"},roleText:{type:ControlType.String,title:\"Role\",defaultValue:\"\",placeholder:\"e.g. 3D Artist – Weapons\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#ffffff\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomYouTubeEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmbedPlayer.map"],"mappings":"+LAA0J,SAAwB,EAAmB,CAAC,UAAQ,cAAY,kBAAgB,mBAAiB,eAAa,WAAS,aAAW,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CAAM,CAAC,EAAgB,GAAoBD,EAAS,EAAE,CAAM,CAAC,EAAE,GAAG,EAAY,MAAM,IAAI,CAAC,IAAI,OAAO,CAAO,EAAM,EAAE,EAAQ,EAAS,iCAAiC,EAAQ,gEAAsE,EAAiB,8BAA8B,EAAQ,gBAAsB,EAAa,GAAiB,EAAiB,MAAc,CAAC,GAAG,CAAC,EAAa,QAAQ,OAAO,IAAM,MAAe,EAAmB,EAAa,QAAQ,aAAa,CAAC,GAAY,CAAC,IAAM,EAAS,IAAI,eAAe,EAAW,CAAwC,OAAvC,EAAS,QAAQ,EAAa,QAAQ,KAAW,EAAS,YAAY,EAAG,EAAE,CAAC,CAAC,IAAM,EAAgB,EAAgB,EAAY,EAAS,EAA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