A sleek, real-time weather dashboard powered by the WeatherAPI.com REST API โ built with pure HTML, CSS & JavaScript.
๐ View Live โ
| Sunny โ๏ธ | Rainy ๐ง๏ธ | Cloudy โ |
|---|---|---|
| Golden gradient background | Blue gradient background | Dark gradient background |
The background theme dynamically changes based on current weather conditions!
- ๐ City Search โ Search any city worldwide by name or press
Enterto search - ๐ก๏ธ Current Weather โ Real-time temperature, weather condition, and icon
- ๐ง Detailed Stats โ Feels Like temperature, Humidity %, and Wind Speed (km/h)
- ๐ 3-Day Forecast โ Upcoming weather with daily average temperature and condition
- ๐จ Dynamic Backgrounds โ Gradient theme changes automatically based on weather (sunny, rainy, cloudy, snowy)
- ๐ Default Location โ Auto-loads weather for Pune, India on startup
- ๐ฑ Fully Responsive โ Works seamlessly on mobile, tablet, and desktop
| Technology | Usage |
|---|---|
| HTML5 | Markup & page structure |
| CSS3 | Glassmorphism UI, animations, responsive layout |
| JavaScript (ES6+) | Async API calls, DOM manipulation, dynamic rendering |
| WeatherAPI.com | Live weather data (current + forecast + AQI + alerts) |
| Google Fonts (Poppins) | Typography |
This project uses the WeatherAPI.com REST API.
Endpoint used:
GET https://api.weatherapi.com/v1/forecast.json
?key=YOUR_API_KEY
&q={city}
&days=3
&aqi=yes
&alerts=yes
Data consumed:
location.name/location.country/location.localtimecurrent.temp_c/current.feelslike_c/current.humidity/current.wind_kphcurrent.condition.text/current.condition.iconforecast.forecastday[].day.avgtemp_c/condition.text/condition.icon
- A free API key from WeatherAPI.com
- A modern browser (Chrome, Firefox, Edge, Safari)
1. Clone the repository
git clone https://github.com/AtharvaThawkar/weather-pro.git
cd weather-pro2. Add your API key
Open index.html and replace the API key on this line:
const API_KEY = "your_api_key_here";3. Run the project
Simply open index.html in your browser โ no build tools or server required!
# Or use VS Code Live Server for a better dev experienceweather-pro/
โ
โโโ index.html # Main HTML file (UI + JS logic all-in-one)
โโโ README.md # Project documentation
- Glassmorphism design โ backdrop blur, semi-transparent cards
- Smooth transitions โ background color shifts on weather change (0.8s transition)
- Responsive grid โ stats and forecast cards reflow cleanly on smaller screens
- Hover effects โ subtle scale animation on the search button
- Toggle between Celsius / Fahrenheit
- Geolocation support โ auto-detect user's current location
- Air Quality Index (AQI) display using existing API data
- Weather alerts section for severe conditions
- Hourly forecast chart using Chart.js
- Store recently searched cities using localStorage
This project uses a client-side API key which is exposed in the source code. This is acceptable for learning/portfolio projects. For production use, the API call should be routed through a backend server (e.g. Node.js + Express) to keep the key secure.
Atharva Pramod Thawkar
- ๐ Final Year B.E. IT โ SIPNA College of Engineering, Amravati
- ๐ผ Aspiring MERN Stack Developer | Open to Opportunities
- ๐ GitHub ยท LinkedIn ยท LeetCode
This project is open source and available under the MIT License.
โญ If you found this project useful, please consider giving it a star! It helps a lot ๐