This project is a simple weather application that fetches real-time weather data from the OpenWeather API and displays it in an interactive user interface. Users can input a city name to retrieve information such as temperature, humidity, wind speed, and a weather icon corresponding to the current weather condition.
- Real-Time Weather Data: Fetches live weather updates for any city using the OpenWeather API.
- Dynamic Weather Icons: Displays icons based on the current weather (e.g., clouds, rain, clear, etc.).
- Responsive Design: Optimized for different screen sizes, including mobile and desktop.
- Error Handling: Displays an error message for invalid city names.
- HTML for structuring the web page.
- CSS for styling and creating responsive layouts.
- JavaScript for making API calls and adding dynamic functionality.
- OpenWeather API for fetching weather data.
-
Clone the repository:
git clone https://github.com/your-username/Weather-forecast-web-app.git
-
Navigate to the project directory:
cd Weather-forecast-web-app -
Open the
index.htmlfile in your preferred web browser:open index.html
Weather-forecast-web-app/
├── index.html # HTML structure
├── style.css # CSS for styling
├── script.js # JavaScript for functionality
├── README.md
├── assests/ # Images and icons
│ ├── clear.png
│ ├── clouds.png
│ ├── drizzle.png
│ ├── humidity.png
│ ├── mist.png
│ ├── rain.png
│ ├── search.png
│ ├── snow.png
│ └── wind.png
└── screenshots/
├── weather-search-ui.png
└── weather-result-display.png
- Open the app in your browser.
- Enter a city name in the search bar.
- Click the search button to fetch weather data.
- The app will display:
- Current temperature
- Humidity percentage
- Wind speed
- An icon representing the weather
- The background gradient will change dynamically based on the time of the day (day or night).
To use this app, ensure you have a valid OpenWeather API key. Replace the placeholder apikey in the script.js file with your API key:
const apikey = "your-api-key-here";You can get an API key by signing up at OpenWeather.
- Add support for multiple languages.
- Display additional weather details (e.g., air quality, pressure).
- Implement geolocation to fetch weather data for the user's current location.
- Add a forecast feature for upcoming days.
Contributions are welcome! If you have suggestions or bug fixes, feel free to open an issue or submit a pull request.
- OpenWeather API for providing weather data.
- Poppins Font for typography.
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy using the Weather App!

