A simple and responsive weather application built as part of The Odin Project curriculum.
It allows users to search for any city and view real-time weather conditions using the WeatherAPI.
- Search weather by city name
- Displays temperature, humidity, wind speed, and weather condition
- Dynamic background that changes based on weather or time of day
- Error handling for invalid city names and API error
- Clean and responsive UI built with HTML, CSS, and JavaScript
- Fetches live weather data using
fetch()from WeatherAPI - Added 5-day forecast
- Working with APIs and
fetch() - Asynchronous JavaScript (
async/await) - DOM manipulation and modular JS structure
- Import/export with ES Modules
- Basic error handling and user-friendly UI design
-
Clone the repository:
git clone https://github.com/your-username/weather-app.git cd weather-app -
Install dependencies (if using npm/webpack):
npm install
-
Create a free account at WeatherAPI and get your API key.
-
Inside your source file (e.g., getweather.js), replace:
const apiKey = "YOUR_API_KEY";
-
Run the app:
npm start