\n \n
\n \n ').concat(Math.round(9*t.temp.max/5+32),'°\n \n ').concat(Math.round(9*t.temp.min/5+32),"°\n \n
\n \n "))}),o+="",a.innerHTML=o}function o(t){var e="https://api.openweathermap.org/data/2.5/weather?q=".concat(t,"&appid=").concat("33f351bd7209dbba62885dd5a5e97fb4","&units=metric");axios.get(e).then(function(t){i(t);t.data.coord.lat,t.data.coord.lon;d(t.data.coord)})}function d(t){console.log(t);var e="https://api.openweathermap.org/data/2.5/onecall?lat=".concat(t.lat,"&lon=").concat(t.lon,"&appid=").concat("2bd326a60dc89a53287e446e819664df","&units=metric");axios.get(e).then(a),console.log(e)}function i(t){var e=Math.round(t.data.main.temp),n=Math.round(9*e/5+32);document.querySelector("#selectedCity").innerHTML=t.data.name;var a=document.getElementById("temperatureDisplay");a.textContent="".concat(n),a.classList.remove("hidden"),document.getElementById("toCelsius").classList.add("hidden"),document.getElementById("toFahrenheit").classList.remove("hidden");t.data.weather[0].main;var o=document.getElementById("weatherDescription");o.textContent=t.data.weather[0].main,o.classList.remove("hidden");var d=document.querySelector("#icon");d.setAttribute("src","https://openweathermap.org/img/wn/".concat(t.data.weather[0].icon,"@2x.png")),"d"===t.data.weather[0].icon.slice(-1)?(d.classList.add("weather-icon-day"),d.classList.remove("weather-icon-night")):(d.classList.add("weather-icon-night"),d.classList.remove("weather-icon-day"));var i=t.data.rain?t.data.rain["1h"]||t.data.rain["3h"]:"0",c=t.data.main.humidity,r=t.data.wind.speed;document.getElementById("weatherPrecipitation").textContent="Precipitation: ".concat(i," mm"),document.getElementById("weatherPrecipitation").classList.remove("hidden"),document.getElementById("weatherHumidity").textContent="Humidity: ".concat(c,"%"),document.getElementById("weatherHumidity").classList.remove("hidden"),document.getElementById("weatherWind").textContent="Wind: ".concat(r," m/s"),document.getElementById("weatherWind").classList.remove("hidden")}function c(t){console.log(t.coords.latitude,t.coords.longitude),o(t.coords.latitude,t.coords.longitude)}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===t||null===e)return navigator.geolocation?void navigator.geolocation.getCurrentPosition(function(t){r(t.coords.latitude,t.coords.longitude)}):void alert("Geolocation is not supported by this browser.");var n="https://api.openweathermap.org/data/2.5/weather?lat=".concat(t,"&lon=").concat(e,"&appid=").concat("33f351bd7209dbba62885dd5a5e97fb4","&units=metric");axios.get(n).then(function(t){var e=Math.round(t.data.main.temp),n=Math.round(9*e/5+32),a=t.data.name,o=document.querySelector("#main-heading");o.innerHTML="It is ".concat(n,"°F (").concat(e,"°C) in ").concat(a),o.classList.remove("hidden")})}navigator.geolocation.getCurrentPosition(c),document.getElementById("localButton").addEventListener("click",function(){r()}),document.getElementById("searchButton").addEventListener("click",n),document.getElementById("cityInput").addEventListener("keyup",function(t){"Enter"===t.key&&n()});