Skip to content

Commit e4f783a

Browse files
committed
corrected image paths
1 parent 9feb8b4 commit e4f783a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

js/script.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ zipCodeInput.addEventListener("focus", () => {
4646
temperatureEl.textContent = "Fahrenheit";
4747
cityEl.textContent = "City";
4848
usaStateEl.textContent = "State";
49-
weatherIconEl.src = "../images/sun.webp";
49+
weatherIconEl.src = "images/sun.webp";
5050
weatherCodeDescriptionEl.textContent = "Description";
5151
tempFeelsLikeEl.textContent = "Apparent Temp";
5252
windSpeedEl.textContent = "Wind Speed";
@@ -201,19 +201,17 @@ async function fetchMoreWeatherInfo() {
201201
//Get the images' path depending on the weather code from open meteo
202202
function getWeatherCodeIllustrationPath(weathercode) {
203203
if ([0, 1].includes(weathercode))
204-
return isDay ? "../images/sun.webp" : "../images/clear-night.webp";
204+
return isDay ? "images/sun.webp" : "images/clear-night.webp";
205205
if (weathercode === 2)
206-
return isDay
207-
? "../images/partly-cloudy.webp"
208-
: "../images/cloudy-night.webp";
209-
if (weathercode === 3) return "../images/overcast.webp";
210-
if ([45, 48].includes(weathercode)) return "../images/fog.webp";
206+
return isDay ? "images/partly-cloudy.webp" : "images/cloudy-night.webp";
207+
if (weathercode === 3) return "images/overcast.webp";
208+
if ([45, 48].includes(weathercode)) return "images/fog.webp";
211209
if (
212210
[51, 53, 55, 56, 57, 61, 63, 65, 66, 67, 80, 81, 82].includes(weathercode)
213211
)
214212
return "images/rain.webp";
215-
if ([77, 85, 86].includes(weathercode)) return "../images/snow.webp";
216-
if ([95, 96, 99].includes(weathercode)) return "../images/lightning.webp";
213+
if ([77, 85, 86].includes(weathercode)) return "images/snow.webp";
214+
if ([95, 96, 99].includes(weathercode)) return "images/lightning.webp";
217215
}
218216

219217
//Description for the weather code from open meteo

0 commit comments

Comments
 (0)