{"version":3,"file":"LoadingScreen_2.DipT6GaY.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/ZTBZ4BPFGwBWKTTZ7E3V/28ZvpF7KBi4quvJ8dfKM/LoadingScreen_2.js"],"sourcesContent":["// Customizable Loading Animation Screen\n// Features: Animated count 1-100, swipe-up reveal, full customizability (background, count, animation, text, position)\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";const defaultBgImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"};const positionMap={\"bottom-right\":{justifyContent:\"flex-end\",alignItems:\"flex-end\"},\"bottom-left\":{justifyContent:\"flex-end\",alignItems:\"flex-start\"},\"top-right\":{justifyContent:\"flex-start\",alignItems:\"flex-end\"},\"top-left\":{justifyContent:\"flex-start\",alignItems:\"flex-start\"},center:{justifyContent:\"center\",alignItems:\"center\"}};/**\n * Customizable Loading Animation Screen\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LoadingScreen(props){const{backgroundColor,backgroundImage=defaultBgImage,useImage,countFont,countColor,countSpeed,countStyle,countPrefix,countSuffix,countPosition,showPercent,swipeDuration,style,scrollBlock=true}=props;const[count,setCount]=useState(1);const[loading,setLoading]=useState(true);const[swipe,setSwipe]=useState(false);const isStatic=useIsStaticRenderer();const timerRef=useRef(null);const scrollBlockedRef=useRef(false);// Block scroll when loading\nuseEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;function preventScroll(e){e.preventDefault();}if(loading&&scrollBlock&&!scrollBlockedRef.current){document.body.style.overflow=\"hidden\";window.addEventListener(\"wheel\",preventScroll,false);window.addEventListener(\"touchmove\",preventScroll,false);scrollBlockedRef.current=true;}else if((!loading||scrollBlock===false)&&scrollBlockedRef.current){document.body.style.overflow=\"\";window.removeEventListener(\"wheel\",preventScroll,false);window.removeEventListener(\"touchmove\",preventScroll,false);scrollBlockedRef.current=false;}return()=>{if(scrollBlockedRef.current){document.body.style.overflow=\"\";window.removeEventListener(\"wheel\",preventScroll,false);window.removeEventListener(\"touchmove\",preventScroll,false);scrollBlockedRef.current=false;}};},[loading,scrollBlock]);// Counting logic\nuseEffect(()=>{if(!loading||isStatic)return;if(count>=100){timerRef.current=setTimeout(()=>{startTransition(()=>setSwipe(true));timerRef.current=setTimeout(()=>{startTransition(()=>setLoading(false));},swipeDuration);},400);return;}timerRef.current=setTimeout(()=>{startTransition(()=>setCount(c=>c+1));},countSpeed);return()=>{if(timerRef.current)clearTimeout(timerRef.current);};},[count,loading,isStatic,countSpeed,swipeDuration]);// Clean up\nuseEffect(()=>{return()=>{if(timerRef.current)clearTimeout(timerRef.current);};},[]);// Positioning\nconst pos=positionMap[countPosition]||positionMap[\"bottom-right\"];const countPadding={paddingBottom:countPosition!==\"center\"?\"40px\":\"0\",paddingTop:countPosition!==\"center\"?\"40px\":\"0\",paddingLeft:countPosition!==\"center\"?\"40px\":\"0\",paddingRight:countPosition!==\"center\"?\"40px\":\"0\"};if(countPosition===\"bottom-right\"){countPadding.paddingTop=\"0\";countPadding.paddingLeft=\"0\";}else if(countPosition===\"bottom-left\"){countPadding.paddingTop=\"0\";countPadding.paddingRight=\"0\";}else if(countPosition===\"top-right\"){countPadding.paddingBottom=\"0\";countPadding.paddingLeft=\"0\";}else if(countPosition===\"top-left\"){countPadding.paddingBottom=\"0\";countPadding.paddingRight=\"0\";}else{countPadding.paddingBottom=\"0\";countPadding.paddingTop=\"0\";countPadding.paddingLeft=\"0\";countPadding.paddingRight=\"0\";}// Animation variants\nconst swipeEase=[.4,0,.2,1];const swipeVariants={initial:{y:0},animate:{y:\"-100%\",transition:{duration:swipeDuration/1e3,ease:swipeEase}},exit:{y:\"-100%\"}};// Count style\nconst countStyles={...countFont,color:countColor,fontVariantNumeric:countStyle===\"monospace\"?\"tabular-nums\":undefined,fontFamily:countStyle===\"monospace\"?\"monospace\":countFont?.fontFamily,fontWeight:countFont?.fontWeight,fontSize:countFont?.fontSize,letterSpacing:countFont?.letterSpacing,lineHeight:countFont?.lineHeight,textAlign:\"right\",textShadow:\"0 2px 8px rgba(0,0,0,0.08)\",margin:0,userSelect:\"none\",transition:\"color 0.3s, font-size 0.3s\"};// Loading screen\nreturn /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{children:loading&&/*#__PURE__*/_jsxs(motion.div,{initial:\"initial\",animate:swipe?\"animate\":\"initial\",exit:\"exit\",variants:swipeVariants,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",zIndex:10,background:useImage&&backgroundImage?.src?`url(${backgroundImage.src}) center/cover no-repeat`:backgroundColor,display:\"flex\",flexDirection:\"column\",justifyContent:pos.justifyContent,alignItems:pos.alignItems,transition:\"background 0.3s\"},\"aria-label\":\"Loading screen\",role:\"dialog\",\"aria-modal\":\"true\",tabIndex:0,\"aria-live\":\"polite\",\"aria-busy\":loading,onKeyDown:e=>{if(e.key===\"Escape\"&&loading){startTransition(()=>setLoading(false));}},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"3px\",background:\"rgba(0,0,0,0.08)\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(motion.div,{style:{height:\"100%\",background:countColor,width:`${count}%`},animate:swipe?undefined:{width:`${count}%`},transition:{duration:.15,ease:\"easeOut\"}})}),/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:pos.justifyContent,alignItems:pos.alignItems,pointerEvents:\"none\",...countPadding},children:/*#__PURE__*/_jsxs(\"span\",{style:{...countStyles},\"aria-live\":\"polite\",\"aria-atomic\":\"true\",tabIndex:0,children:[countPrefix,String(count).padStart(3,\"0\"),showPercent?\"%\":null,countSuffix]})})]},\"loader\")})});}addPropertyControls(LoadingScreen,{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},useImage:{type:ControlType.Boolean,title:\"Use Image\",defaultValue:false,enabledTitle:\"Image\",disabledTitle:\"Color\"},backgroundImage:{type:ControlType.ResponsiveImage,title:\"Image\",hidden:({useImage})=>!useImage},countFont:{type:ControlType.Font,title:\"Count Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"48px\",variant:\"Bold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},countColor:{type:ControlType.Color,title:\"Count Color\",defaultValue:\"#000000\"},countSpeed:{type:ControlType.Number,title:\"Count Speed (ms)\",defaultValue:18,min:5,max:200,step:1,displayStepper:true},countStyle:{type:ControlType.Enum,title:\"Count Style\",options:[\"default\",\"monospace\"],optionTitles:[\"Default\",\"Monospace\"],defaultValue:\"default\",displaySegmentedControl:true},countPrefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},countSuffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},showPercent:{type:ControlType.Boolean,title:\"Show %\",defaultValue:true},countPosition:{type:ControlType.Enum,title:\"Count Position\",options:[\"bottom-right\",\"bottom-left\",\"top-right\",\"top-left\",\"center\"],optionTitles:[\"Bottom Right\",\"Bottom Left\",\"Top Right\",\"Top Left\",\"Center\"],defaultValue:\"bottom-right\",displaySegmentedControl:false},swipeDuration:{type:ControlType.Number,title:\"Swipe Duration (ms)\",defaultValue:700,min:200,max:2e3,step:10,displayStepper:true},scrollBlock:{type:ControlType.Boolean,title:\"Block Scroll\",defaultValue:true,enabledTitle:\"Block\",disabledTitle:\"Allow\"}})// Documentation:\n// - Background: Use 'Background' color or enable 'Use Image' and select an image.\n// - Counting: Adjust 'Count Speed (ms)', 'Count Font', 'Count Color', 'Count Style', 'Prefix', 'Suffix', and 'Show %'.\n// - Animation: 'Swipe Duration (ms)' controls the reveal speed. All transitions are smooth and use Framer Motion.\n// - Text Position: Use 'Count Position' to place the number (bottom-right, bottom-left, top-right, top-left, center).\n// - Content: Place your page content in the 'Content' slot. It will be revealed after loading.\n// - Optimized for performance: Animations are paused in static/preview mode, and timers are cleaned up properly.\n;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoadingScreen\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoadingScreen_2.map"],"mappings":"oRAUG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,kBAAgB,kBAAgB,EAAe,WAAS,YAAU,aAAW,aAAW,aAAW,cAAY,cAAY,gBAAc,cAAY,gBAAc,QAAM,cAAY,IAAM,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAK,CAAM,CAAC,EAAM,GAAUA,EAAS,GAAM,CAAO,EAAS,GAAqB,CAAO,EAASC,EAAO,KAAK,CAAO,EAAiBA,EAAO,GAAM,CAC7c,MAAc,CAAC,GAAU,IAAS,QAAa,OAAO,SAAW,IAAY,OAAO,SAAS,EAAc,EAAE,CAAC,EAAE,gBAAgB,CAAge,OAA3d,GAAS,GAAa,CAAC,EAAiB,SAAS,SAAS,KAAK,MAAM,SAAS,SAAS,EAAO,iBAAiB,QAAQ,EAAc,GAAM,CAAC,EAAO,iBAAiB,YAAY,EAAc,GAAM,CAAC,EAAiB,QAAQ,KAAe,CAAC,GAAS,IAAc,KAAQ,EAAiB,UAAS,SAAS,KAAK,MAAM,SAAS,GAAG,EAAO,oBAAoB,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