From 0c73c2033e18b7249c1b0c344fdd9daaa89548e2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 19:13:32 +0000 Subject: [PATCH] feat: Create basic weather app for Cologne This commit introduces a simple web application that displays the current weather conditions for Cologne, Germany. It includes: - `index.html`: The main HTML page with structure and basic styling. - `script.js`: JavaScript to fetch current temperature, humidity, and wind speed from the Open-Meteo API and display it on the page. The application fetches data from `api.open-meteo.com`. If the API call fails, a user-friendly error message is displayed. --- index.html | 35 +++++++++++++++++++++++++++++++++++ script.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 index.html create mode 100644 script.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..4057ddb --- /dev/null +++ b/index.html @@ -0,0 +1,35 @@ + + +
+ + +Loading weather data...
+Temperature: ${temperature}°C
+Humidity: ${humidity}%
+Wind Speed: ${windSpeed} km/h
+ `; + } else { + throw new Error('Invalid weather data format'); + } + }) + .catch(error => { + console.error('Error fetching weather data:', error); + weatherInfoDiv.innerHTML = 'Could not fetch weather data. Please try again later.
'; + }); +});