A clean, responsive weather app. Type any city and instantly see the current temperature, conditions, humidity, wind speed and country, with a matching weather icon.
Live demo: https://markehab1.github.io/Weather-App/
- Search any city by clicking the search button or pressing Enter
- Shows temperature (°C), weather description, humidity, wind speed (km/h) and country
- Weather icon that changes with the condition (clouds, clear, rain, drizzle, mist, snow)
- Loading indicator while the weather is being fetched
- Friendly messages for an invalid city name and for no internet connection
- Responsive layout for phones, tablets and desktops
- Respects reduced-motion settings
- HTML5, CSS3 and vanilla JavaScript (
fetch,async/await) - OpenWeatherMap Current Weather API
- Font Awesome icons and the Poppins font
- Deployed on GitHub Pages
- Clone the repository:
git clone https://github.com/Markehab1/Weather-App.git cd Weather-App - Get a free API key from OpenWeatherMap. New keys can take up to 2 hours to activate.
- Open
main.jsand put your key on the first line:const apiKey = "YOUR_API_KEY";
- Open
index.htmlin your browser.
Weather-App/
├── index.html # page structure
├── main.css # styles and responsive layout
├── main.js # API call, error handling and UI updates
└── Images/ # weather icons
- Fetching data from a REST API and handling errors (invalid city, network failure)
- Converting units (the API returns wind in m/s, converted to km/h)
- Building a responsive layout with media queries