{"version":3,"file":"TemperatureDisplay.BgA37F5F.mjs","names":["useState","_Fragment","useState","_Fragment","__esmMin","window","te","init_ssg_sandbox_shims","init_npm_react_18_3_1","ce","init_jsx_runtime","p","_e","init_framer_DKWANagr","addPropertyControls","ControlType","MelbourneTimeDisplay","props","time","setTime","updateTime","melbourneTime","hours","minutes","ampm","formattedTime","interval","textColor","font","l","init_MelbourneTimeDisplay","getWeatherDescription","code","TemperatureDisplay","temperature","setTemperature","weatherCode","setWeatherCode","loading","setLoading","error","setError","controller","timeoutId","response","data","temp","displayText","testMode","init_TemperatureDisplay"],"sources":["https:/framerusercontent.com/modules/ppK7kcnROaBuwjUGiyZi/Xr0cC4O6jhwuFR2V84hc/MelbourneTimeDisplay.js","https:/framerusercontent.com/modules/CxoTFXBpC6zJCCZ16Dc6/zxsNxKvL7LeazizKzdaJ/TemperatureDisplay.js"],"sourcesContent":["// Display current time in Melbourne, Australia in 12-hour format (HH:MM)\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function MelbourneTimeDisplay(props){const{textColor,font}=props;const[time,setTime]=useState(\"\");useEffect(()=>{if(typeof window===\"undefined\")return;const updateTime=()=>{const now=new Date;const melbourneTime=new Date(now.toLocaleString(\"en-US\",{timeZone:\"Australia/Melbourne\"}));let hours=melbourneTime.getHours();const minutes=melbourneTime.getMinutes();const ampm=hours>=12?\"PM\":\"AM\";hours=hours%12;hours=hours?hours:12;const formattedTime=`${hours.toString().padStart(2,\"0\")}:${minutes.toString().padStart(2,\"0\")} ${ampm}`;startTransition(()=>setTime(formattedTime));};updateTime();const interval=setInterval(updateTime,1e3);return()=>clearInterval(interval);},[]);return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,...font,textTransform:\"uppercase\",fontFamily:'\"new-atten\", \"Source Sans 3\", sans-serif',whiteSpace:\"nowrap\"},children:time?/*#__PURE__*/_jsxs(_Fragment,{children:[time.split(\":\")[0],/*#__PURE__*/_jsx(\"span\",{style:{animation:\"flash 1s infinite\"},children:\":\"}),time.split(\":\")[1]]}):\"Loading...\"}),/*#__PURE__*/_jsx(\"style\",{children:`\n                    @keyframes flash {\n                        0%, 49% { opacity: 1; }\n                        50%, 100% { opacity: 0; }\n                    }\n                `})]});}addPropertyControls(MelbourneTimeDisplay,{textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MelbourneTimeDisplay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MelbourneTimeDisplay.map","// Temperature display for Melbourne, Australia in Celsius\n// Shows current temperature in format: XX° C with weather description\n// Customizable font and text color, no background or padding\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";function getWeatherDescription(code){if(code===0)return\"Clear skies\";if(code>=1&&code<=2)return\"Clear skies\";if(code===3)return\"Somewhat cloudy\";if(code===4)return\"Decidedly grey\";if(code>=5&&code<=6)return\"Rather foggy\";if(code>=7&&code<=9)return\"Melbourne Drizzle\";if(code>=10&&code<=11)return\"Improbably frozen drizzle\";if(code===12)return\"Light rain\";if(code===13)return\"Proper rain\";if(code===14)return\"Decidedly rainy\";if(code>=15&&code<=16)return\"Frozen rain\";if(code>=17&&code<=20)return\"Unexpectedly snowy\";if(code===21)return\"Passing showers\";if(code===22)return\"Patchy showers\";if(code===23)return\"Emphatic showers\";if(code>=24&&code<=25)return\"Unlikely snow showers\";if(code===26)return\"Theatrically stormy\";if(code===27)return\"Theatrical with hail\";if(code===28)return\"Dramatic hail\";return\"Unknown conditions\";}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function TemperatureDisplay(props){const{textColor,font,testMode}=props;const[temperature,setTemperature]=useState(null);const[weatherCode,setWeatherCode]=useState(null);const[loading,setLoading]=useState(true);const[error,setError]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const fetchTemperature=async()=>{try{// Add timeout to prevent hanging\nconst controller=new AbortController;const timeoutId=setTimeout(()=>controller.abort(),5e3);const response=await fetch(\"https://api.open-meteo.com/v1/forecast?latitude=-37.8136&longitude=144.9631&current=temperature_2m,weather_code&temperature_unit=celsius\",{signal:controller.signal});clearTimeout(timeoutId);const data=await response.json();if(data.current&&typeof data.current.temperature_2m===\"number\"){const temp=Math.round(data.current.temperature_2m);const code=data.current.weather_code;// Cache the result\nlocalStorage.setItem(\"melbourne-temp\",JSON.stringify({temperature:temp,weatherCode:code,timestamp:Date.now()}));startTransition(()=>{setTemperature(temp);setWeatherCode(code);setLoading(false);});}else{startTransition(()=>{setError(true);setLoading(false);});}}catch(err){startTransition(()=>{setError(true);setLoading(false);});}};fetchTemperature();},[]);const displayText=loading?\"Loading...\":error?\"Error\":testMode?\"20\\xb0 C • Melbourne Drizzle\":temperature!==null&&weatherCode!==null?`${temperature}\\xb0 C • ${getWeatherDescription(weatherCode)}`:\"Loading...\";return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"link\",{rel:\"dns-prefetch\",href:\"https://api.open-meteo.com\"}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,width:\"max-content\",textTransform:\"uppercase\",...font,fontFamily:'\"new-atten\", \"Source Sans 3\", sans-serif'},children:displayText})]});}addPropertyControls(TemperatureDisplay,{testMode:{type:ControlType.Boolean,title:\"Test Mode\",defaultValue:false,enabledTitle:\"Longest\",disabledTitle:\"Live\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TemperatureDisplay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TemperatureDisplay.map"],"mappings":"A,oNAIG,SAAwBgB,EAAqB,EAAM,CAAC,GAAK,CAAC,YAAU,QAAMC,EAAW,CAACC,EAAKC,GAASnB,EAAS,EAAE,EAAgkB,OAA9jBS,MAAc,CAAC,GAAUJ,IAAS,OAAY,OAAO,IAAMe,MAAe,CAAoB,IAAMC,EAAc,IAAI,sBAAK,IAAlC,KAAoC,EAAA,CAAE,eAAe,QAAQ,CAAC,SAAS,qBAAqB,CAAC,CAAC,EAAMC,EAAMD,EAAc,SAAS,EAAQE,EAAQF,EAAc,WAAW,EAAQG,EAAKF,GAAO,GAAG,KAAK,KAAK,GAAY,GAAG,IAAkB,GAAG,IAAMG,EAAc,GAAGH,EAAM,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAGC,EAAQ,SAAS,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAGC,IAAOlB,MAAoBa,EAAQM,CAAa,CAAC,CAAE,EAAEL,EAAW,EAAE,IAAMM,EAAS,YAAYN,EAAW,GAAG,EAAE,UAAU,cAAcM,CAAQ,CAAE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