Changed around line 1
+ // Simulated weather data
+ const weatherConditions = [
+ { temp: 25, condition: 'sunny', recommendation: 'Perfect day to go outside!' },
+ { temp: 18, condition: 'partly-cloudy', recommendation: 'Great weather for a walk!' },
+ { temp: 10, condition: 'cloudy', recommendation: 'A bit chilly, but still good for outdoor activities' },
+ { temp: 5, condition: 'rainy', recommendation: 'Maybe stay in and enjoy a cozy day' },
+ { temp: -2, condition: 'snowy', recommendation: 'Stay warm inside unless you love winter sports' }
+ ];
+
+ function getRandomWeather() {
+ return weatherConditions[Math.floor(Math.random() * weatherConditions.length)];
+ }
+
+ function updateWeatherDisplay() {
+ const weather = getRandomWeather();
+ const weatherElement = document.getElementById('weather-data');
+ const decisionElement = document.getElementById('decision-text');
+
+ weatherElement.innerHTML = `
+
Temperature: ${weather.temp}°C
+
Condition: ${weather.condition.replace('-', ' ')}
+ `;
+
+ decisionElement.textContent = weather.recommendation;
+ }
+
+ document.getElementById('refresh-btn').addEventListener('click', updateWeatherDisplay);
+
+ // Initial load
+ updateWeatherDisplay();