Skip to content

Commit

Permalink
Merge pull request #10 from hoangsonww/enhancements
Browse files Browse the repository at this point in the history
Fix: Enhanced Homepage
  • Loading branch information
hoangsonww authored Apr 24, 2024
2 parents 6b98c8e + 78d939d commit e3eb3b4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,32 +185,48 @@ function setBackground(condition, data) {
backgroundImage = 'url(/WeatherMate-App/utils/night.jpg)';
textColor = 'black';
favoriteColor = 'black';
document.getElementById('home-label').style.color = 'white';
document.getElementById('local-time-label').style.color = 'white';
}
else {
switch (condition) {
case 'Clouds':
backgroundImage = 'url(/WeatherMate-App/utils/cloudy.jpg)';
textColor = 'black';
favoriteColor = 'black';
document.getElementById('my-heading').style.color = 'black !important';
document.getElementById('my-heading').style.color = 'black';
document.getElementById('home-label').style.color = 'black';
document.getElementById('local-time-label').style.color = 'black';
break;
case 'Clear':
backgroundImage = 'url(/WeatherMate-App/utils/clear.jpg)';
document.getElementById('home-label').style.color = 'white';
document.getElementById('local-time-label').style.color = 'white';
break;
case 'Rain':
backgroundImage = 'url(/WeatherMate-App/utils/rainy.jpg)';
document.getElementById('home-label').style.color = 'black';
document.getElementById('local-time-label').style.color = 'black';
break;
case 'Drizzle':
backgroundImage = 'url(/WeatherMate-App/utils/rainy.jpg)';
document.getElementById('home-label').style.color = 'black';
document.getElementById('local-time-label').style.color = 'black';
break;
case 'Snow':
backgroundImage = 'url(/WeatherMate-App/utils/snowy.jpg)';
document.getElementById('home-label').style.color = 'black';
document.getElementById('local-time-label').style.color = 'black';
break;
case 'Thunderstorm':
backgroundImage = 'url(/WeatherMate-App/utils/thunderstorm.jpg)';
document.getElementById('home-label').style.color = 'black';
document.getElementById('local-time-label').style.color = 'black';
break;
default:
backgroundImage = 'url(/WeatherMate-App/utils/clouds.jpg)';
document.getElementById('home-label').style.color = 'black';
document.getElementById('local-time-label').style.color = 'black';
break;
}
}
Expand Down

0 comments on commit e3eb3b4

Please sign in to comment.