text: !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){let n,r,o,c,u,a;const l=e=>{fetch(`http://api.openweathermap.org/data/2.5/weather?q=${e}&APPID=0b91ec70e5e1e568bad92f3363c60c34&units=metric`).then(e=>e.json()).then(e=>{c=e.name,n=e.weather[0].description,r=e.sys.country,o=e.main.temp}).then(()=>fetch(`http://api.openweathermap.org/data/2.5/weather?q=${e}&APPID=0b91ec70e5e1e568bad92f3363c60c34&units=imperial`)).then(e=>e.json()).then(e=>{a=e.main.temp}).then(()=>(()=>{const e=document.querySelector(".card");e.style.opacity="0";const t=document.body;o<300&&(t.style.background="linear-gradient(225deg, rgba(58,180,159,1) 0%, rgba(29,253,75,1) 50%, rgba(255,203,1,1) 100%)"),o>290&&(t.style.background="linear-gradient(225deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 50%, rgba(199,69,252,1) 100%)"),o>304&&(t.style.background="linear-gradient(225deg, rgba(79,58,180,1) 0%, rgba(253,29,175,1) 50%, rgba(255,1,1,1) 100%)"),setTimeout(()=>{e.style.opacity="1"},300)})()).then(()=>((e,t,r)=>{const c=document.querySelector("#city"),l=document.querySelector("#temp-description"),d=document.querySelector("#country"),i=document.querySelector("#temp"),s=document.querySelector(".card-body");[c.textContent,l.textContent,d.textContent]=[e,t,r],i.textContent="c"===u?`${o} C`:`${a} F`,"few clouds"===n&&(s.style.backgroundImage='url("./fewclouds.jpg")'),"clear sky"===n&&(s.style.backgroundImage='url("./sunny.jpg")'),"broken clouds"===n&&(s.style.backgroundImage='url("./cloudy.jpg")'),"scattered clouds"===n&&(s.style.backgroundImage='url("./cloudy.jpg")'),"light rain"===n&&(s.style.backgroundImage='url("./rainy.jpg")'),"overcast clouds"===n&&(s.style.backgroundImage='url("./rainy.jpg")')})(c,n,r)).catch(e=>console.log(e))};document.querySelector("form").addEventListener("submit",(function(e){e.preventDefault();const t=document.querySelector("#search-input").value;l(t)}));document.querySelector("#switch-1").addEventListener("click",e=>{const t=e.target.checked,n=document.querySelector("#temp");t?(u="f",n.textContent=`${a} F`):(u="c",n.textContent=`${o} C`)})}]);