更新天气图标

hotfix/paypal-note
LiaoYijun 4 years ago
parent 9ac5c6bca6
commit f595fbb3ea

@ -8,7 +8,7 @@
<p id="todayDate">...</p>
<p id="todayTemperature">...</p>
<div class="infoimage weather_img"><img alt="" class="img-responsive" id="todayIcon"
src="http://openweathermap.org/img/wn/50d.png" /></div>
src="https://data.chinahighlights.com/image/weather/icon-weather/50d.png" /></div>
<p id="todayCondition">...</p>
<p id="todayHumidity">Humidity: ...</p>
<p id="todayWind">Wind: ...</p>
@ -20,7 +20,7 @@
<p id="forecastDate1">...</p>
<p id="forecastTemperature1">...</p>
<div class="infoimage weather_img"><img alt="" class="img-responsive" id="forecastIcon1"
src="http://openweathermap.org/img/wn/50d.png" /></div>
src="https://data.chinahighlights.com/image/weather/icon-weather/50d.png" /></div>
<p id="forecastCondition1">...</p>
<p id="forecastHumidity1">Humidity: ...</p>
<p id="forecastWind1">Wind: ...</p>
@ -32,7 +32,7 @@
<p id="forecastDate2">...</p>
<p id="forecastTemperature2">...</p>
<div class="infoimage weather_img"><img alt="" class="img-responsive" id="forecastIcon2"
src="http://openweathermap.org/img/wn/50d.png" /></div>
src="https://data.chinahighlights.com/image/weather/icon-weather/50d.png" /></div>
<p id="forecastCondition2">...</p>
<p id="forecastHumidity2">Humidity: ...</p>
<p id="forecastWind2">Wind: ...</p>
@ -44,7 +44,7 @@
<p id="forecastDate3">...</p>
<p id="forecastTemperature3">...</p>
<div class="infoimage weather_img"><img alt="" class="img-responsive" id="forecastIcon3"
src="http://openweathermap.org/img/wn/50d.png" /></div>
src="https://data.chinahighlights.com/image/weather/icon-weather/50d.png" /></div>
<p id="forecastCondition3">...</p>
<p id="forecastHumidity3">Humidity: ...</p>
<p id="forecastWind3">Wind: ...</p>
@ -56,7 +56,7 @@
<p id="forecastDate4">...</p>
<p id="forecastTemperature4">...</p>
<div class="infoimage weather_img"><img alt="" class="img-responsive" id="forecastIcon4"
src="http://openweathermap.org/img/wn/50d.png" /></div>
src="https://data.chinahighlights.com/image/weather/icon-weather/50d.png" /></div>
<p id="forecastCondition4">...</p>
<p id="forecastHumidity4">Humidity: ...</p>
<p id="forecastWind4">Wind: ...</p>
@ -68,7 +68,7 @@
<p id="forecastDate5">...</p>
<p id="forecastTemperature5">...</p>
<div class="infoimage weather_img"><img alt="" class="img-responsive" id="forecastIcon5"
src="http://openweathermap.org/img/wn/50d.png" /></div>
src="https://data.chinahighlights.com/image/weather/icon-weather/50d.png" /></div>
<p id="forecastCondition5">...</p>
<p id="forecastHumidity5">Humidity: ...</p>
<p id="forecastWind5">Wind: ...</p>
@ -103,7 +103,7 @@ fetch(weatherUrl)
let todayDate = new Date(json.dt * 1000);
document.getElementById('todayDate').innerText = formatDate(todayDate);
document.getElementById('todayTemperature').innerText = Math.round(json.main.temp) + '°C';
document.getElementById('todayIcon').src = 'http://openweathermap.org/img/wn/' + json.weather[0].icon + '.png';
document.getElementById('todayIcon').src = 'https://data.chinahighlights.com/image/weather/icon-weather/' + json.weather[0].icon + '.png';
document.getElementById('todayCondition').innerText = json.weather[0].main;
document.getElementById('todayHumidity').innerText = 'Humidity: ' + json.main.humidity + '%';
document.getElementById('todayWind').innerText = 'Wind: ' + Math.round(json.wind.speed * 3.6) + 'km/h';
@ -154,7 +154,7 @@ fetch(forecastUrl)
document.getElementById('forecastDate' + number).innerText = formatDate(currentDate);
document.getElementById('forecastTemperature' + number).innerText =
Math.round(firstDay.main.temp) + '~' + Math.round(lastDay.main.temp) + '°C';
document.getElementById('forecastIcon' + number).src = 'http://openweathermap.org/img/wn/' + firstDay.weather[0].icon + '.png';
document.getElementById('forecastIcon' + number).src = 'https://data.chinahighlights.com/image/weather/icon-weather/' + firstDay.weather[0].icon + '.png';
document.getElementById('forecastCondition' + number).innerText = firstDay.weather[0].main;
document.getElementById('forecastHumidity' + number).innerText = 'Humidity: ' + firstDay.main.humidity + '%';
document.getElementById('forecastWind' + number).innerText = 'Wind: ' + Math.round(firstDay.wind.speed * 3.6) + 'km/h';

Loading…
Cancel
Save