Here's a live demo of the app
- Enter a city name in the search bar.
- Press Enter or click the search icon.
- View the current weather information and forecast.
- Current temperature and location
- Weather description with icon
- Detailed metrics:
- Pressure
- Humidity
- Visibility
- Wind
- 5-day forecast
This project uses the OpenWeather API. To run the application:
- Clone repository:
git clone https://github.com/keleviss/weather-widget.git- Sign up for a free API key at OpenWeather.
- Replace the API key in
js/weatherDataFetching.js:
const apiKey = 'your-open-weather-api-key';weather-now/
├── assets/
│ ├── weatherIcons/
│ └── fontAwesomeIcons/
├── css/
│ └── style.css
├── js/
│ ├── app.js
│ ├── weatherDataFetching.js
│ ├── weatherProcessing.js
│ ├── helperFunctions.js
│ └── uiRenderer.js
└── index.html
- Day and date display
- Current temperature
- Location with country code
- Weather description with corresponding icon
- Atmospheric pressure (mb)
- Humidity percentage
- Visibility distance (km)
- Wind speed (km/h)
- Daily temperature averages
- Weather condition icons
- Day of the week display
The application includes robust error handling for:
- Invalid city names
- API request failures
- Network connectivity issues
- Weather data provided by OpenWeather.
- Icons by Font Awesome.