Please give feedback to my finished Weather Application - highly appreciated

Hi guys,

I did it. With help of some forum members I finally completed that app.
The building process was very funny and learned a lot.

This is the result:

I just have a default white background. And just 3 backgrounds that changes when the status is rain, sunny or thunderstorm :D.
The weather icons however I have almost 30 or so implemented.
I have it from this site:

Please tell me what I did good and what I did badly. Any feedback is highly appreciated.

Thanks guys!
Have a nice day.

You need to correct several errors appearing in the console (Ctrl+Shft+I in chrome). Also, as I mentioned in the help thread, you need to get rid the call to changeMetric. You removed the function itself, but not the call to it.

The other two errors will also need to be addressed:

  1. Uncaught ReferenceError: callbackFunction is not defined

  2. Uncaught SyntaxError: Invalid or unexpected token font-awesome.min.csss:4

Thx man I fixed all the errors :slight_smile:

One other suggestion is related to your setBackground function. First, since it is really setting the icon, I would call it setIcon. Second, that switch statement is HUGE.

You could get rid of the switch statement and implement something like below:

function setIcon(code) {
  var condIcons = [
    // add the remaining conditions and codes as subarrays here
  var condIcon = 'wi-thermometer-exterior'; // default icon
  for (var cond of condIcons) {
    if (cond.includes(code)) {
      condIcon = 'wi-' + cond[0]; // 1st element of each cond is condition text
      break; // stop searching