Skip to content

Commit 5355acf

Browse files
committed
add overcast switch img path to switch statement
1 parent e93c89d commit 5355acf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

weatherApp/scripts/script.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ $(document).ready(function () {
2121
let imgPath = "images/error.png";
2222

2323
switch(true) {
24+
case desc.includes("clear") :
2425
case desc.includes("sunny") :
2526
imgPath = "images/sunny.png";
2627
break;
28+
case desc.includes("overcast") :
29+
imgPath = "images/overcast.png";
30+
break;
2731
case desc.includes("cloudy") :
2832
imgPath = "images/cloudy.png";
2933
break;
@@ -46,9 +50,9 @@ $(document).ready(function () {
4650

4751
//Update weather Container
4852
$("#cityName").text(city);
49-
$("#temp").text(`Temperature: ${temp} °C`); //Temperature
50-
$("#desc").text(`Description: ${desc}`); //Description
51-
$("#hum").text(`Humidity: ${humidity} %`); //Humidity
53+
$("#temp").text(`Temp: ${temp} °C`); //Temperature
54+
$("#desc").text(`Desc: ${desc}`); //Description
55+
$("#hum").text(`Hum: ${humidity} %`); //Humidity
5256

5357
//Link weather icon
5458
$("#weatherIcon").attr("src", imgPath);

0 commit comments

Comments
 (0)