{"version":3,"file":"AnalogClock.Djime5FP.mjs","names":["useState","useRef","__esmMin","de","te","init_npm_react_18_3_1","ce","window","init_ssg_sandbox_shims","_e","init_jsx_runtime","init_framer_D6uXRwWs","addPropertyControls","ControlType","useIsStaticRenderer","AnalogClock","props","isStatic","now","setNow","timer","secondActive","radius","borderWidth","hourVal","minuteVal","second","hourAngle","minuteAngle","secondAngle","hourLen","minLen","secLen","ticks","showTicks","angle","i","x1","y1","x2","y2","tickColor","style","background","borderColor","hourColor","minuteColor","secondColor","init_AnalogClock"],"sources":["https:/framerusercontent.com/modules/5MzbpGt7x7YP17hjnH70/HXGb3sjH17vC78Ar1rO5/AnalogClock.js"],"sourcesContent":["// Flat analog clock with animation\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Flat Analog Clock\n *\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 240\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function AnalogClock(props){const{background,hourColor,minuteColor,secondColor,borderColor,borderWidth,tickColor,showTicks,secondActive,style}=props;const isStatic=useIsStaticRenderer();// Saat 10:10 göster\nconst[now,setNow]=useState(new Date(2020,0,1,10,10,0));const timer=useRef();useEffect(()=>{if(secondActive&&!isStatic){// saniye animasyonu aktifse gerçek zamanlı güncelle\ntimer.current=window.setInterval(()=>{startTransition(()=>{setNow(new Date);});},1e3);return()=>{if(timer.current)window.clearInterval(timer.current);};}else{// pasif ise sadece hour/minute güncel tut\nstartTransition(()=>{setNow(new Date(2020,0,1,10,10,0));});if(timer.current)window.clearInterval(timer.current);}},[secondActive,isStatic]);const size=240;const center=size/2;const radius=center-borderWidth;const hourVal=now.getHours()%12;const minuteVal=now.getMinutes();const second=now.getSeconds();// Angles\nconst hourAngle=(hourVal+minuteVal/60)*30;const minuteAngle=(minuteVal+second/60)*6;const secondAngle=second*6;// Hand lengths\nconst hourLen=radius*.5;const minLen=radius*.75;const secLen=radius*.85;// Hand widths\nconst hourW=6;const minW=4;const secW=2;// Ticks\nconst ticks=showTicks?Array.from({length:12}).map((_,i)=>{const angle=(i*30-90)*(Math.PI/180);const x1=center+Math.cos(angle)*(radius-8);const y1=center+Math.sin(angle)*(radius-8);const x2=center+Math.cos(angle)*(radius-2);const y2=center+Math.sin(angle)*(radius-2);return /*#__PURE__*/_jsx(\"line\",{x1:x1,y1:y1,x2:x2,y2:y2,stroke:tickColor,strokeWidth:3,strokeLinecap:\"round\"},i);}):null;return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"transparent\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:`0 0 ${size} ${size}`,style:{display:\"block\"},\"aria-label\":\"Analog Clock\",role:\"img\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:center,cy:center,r:radius,fill:background,stroke:borderColor,strokeWidth:borderWidth}),ticks,/*#__PURE__*/_jsx(\"line\",{x1:center,y1:center,x2:center+hourLen*Math.cos(Math.PI/180*(hourAngle-90)),y2:center+hourLen*Math.sin(Math.PI/180*(hourAngle-90)),stroke:hourColor,strokeWidth:hourW,strokeLinecap:\"round\"}),/*#__PURE__*/_jsx(\"line\",{x1:center,y1:center,x2:center+minLen*Math.cos(Math.PI/180*(minuteAngle-90)),y2:center+minLen*Math.sin(Math.PI/180*(minuteAngle-90)),stroke:minuteColor,strokeWidth:minW,strokeLinecap:\"round\"}),/*#__PURE__*/_jsx(\"line\",{x1:center,y1:center,x2:center+secLen*Math.cos(Math.PI/180*(secondAngle-90)),y2:center+secLen*Math.sin(Math.PI/180*(secondAngle-90)),stroke:secondColor,strokeWidth:secW,strokeLinecap:\"round\"}),/*#__PURE__*/_jsx(\"circle\",{cx:center,cy:center,r:6,fill:secondColor})]})});}addPropertyControls(AnalogClock,{background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},hourColor:{type:ControlType.Color,title:\"Hour Hand\",defaultValue:\"#222222\"},minuteColor:{type:ControlType.Color,title:\"Minute Hand\",defaultValue:\"#666666\"},secondColor:{type:ControlType.Color,title:\"Second Hand\",defaultValue:\"#FF3B30\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#E0E0E0\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:4,min:0,max:16,step:1,unit:\"px\"},tickColor:{type:ControlType.Color,title:\"Tick Color\",defaultValue:\"#E0E0E0\"},showTicks:{type:ControlType.Boolean,title:\"Show Ticks\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},secondActive:{type:ControlType.Boolean,title:\"Second Anim.\",defaultValue:false,enabledTitle:\"Active\",disabledTitle:\"Passive\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnalogClock\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"240\",\"framerIntrinsicWidth\":\"240\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnalogClock.map"],"mappings":"A,uNASG,SAAwBe,EAAY,EAAM,CAAC,GAAK,CAAC,aAAW,YAAU,cAAY,cAAY,cAAY,cAAY,YAAU,YAAU,eAAa,SAAOC,EAAYC,EAASH,EAAoB,EACrM,CAACI,EAAIC,GAAQnB,EAAS,IAAI,KAAK,KAAK,EAAE,EAAE,GAAG,GAAG,CAAC,CAAC,EAAQoB,EAAMnB,EAAO,EAAEK,MAAc,CAAC,GAAGe,GAAc,CAACJ,EACvB,MAAtF,GAAM,QAAQV,EAAO,gBAAgB,CAACH,MAAoB,CAACe,kBAAO,IAAI,IAAI,CAAE,CAAC,CAAE,EAAE,GAAG,MAAY,CAAIC,E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