Welcome to ForecastHub β a modern, interactive, and responsive web application that delivers real-time weather updates for any city across the globe! Powered by the OpenWeatherMap API, this app combines sleek design with powerful features for a personalized weather experience.
-
π΄ Real-Time Weather Get live updates on temperature, humidity, wind speed, pressure, and more.
-
π Hourly + 3-Day Forecast View detailed hourly trends and summarized 3-day forecasts.
-
π Geolocation Support Auto-detects your current location to show hyper-local weather.
-
π οΈ Customizable Widgets Select which metrics (AQI, sunrise, sunset, etc.) you want to display.
-
π Multilingual Supports English, Hindi, Russian, and Japanese with live translations.
-
π¨ Theme Options Choose from Blue, Green, Purple themes, and toggle Light/Dark mode.
-
β Dynamic Backgrounds Background animations react to weather conditions β sunny, rainy, cloudy, etc.
-
π± Responsive Design Fully optimized for all devices β phones, tablets, and desktops.
-
π¬οΈ Air Quality Index View AQI with clear color-coded levels (Good, Moderate, Poor).
-
π Auto Refresh Weather updates automatically every 15 minutes.
- HTML5 & CSS3 β Structured using Tailwind CSS for sleek, modular styles
- JavaScript β Handles API communication and UI interactivity
- OpenWeatherMap API β Main source for weather, forecast, and AQI data
- Particles.js β Adds animated, weather-based background visuals
- Weather Icons β Custom icons for each weather state
- Google Fonts β Uses βInterβ font for clean, modern typography
- A modern browser (Chrome, Edge, Firefox, Safari)
- An internet connection
- A free API key from OpenWeatherMap
# 1. Clone the repository
git clone https://github.com/your-username/weather-forecast-app.git
# 2. Navigate to the folder
cd weather-forecast-app-
Open
index.html -
Locate this line inside the
<script>tag:const apiKey = 'YOUR_API_KEY_HERE';
-
Replace it with your actual API key from OpenWeatherMap.
- Simply open
index.htmlin a browser - Or run with Live Server in VS Code for a local server experience
| Action | Description |
|---|---|
| ποΈ Enter City | Type a city and press Enter or click Get Weather |
| π Use Location | Auto-fetch weather for your current position |
| π‘οΈ Toggle Units | Switch between Celsius Β°C and Fahrenheit Β°F |
| π¨ Change Theme | Choose from color themes and Dark/Light modes |
| π οΈ Customize Widgets | Enable or disable metrics to display |
| π Switch Language | Pick from English, Hindi, Russian, Japanese |
| π View Forecasts | Scroll through hourly and 3-day summaries |
weather-forecast-app/
βββ index.html # Main HTML + JS + Tailwind styles
βββ README.md # Project documentation
-
Add Themes: Modify
:rootCSS variables and update thesetTheme()function. -
New Languages: Extend the
labelsobject with translations. -
More Widgets: Add entries to
selectedWidgets[]and enhance thedisplayWeather()logic. -
Weather Icons: Expand
customIconswith more SVGs or icon classes.
| Constraint | Description |
|---|---|
| π API Dependency | Needs internet + valid OpenWeatherMap API key |
| β³ Rate Limits | Free API tier has request limits |
| π Geolocation | Requires user permission, may not work on all devices |
| π Forecast Window | Hourly forecast limited to 3 days by API constraints |
-
β City Not Found Check for typos or try a nearby major city.
-
π Invalid API Key Double-check your key and quota usage.
-
π No Weather Data Ensure your device is online and refresh the page.
-
π Geolocation Fails Enable location services in your browser settings.
We welcome contributions! πͺ To contribute:
# Fork the repo
# Create a feature branch
git checkout -b feature/your-feature
# Make changes & commit
git commit -m "Add your feature"
# Push & open a Pull Request
git push origin feature/your-featureLicensed under the MIT License β see the LICENSE file for more info.
- Created by: Krish Yadav
- APIs: OpenWeatherMap
- Libraries: Tailwind CSS, Particles.js, Weather Icons
- Fonts: Google Fonts β Inter
π¦οΈ Happy Forecasting from ForecastHub Made with β€οΈ in 2025