{"version":3,"file":"CountdownTimer_1.CuMbPSf7.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/v21dRsYdNtN8vRdEGANF/J6TFyCVliFMDWlLai6zt/CountdownTimer_1.js"],"sourcesContent":["// Countdown timer displaying minutes and seconds in \"MM:SS\" format (e.g., \"14:59\")\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useInView}from\"framer-motion\";/**\n * Countdown Timer displaying minutes and seconds in \"MM:SS\" format\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 80\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function CountdownTimer(props){const{textColor,timerFont,style,animationType,animationDuration}=props;const[timeLeft,setTimeLeft]=useState(900);const[isVisible,setIsVisible]=useState(false);const ref=useRef(null);const isInView=useInView(ref,{once:true,margin:\"-100px\"});useEffect(()=>{if(isInView){const timer=setTimeout(()=>{startTransition(()=>setIsVisible(true));},100);return()=>clearTimeout(timer);}},[isInView]);useEffect(()=>{const interval=setInterval(()=>{startTransition(()=>setTimeLeft(prev=>Math.max(0,prev-1)));},1e3);return()=>clearInterval(interval);},[]);const minutes=Math.floor(timeLeft/60);const seconds=timeLeft%60;const getAnimationStyle=()=>{const duration=animationDuration/1e3;if(!isVisible){switch(animationType){case\"fadeIn\":return{opacity:0,transition:`opacity ${duration}s ease-out`};case\"slideUp\":return{opacity:0,transform:\"translateY(20px)\",transition:`all ${duration}s ease-out`};case\"slideDown\":return{opacity:0,transform:\"translateY(-20px)\",transition:`all ${duration}s ease-out`};case\"slideLeft\":return{opacity:0,transform:\"translateX(20px)\",transition:`all ${duration}s ease-out`};case\"slideRight\":return{opacity:0,transform:\"translateX(-20px)\",transition:`all ${duration}s ease-out`};case\"scale\":return{opacity:0,transform:\"scale(0.8)\",transition:`all ${duration}s ease-out`};case\"bounce\":return{opacity:0,transform:\"scale(0.3)\",transition:`all ${duration}s cubic-bezier(0.68, -0.55, 0.265, 1.55)`};default:return{opacity:1};}}else{return{opacity:1,transform:\"translateY(0px) translateX(0px) scale(1)\",transition:`all ${duration}s ${animationType===\"bounce\"?\"cubic-bezier(0.68, -0.55, 0.265, 1.55)\":\"ease-out\"}`};}};const formattedTime=`${String(minutes).padStart(2,\"0\")}:${String(seconds).padStart(2,\"0\")}`;return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style,display:\"flex\",alignItems:\"center\",justifyContent:\"flex-start\",color:textColor,textAlign:\"left\",width:\"100%\",boxSizing:\"border-box\",...getAnimationStyle()},children:/*#__PURE__*/_jsx(\"span\",{style:{...timerFont,color:textColor,width:\"max-content\"},children:formattedTime})});}addPropertyControls(CountdownTimer,{textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},timerFont:{type:ControlType.Font,title:\"Timer Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:48,variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"}},animationType:{type:ControlType.Enum,title:\"Animation Type\",options:[\"none\",\"fadeIn\",\"slideUp\",\"slideDown\",\"slideLeft\",\"slideRight\",\"scale\",\"bounce\"],optionTitles:[\"None\",\"Fade In\",\"Slide Up\",\"Slide Down\",\"Slide Left\",\"Slide Right\",\"Scale\",\"Bounce\"],defaultValue:\"fadeIn\"},animationDuration:{type:ControlType.Number,title:\"Duration\",defaultValue:600,min:100,max:2e3,step:100,unit:\"ms\",hidden:({animationType})=>animationType===\"none\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CountdownTimer\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerIntrinsicHeight\":\"80\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CountdownTimer_1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