From 38d0fffdce4bf5e8cd10515b847325abb63926e3 Mon Sep 17 00:00:00 2001 From: Leandro Date: Mon, 27 May 2019 14:11:17 +0800 Subject: [PATCH] Updated --- css/style.css | 4 ++-- js/localweather.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index 9184f2e..6ee318a 100644 --- a/css/style.css +++ b/css/style.css @@ -21,7 +21,7 @@ body { border: 5px solid #009f9f; border-radius: 20px; line-height: 1.5; - margin: 1rem auto; + margin: 0.5rem auto; min-width: 300px; width: 80%; text-align: center; @@ -62,13 +62,13 @@ section .container { } .dspIcon { + display: none; width: 5.5rem; } #dspWeather { font-size: 1.25rem; font-weight: bold; - margin-top: -1rem; } #dspTemp { diff --git a/js/localweather.js b/js/localweather.js index 093ce4b..e94b8bd 100755 --- a/js/localweather.js +++ b/js/localweather.js @@ -60,8 +60,6 @@ async function getWeatherInfo(lat, lon) { displayWeather(loc, icon, weather, temp, sunrise_time, sunset_time, wind); } catch (ex) { - $('.dspIcon').css({'display': 'none'}); - $('#dspWeather').css({'margin-top': 'auto'}); alert(`An error has occurred.\nPlease try again later.`); } } @@ -69,7 +67,9 @@ async function getWeatherInfo(lat, lon) { function displayWeather(loc, icon, weather, temp, sunrise, sunset, wind) { $("#dspLoc").html(loc); + $('.dspIcon').css({'display': 'inline'}); $(".dspIcon").attr("src", icon); + $("#dspWeather").css({'margin-top': '-1rem'}); $("#dspWeather").html(weather); $("#dspTempValue").html(temp); $("#dspSunriseTime").html(sunrise);