A minimalist weather application built using HTML, CSS, and JavaScript, which fetches real-time weather data using the OpenWeatherMap API. Users can enter a city name to get the current weather, including temperature and conditions.
- 🔍 Search weather by city name
- 🌍 Uses Geocoding API to convert city names into coordinates
- 📡 Fetches weather data in real-time
- 🌤️ Displays:
- City name
- Temperature in Celsius
- Weather description
- Weather icon
- ❌ Handles:
- Empty input
- Invalid city names
- Failed API requests
- HTML5
- CSS3
- Vanilla JavaScript (ES6+)
- OpenWeatherMap API
/weather-app
│
├── index.html # Main HTML file
├── weather.js # JavaScript for fetching & displaying weather
├── style.css # Basic styling
-
Clone the repository:
git clone https://github.com/your-username/weather-app.git cd weather-app
-
Get your API key from OpenWeatherMap and replace the placeholder in
weather.js
:const apiKey = "your_api_key_here";
-
Open the
index.html
file in your browser.
- User enters a city name.
- The app uses OpenWeatherMap’s Geocoding API to get latitude and longitude.
- Those coordinates are used in a weather data API request.
- The response is parsed and displayed on the UI.
The app will show user-friendly messages for:
- Empty inputs
- Non-existent cities
- API or network failures
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Open pull requests
This project is open-source and available under the MIT License.
- Icons and data from OpenWeatherMap
- UI design inspiration from clean and minimal weather apps
- Project inspired by Codedex's "View Weather with HTML, CSS & JS"
Created by Shaun – feel free to connect!