-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.js
24 lines (23 loc) · 1.05 KB
/
ui.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class UI {
constructor() {
this.location = document.getElementById('w-location');
this.desc = document.getElementById('w-desc');
this.string = document.getElementById('w-string');
this.details = document.getElementById('w-details');
this.icon = document.getElementById('w-icon');
this.humidity = document.getElementById('w-humidity');
this.feelsLike = document.getElementById('w-feels-like');
this.dewpoint = document.getElementById('w-dewpoint');
this.wind = document.getElementById('w-wind');
}
paint(weather) {
this.location.textContent = weather.display_location.full;
this.desc.textContent = weather.weather;
this.string.textContent = weather.temperature_string;
this.icon.setAttribute('src', weather.icon_url);
this.humidity.textContent = `Relative Humidity: ${weather.relative_humidity}`;
this.feelsLike.textContent = `Feels Like: ${weather.feelslike_string}`;
this.dewpoint.textContent = `DewPoint: ${weather.dewpoint_string}`;
this.wind.textContent = `Wind: ${weather.wind_string}`;
}
}