{"version":3,"file":"LogoPreloader.D0d0pieQ.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/POs8jxv5FY3EzgI6pX38/OBzHxgjbPWOWl0DBc3P7/LogoPreloader.js"],"sourcesContent":["// Pre-loader with centered logo, animates logo up and out, then fades background\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * LogoPreloader\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */function LogoPreloader(props){const{logo={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo\"},backgroundColor,duration,logoSize,videoFile=\"\",backgroundImage={src:\"\",alt:\"\"},style}=props;const[phase,setPhase]=useState(\"init\")// init, loading, logoOut, done\n;const[bgVisible,setBgVisible]=useState(true)// 👈 controle do background\n;const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic)return;// 🔒 trava o scroll\ndocument.body.style.overflow=\"hidden\";document.body.style.overscrollBehavior=\"none\";// Entrada da logo\nconst t0=setTimeout(()=>{startTransition(()=>setPhase(\"loading\"));},50);// Saída da logo\nconst t1=setTimeout(()=>{startTransition(()=>setPhase(\"logoOut\"));},duration*1e3+50);// 👇 Delay do background (AJUSTE AQUI)\nconst tBg=setTimeout(()=>{setBgVisible(false);},duration*1e3+250)// 250ms depois da logo começar a sair\n;// Finalização\nconst t2=setTimeout(()=>{// 🔓 libera o scroll\ndocument.body.style.overflow=\"auto\";document.body.style.overscrollBehavior=\"auto\";startTransition(()=>setPhase(\"done\"));},duration*1e3+750);return()=>{clearTimeout(t0);clearTimeout(t1);clearTimeout(tBg);clearTimeout(t2);// 🔓 garante liberação\ndocument.body.style.overflow=\"auto\";document.body.style.overscrollBehavior=\"auto\";};},[duration,isStatic]);if(phase===\"done\")return null;// Estados da logo\nlet logoTranslateY=0;let logoOpacity=1;if(phase===\"init\"){logoTranslateY=80;logoOpacity=0;}else if(phase===\"loading\"){logoTranslateY=0;logoOpacity=1;}else if(phase===\"logoOut\"){logoTranslateY=-80;logoOpacity=0;}// 👇 background agora independente\nconst bgOpacity=bgVisible?1:0;// easing mais suave\nconst transition=\"all 0.7s cubic-bezier(.3,0,.2,1)\";return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"fixed\",top:0,left:0,width:\"100%\",height:\"100%\",background:videoFile||backgroundImage.src?undefined:backgroundColor,backgroundImage:!videoFile&&backgroundImage.src?`url(${backgroundImage.src})`:undefined,backgroundSize:\"cover\",backgroundPosition:\"center\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:`opacity 0.7s cubic-bezier(.3,0,.2,1)`,opacity:bgOpacity,pointerEvents:\"all\",zIndex:9999,overflow:\"hidden\"},\"aria-label\":\"Loading\",role:\"status\",children:[videoFile&&/*#__PURE__*/_jsx(\"video\",{src:videoFile,autoPlay:true,muted:true,loop:true,playsInline:true,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",zIndex:0,pointerEvents:\"none\",opacity:bgOpacity,transition:`opacity 0.7s cubic-bezier(.3,0,.2,1)`},\"aria-hidden\":\"true\"}),/*#__PURE__*/_jsx(\"img\",{src:logo.src,alt:logo.alt||\"Logo\",style:{width:logoSize,height:logoSize,objectFit:\"contain\",transition,transform:`translateY(${logoTranslateY}px)`,opacity:logoOpacity,willChange:\"transform, opacity\",userSelect:\"none\",zIndex:1},draggable:false})]});}addPropertyControls(LogoPreloader,{logo:{type:ControlType.ResponsiveImage,title:\"Logo\"},videoFile:{type:ControlType.File,allowedFileTypes:[\"mp4\",\"webm\",\"mov\"],title:\"Video Background\"},backgroundImage:{type:ControlType.ResponsiveImage,title:\"Background Image\",hidden:({videoFile})=>!!videoFile},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\",hidden:({videoFile,backgroundImage})=>!!videoFile||!!backgroundImage?.src},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:2,min:.5,max:10,step:.1},logoSize:{type:ControlType.Number,title:\"Logo Size\",defaultValue:80,min:24,max:800,unit:\"px\"}});export default LogoPreloader;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoPreloader\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoPreloader.map"],"mappings":"uMAMG,SAAS,EAAc,EAAM,CAAC,GAAK,CAAC,OAAK,CAAC,IAAI,sEAAsE,IAAI,OAAO,CAAC,kBAAgB,WAAS,WAAS,YAAU,GAAG,kBAAgB,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,OAAO,CAC/P,CAAC,EAAU,GAAcA,EAAS,GAAK,CACtC,EAAS,GAAqB,CAQsE,GARrE,MAAc,CAAC,GAAG,EAAS,OACjE,SAAS,KAAK,MAAM,SAAS,SAAS,SAAS,KAAK,MAAM,mBAAmB,OAC7E,IAAM,EAAG,eAAe,CAAC,MAAoB,EAAS,UAAU,CAAC,EAAG,GAAG,CACjE,EAAG,eAAe,CAAC,MAAoB,EAAS,UAAU,CAAC,EAAG,EAAS,IAAI,GAAG,CAC9E,EAAI,eAAe,CAAC,EAAa,GAAM,EAAG,EAAS,IAAI,IAAI,CAE3D,EAAG,eAAe,CACxB,SAAS,KAAK,MAAM,SAAS,OAAO,SAAS,KAAK,MAAM,mBAAmB,OAAO,MAAoB,EAAS,OAAO,CAAC,EAAG,EAAS,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,EAAG,CAAC,aAAa,EAAG,CAAC,aAAa,EAAI,CAAC,aAAa,EAAG,CAC3N,SAAS,KAAK,MAAM,SAAS,OAAO,SAAS,KAAK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