feat: Swedish weather bar with wind speed display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -399,7 +399,7 @@ class WeatherManager {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Render compact weather bar for landscape mode
|
* Render compact weather bar for landscape mode
|
||||||
* Shows: [icon] temp condition | Sunrise HH:MM | Sunset HH:MM
|
* Shows: [icon] temp condition 💨 wind | ☀️ Sol ↑ HH:MM 🌙 Sol ↓ HH:MM
|
||||||
*/
|
*/
|
||||||
renderCompactWeatherBar() {
|
renderCompactWeatherBar() {
|
||||||
const bar = document.getElementById('compact-weather-bar');
|
const bar = document.getElementById('compact-weather-bar');
|
||||||
@@ -421,10 +421,17 @@ class WeatherManager {
|
|||||||
tempSpan.appendChild(document.createTextNode(` ${conditionSv || ''}`));
|
tempSpan.appendChild(document.createTextNode(` ${conditionSv || ''}`));
|
||||||
bar.appendChild(tempSpan);
|
bar.appendChild(tempSpan);
|
||||||
|
|
||||||
const sep1 = document.createElement('span');
|
// Wind speed
|
||||||
sep1.className = 'weather-bar-sep';
|
if (this.weatherData.wind) {
|
||||||
sep1.textContent = '|';
|
const windSpan = document.createElement('span');
|
||||||
bar.appendChild(sep1);
|
windSpan.textContent = `💨 ${this.weatherData.wind.speed} km/h`;
|
||||||
|
bar.appendChild(windSpan);
|
||||||
|
}
|
||||||
|
|
||||||
|
const sep = document.createElement('span');
|
||||||
|
sep.className = 'weather-bar-sep';
|
||||||
|
sep.textContent = '|';
|
||||||
|
bar.appendChild(sep);
|
||||||
|
|
||||||
let sunriseStr = '--:--';
|
let sunriseStr = '--:--';
|
||||||
let sunsetStr = '--:--';
|
let sunsetStr = '--:--';
|
||||||
@@ -432,19 +439,9 @@ class WeatherManager {
|
|||||||
sunriseStr = this.formatTime(this.sunTimes.today.sunrise);
|
sunriseStr = this.formatTime(this.sunTimes.today.sunrise);
|
||||||
sunsetStr = this.formatTime(this.sunTimes.today.sunset);
|
sunsetStr = this.formatTime(this.sunTimes.today.sunset);
|
||||||
}
|
}
|
||||||
|
const sunSpan = document.createElement('span');
|
||||||
const sunriseSpan = document.createElement('span');
|
sunSpan.textContent = `☀️ Sol ↑ ${sunriseStr} 🌙 Sol ↓ ${sunsetStr}`;
|
||||||
sunriseSpan.textContent = `☀️ Sol ↑ ${sunriseStr}`;
|
bar.appendChild(sunSpan);
|
||||||
bar.appendChild(sunriseSpan);
|
|
||||||
|
|
||||||
const sep2 = document.createElement('span');
|
|
||||||
sep2.className = 'weather-bar-sep';
|
|
||||||
sep2.textContent = '|';
|
|
||||||
bar.appendChild(sep2);
|
|
||||||
|
|
||||||
const sunsetSpan = document.createElement('span');
|
|
||||||
sunsetSpan.textContent = `🌙 Sol ↓ ${sunsetStr}`;
|
|
||||||
bar.appendChild(sunsetSpan);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user