{"version":3,"file":"LoopVideo.Dufhtcie.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/a14sgJagoVcjgk0Rm6V7/QALTITrPyKDss57ZGOQm/BottomFade.js","https:/framerusercontent.com/modules/IqBRRZKKMwNPq6uVzC54/Yvboka4TrtJF2JmcPUEr/LoopVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Edge Fade — a transparent-in-the-middle vertical vignette (dark at the top and\n * dark at the bottom), to keep hero text readable behind a title (top) and a\n * stats row (bottom) while the video still shows through the clear middle band.\n *\n * `color` is the colour the edges fade TO. Default black, which is what every\n * instance predating this prop was hardcoded to. Set it to the NEXT SECTION's\n * background and push `strength` to 1 to dissolve a video hero into the section\n * below it — at full strength the hero's last pixel row is exactly the section\n * colour, so there is no seam to see. Fading to black instead leaves a subtle\n * mismatch against an off-black section (e.g. rgb(13,14,18)).\n *\n * `leftStrength` adds a LEFT-edge ramp, which a multi-shot video hero needs.\n * With one shot you can compose the dark side of the frame under the headline\n * and skip this. As soon as the video cuts between angles you no longer control\n * what sits behind the copy — on /connectors the third shot tilts into a lit\n * dome and put a lamp exactly where the cream h1 sits, measuring 164 where\n * cream text wants its backdrop under ~90. The ramp holds flat to `leftHold`\n * so protection is even across the text column, then falls to zero by\n * `leftEnd` rather than ramping from the very edge (a plain 0%→x% gradient is\n * strongest where there is no text and weakest where the line ends).\n *\n * Both the clear and the opaque stops use the same colour on purpose: fading a\n * colour to `transparent` interpolates through rgba(0,0,0,0) and greys out the\n * midpoint. Same-hue stops keep the ramp clean.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 480\n * @framerDisableUnlink\n */// Accepts #abc, #aabbcc, rgb()/rgba() and space-separated modern syntax.\n// Falls back to black, which is the pre-prop behaviour.\nfunction toRgb(input){const s=(input||\"\").trim();const hex=s.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(hex){let h=hex[1];if(h.length===3)h=h.split(\"\").map(x=>x+x).join(\"\");return`${parseInt(h.slice(0,2),16)},${parseInt(h.slice(2,4),16)},${parseInt(h.slice(4,6),16)}`;}const m=s.match(/rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)/i);if(m)return`${Math.round(+m[1])},${Math.round(+m[2])},${Math.round(+m[3])}`;return\"0,0,0\";}export default function BottomFade(props){const{strength=.6,start=58,topStrength=.5,topEnd=42,leftStrength=0,leftHold=34,leftEnd=66,color=\"rgb(0,0,0)\"}=props;const s=Math.max(0,Math.min(1,strength));const ts=Math.max(0,Math.min(1,topStrength));const ls=Math.max(0,Math.min(1,leftStrength));const c=toRgb(color);const vertical=`linear-gradient(180deg, rgba(${c},${ts}) 0%, rgba(${c},0) ${topEnd}%, rgba(${c},0) ${start}%, rgba(${c},${s}) 100%)`;// hold flat across the text column, then fall away\nconst hold=Math.min(leftHold,leftEnd);const horizontal=`linear-gradient(90deg, rgba(${c},${ls}) 0%, rgba(${c},${ls}) ${hold}%, rgba(${c},0) ${leftEnd}%)`;const bg=ls>0?`${horizontal}, ${vertical}`:vertical;return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",background:bg,pointerEvents:\"none\",...props.style}});}addPropertyControls(BottomFade,{strength:{type:ControlType.Number,title:\"Bottom darkness\",defaultValue:.6,min:0,max:1,step:.05},start:{type:ControlType.Number,title:\"Bottom start %\",defaultValue:58,min:0,max:100,step:1},topStrength:{type:ControlType.Number,title:\"Top darkness\",defaultValue:.5,min:0,max:1,step:.05},topEnd:{type:ControlType.Number,title:\"Top end %\",defaultValue:42,min:0,max:100,step:1},leftStrength:{type:ControlType.Number,title:\"Left darkness\",description:\"0 = off. Protects headline copy when a multi-shot video cuts to a bright angle.\",defaultValue:0,min:0,max:1,step:.05},leftHold:{type:ControlType.Number,title:\"Left hold %\",description:\"Ramp stays at full strength up to here, so protection is even across the text column.\",defaultValue:34,min:0,max:100,step:1},leftEnd:{type:ControlType.Number,title:\"Left end %\",defaultValue:66,min:0,max:100,step:1},color:{type:ControlType.Color,title:\"Fade to\",description:\"Colour the edges fade to. Set this to the next section's background to dissolve a video hero into it.\",defaultValue:\"rgb(0,0,0)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BottomFade\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BottomFade.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef,useState}from\"react\";const DEFAULT_SRC=\"https://d2ol7oe51mr4n9.cloudfront.net/user_3FMPqLZy3N0UPmCIAVAvDMjs76h/319ebca4-068e-461f-b826-422f9073086c.mp4\";/**\n * Loop Video — autoplaying, muted background video that fills its frame.\n * With `smooth` on, two stacked copies crossfade at the loop point so the\n * restart is invisible instead of a hard cut; off = native loop.\n *\n * `srcUrl` (string) overrides the File control — File controls can't be set\n * via the plugin. `srcUrlMobile` + `mobileMax` swap in a portrait cut below\n * the given viewport width (matchMedia; keyed remount on switch).\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 640\n * @framerIntrinsicHeight 540\n * @framerDisableUnlink\n */export default function LoopVideo(props){const{src,srcUrl=\"\",srcUrlMobile=\"\",mobileMax=810,fit=\"cover\",radius=0,smooth=true,fade=1}=props;const isStatic=useIsStaticRenderer();const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(isStatic||typeof window===\"undefined\"||!window.matchMedia)return;const mq=window.matchMedia(`(max-width: ${mobileMax}px)`);const apply=()=>setIsMobile(mq.matches);apply();mq.addEventListener?mq.addEventListener(\"change\",apply):mq.addListener(apply);return()=>{mq.removeEventListener?mq.removeEventListener(\"change\",apply):mq.removeListener(apply);};},[isStatic,mobileMax]);const desktopSrc=(srcUrl||\"\").trim()||src||DEFAULT_SRC;const mobileSrc=(srcUrlMobile||\"\").trim();const activeSrc=isMobile&&mobileSrc?mobileSrc:desktopSrc;const a=useRef(null);const b=useRef(null);const st=useRef({active:0,switching:false});useEffect(()=>{if(isStatic||!smooth)return;const vids=[a.current,b.current];if(!vids[0]||!vids[1])return;const s=st.current;s.active=0;s.switching=false;vids[0].style.opacity=\"1\";vids[1].style.opacity=\"0\";try{vids[0].currentTime=0;}catch(e){}vids[0].play().catch(()=>{});const tick=()=>{const cur=vids[s.active],nxt=vids[1-s.active];if(!cur||!nxt||s.switching)return;if(cur.duration&&cur.duration-cur.currentTime<=Math.max(.3,fade)){s.switching=true;try{nxt.currentTime=0;}catch(e){}nxt.play().catch(()=>{});nxt.style.opacity=\"1\";cur.style.opacity=\"0\";setTimeout(()=>{cur.pause();s.active=1-s.active;s.switching=false;},Math.max(.3,fade)*1e3);}};const id=setInterval(tick,100);return()=>clearInterval(id);},[isStatic,smooth,activeSrc,fade]);const base={width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"};if(isStatic||!smooth){return /*#__PURE__*/_jsx(\"video\",{src:activeSrc,autoPlay:true,loop:true,muted:true,playsInline:true,preload:\"auto\",style:{...base,borderRadius:radius,...props.style}},activeSrc);}const layer={...base,position:\"absolute\",inset:0,transition:`opacity ${Math.max(.3,fade)}s ease`};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:radius,...props.style},children:[/*#__PURE__*/_jsx(\"video\",{ref:a,src:activeSrc,autoPlay:true,muted:true,playsInline:true,preload:\"auto\",style:{...layer,opacity:1}}),/*#__PURE__*/_jsx(\"video\",{ref:b,src:activeSrc,muted:true,playsInline:true,preload:\"auto\",style:{...layer,opacity:0}})]},activeSrc);}addPropertyControls(LoopVideo,{src:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},srcUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\"},srcUrlMobile:{type:ControlType.String,title:\"Mobile URL\",defaultValue:\"\"},mobileMax:{type:ControlType.Number,title:\"Mobile max px\",defaultValue:810,min:320,max:1200},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],defaultValue:\"cover\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:48},smooth:{type:ControlType.Boolean,title:\"Smooth loop\",defaultValue:true},fade:{type:ControlType.Number,title:\"Crossfade (s)\",defaultValue:1,min:.3,max:3,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoopVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicWidth\":\"640\",\"framerIntrinsicHeight\":\"540\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoopVideo.map"],"mappings":"qNAiCA,SAAS,EAAM,EAAM,CAAC,IAAM,GAAG,GAAO,GAAA,CAAI,KAAK,EAAQ,EAAI,EAAE,MAAM,+BAA+B,EAAE,GAAG,EAAI,CAAC,IAAI,EAAE,EAAI,GAAsD,OAAhD,EAAE,SAAS,IAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,GAAQ,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAI,CAAC,IAAM,EAAE,EAAE,MAAM,iDAAiD,EAA8E,OAAzE,EAAQ,GAAG,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,MAAM,CAAC,EAAE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