Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 9, 2018 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/b55aeddcee015a13ded544d3c5542777 to your computer and use it in GitHub Desktop.
Save parzibyte/b55aeddcee015a13ded544d3c5542777 to your computer and use it in GitHub Desktop.
icono(){
let clase = {
'wi': true,
'display-4': true
},
esDeDia = this.esDeDia(),
icono = "";
switch (this.clima.weather[0].main.toLowerCase()) {
case 'clouds':
icono = esDeDia ? 'wi-day-cloudy' : 'wi-night-cloudy';
break;
case 'clear':
icono = esDeDia ? 'wi-day-sunny' : 'wi-night-clear';
break;
case 'drizzle':
icono = esDeDia ? 'wi-day-rain-mix' : 'wi-night-rain-mix';
break;
case 'rain':
icono = esDeDia ? 'wi-day-rain' : 'wi-night-rain';
break;
case 'snow':
icono = esDeDia ? 'wi-day-snow' : 'wi-night-snow';
break;
case 'thunderstorm':
icono = esDeDia ? 'wi-day-thunderstorm' : 'wi-night-thunderstorm';
break;
}
clase[icono] = true;
return clase;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment