A simple and beautiful weather application built with HTML, CSS, and JavaScript. Get real-time weather information for any city worldwide using the OpenWeather API.
Clone the Repository
git clone https://github.com/shashankpandya/Weather_app
cd Weather_app
Weather.html in your web browserOr use a local server:
# Using Python 3
python -m http.server 8000
# Using Python 2
python -m SimpleHTTPServer 8000
# Using Node.js (with http-server)
npx http-server
Try the app directly without downloading:
Weather.html directly in your browserhttps://api.openweathermap.org/data/2.5/weatherWeather_app/
├── Weather.html # Main HTML structure
├── Weather.css # Styling and layout
├── Weather.js # Weather logic and API calls
└── README.md # Documentation
Replace the API key in Weather.js:
const apiKey = "YOUR_API_KEY_HERE";
Get your free API key from OpenWeatherMap
Edit the gradient in Weather.css:
background: linear-gradient(135deg, #00feba, #5b548a);
Add more conditions in the checkWeather() function in Weather.js
| Issue | Solution |
|---|---|
| “Invalid city name” error | Make sure you’re typing a valid city name (e.g., “London”, “New York”) |
| Icons not loading | Check your internet connection; icons are loaded from CDN |
| API not responding | Verify your API key is valid and has free tier access |
| Search not working | Clear browser cache or try a different city name |
This project is open source and available under the MIT License.
Created by Shashank Pandya
Enjoy exploring the weather! 🌤️