{"version":3,"file":"AnalogClock.RefhrMSx.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/rTsvkFMRNMRAiQIeDxAQ/2uTtiqMhRqkMznBndfmk/AnalogClock.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Component made by Eleveight Supply, All rights reserved.\n/**\n\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth 100%\n * @framerSupportedLayoutHeight 100%\n */export default function AnalogClock({clockSettings:{timezone,clockSize,border:{showBorder,clockColor,borderWidth,borderRadius},background:{showBackground,backgroundColor}},hands:{showSecondHand,hourHand:{hourHandThickness,hourHandColor},minuteHand:{minuteHandThickness,minuteHandColor},secondHand:{secondHandThickness,secondHandColor}},markers:{markerStyle,markerColor,markerPadding},centerDot:{centerDotColor,centerDotSize}}){const[time,setTime]=useState(new Date);useEffect(()=>{const intervalId=setInterval(()=>{const now=new Date().toLocaleString(\"en-US\",{timeZone:timezone});setTime(new Date(now));},1e3);return()=>clearInterval(intervalId);},[timezone])// Add timezone as a dependency\n;const secondsDegrees=time.getSeconds()/60*360;const minutesDegrees=time.getMinutes()/60*360+secondsDegrees/60;const hoursDegrees=time.getHours()%12*30+minutesDegrees/12;const clockStyle={width:`${clockSize}px`,height:`${clockSize}px`,border:showBorder?`${borderWidth}px solid ${clockColor}`:\"none\",backgroundColor:showBackground?backgroundColor:\"transparent\",borderRadius:`${borderRadius}%`,position:\"relative\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};const handStyle=(width,height,color,zIndex=8)=>({width:`${width}px`,height:`${height}%`,backgroundColor:color,position:\"absolute\",top:\"50%\",left:\"50%\",transformOrigin:\"50% 100%\",borderRadius:\"2px\",zIndex});const markerStyleFunction=(i,type)=>{const angle=(i-3)*30// Offset by 3 to start at the top\n;const radians=Math.PI/180*angle;const radius=clockSize/2.2-markerPadding;const x=radius*Math.cos(radians);const y=radius*Math.sin(radians);const commonStyle={position:\"absolute\",left:`calc(50% + ${x}px)`,top:`calc(50% + ${y}px)`,transform:\"translate(-50%, -50%)\",color:markerColor,zIndex:1};if(type===\"numbers\"){return{...commonStyle,fontSize:`${clockSize/12}px`};}else if(type===\"lines\"){return{...commonStyle,width:`${clockSize/50}px`,height:`${clockSize/15}px`,backgroundColor:markerColor,transform:`translate(-50%, -50%) rotate(${angle+90}deg)`,borderRadius:\"4px\"};}else if(type===\"dots\"){return{...commonStyle,width:`${clockSize/30}px`,height:`${clockSize/30}px`,borderRadius:\"50%\",backgroundColor:markerColor};}return{};};const renderMarkers=()=>{if(markerStyle===\"none\")return null;return Array.from({length:12}).map((_,i)=>{const number=i===0?12:i// Correct mapping for 12-hour clock\n;return /*#__PURE__*/_jsx(\"div\",{style:markerStyleFunction(i,markerStyle),children:markerStyle===\"numbers\"?number:\"\"},i);});};return /*#__PURE__*/_jsxs(\"div\",{style:clockStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:{...handStyle(hourHandThickness,35,hourHandColor),transform:`translate(-50%, -100%) rotate(${hoursDegrees}deg)`}}),/*#__PURE__*/_jsx(\"div\",{style:{...handStyle(minuteHandThickness,40,minuteHandColor),transform:`translate(-50%, -100%) rotate(${minutesDegrees}deg)`}}),showSecondHand&&/*#__PURE__*/_jsx(\"div\",{style:{...handStyle(secondHandThickness,45,secondHandColor),transform:`translate(-50%, -100%) rotate(${secondsDegrees}deg)`}}),renderMarkers(),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:`${centerDotSize}px`,height:`${centerDotSize}px`,backgroundColor:centerDotColor,borderRadius:\"50%\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",zIndex:10}})]});}AnalogClock.defaultProps={clockSettings:{timezone:\"America/New_York\",clockSize:120,border:{showBorder:true,clockColor:\"#525252\",borderWidth:1,borderRadius:50},background:{showBackground:true,backgroundColor:\"#333333\"}},hands:{showSecondHand:true,hourHand:{hourHandThickness:3,hourHandColor:\"#EDEDED\"},minuteHand:{minuteHandThickness:2,minuteHandColor:\"#333\"},secondHand:{secondHandThickness:1,secondHandColor:\"red\"}},markers:{markerStyle:\"numbers\",markerColor:\"#8A8A8A\",markerPadding:10},centerDot:{centerDotColor:\"#8A8A8A\",centerDotSize:6}};addPropertyControls(AnalogClock,{clockSettings:{type:ControlType.Object,title:\"Clock\",controls:{timezone:{type:ControlType.String,title:\"Timezone\",defaultValue:\"America/New_York\",description:\"Use a timezone identifier ie: 'America/Los_Angeles' [Full list here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)\"},clockSize:{type:ControlType.Number,title:\"Size\",min:50,max:400,defaultValue:200},border:{type:ControlType.Object,title:\"Border\",controls:{showBorder:{type:ControlType.Boolean,title:\"Show\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},clockColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#525252\",hidden:props=>!props.clockSettings.border.showBorder},borderWidth:{type:ControlType.Number,title:\"Thickness\",min:0,max:20,defaultValue:1,displayStepper:true,hidden:props=>!props.clockSettings.border.showBorder},borderRadius:{type:ControlType.Number,title:\"Radius\",min:0,max:50,defaultValue:50,displayStepper:true}}},background:{type:ControlType.Object,title:\"Background\",controls:{showBackground:{type:ControlType.Boolean,title:\"Show\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},backgroundColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#333333\",hidden:props=>!props.clockSettings.background.showBackground}}}}},hands:{type:ControlType.Object,title:\"Hands\",controls:{showSecondHand:{type:ControlType.Boolean,title:\"Show\",defaultValue:true},hourHand:{type:ControlType.Object,title:\"Hour\",controls:{hourHandThickness:{type:ControlType.Number,title:\"Thickness\",min:1,max:20,defaultValue:3,displayStepper:true},hourHandColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#EDEDED\"}}},minuteHand:{type:ControlType.Object,title:\"Minute\",controls:{minuteHandThickness:{type:ControlType.Number,title:\"Thickness\",min:1,max:20,defaultValue:2,displayStepper:true},minuteHandColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#8A8A8A\"}}},secondHand:{type:ControlType.Object,title:\"Second\",controls:{secondHandThickness:{type:ControlType.Number,title:\"Thickness\",min:1,max:20,defaultValue:1,displayStepper:true},secondHandColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"red\"}}}}},markers:{type:ControlType.Object,title:\"Markers\",controls:{markerStyle:{type:ControlType.Enum,title:\"Style\",options:[\"numbers\",\"lines\",\"dots\",\"none\"],optionTitles:[\"Numbers\",\"Lines\",\"Dots\",\"None\"],defaultValue:\"numbers\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},markerColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#8A8A8A\"},markerPadding:{type:ControlType.Number,title:\"Edge Offset\",min:0,max:50,defaultValue:8,displayStepper:true}}},centerDot:{type:ControlType.Object,title:\"Center Dot\",controls:{centerDotColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#8A8A8A\"},centerDotSize:{type:ControlType.Number,title:\"Size\",min:2,max:20,defaultValue:6,displayStepper:true}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnalogClock\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"100%\",\"framerSupportedLayoutWidth\":\"100%\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnalogClock.map"],"mappings":"yLAOG,SAAwB,EAAY,CAAC,cAAc,CAAC,WAAS,YAAU,OAAO,CAAC,aAAW,aAAW,cAAY,gBAAc,WAAW,CAAC,iBAAe,oBAAkB,MAAM,CAAC,iBAAe,SAAS,CAAC,oBAAkB,iBAAe,WAAW,CAAC,sBAAoB,mBAAiB,WAAW,CAAC,sBAAoB,oBAAkB,QAAQ,CAAC,cAAY,cAAY,iBAAe,UAAU,CAAC,iBAAe,kBAAgB,CAAC,GA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