A beautiful, responsive weather application built with HTML, CSS, Bootstrap, and JavaScript, featuring real-time weather data, interactive charts, and immersive weather sounds.
- Real-time Weather Data: Current conditions, temperature, humidity, wind speed, and more
- 5-Day Forecast: Extended weather predictions with detailed information
- Hourly Forecast: 12-hour detailed weather breakdown
- Interactive Charts: Visual temperature trends and hourly data
- Auto-location Detection: Automatic location detection using IP geolocation
- Popular Cities: Quick access to weather for major cities worldwide
- Weather Sounds: Immersive audio that matches current weather conditions
- Dynamic Backgrounds: Beautiful gradients that change based on weather conditions
- Responsive Design: Optimized for desktop, tablet, and mobile devices
- Modern UI: Clean, glass-morphism design with smooth animations
- Accessibility: Keyboard navigation and screen reader friendly
- Temperature (Celsius/Fahrenheit)
- Feels-like temperature
- Humidity levels
- Wind speed and direction
- Visibility
- UV Index
- Cloud cover
- Atmospheric pressure
- Air Quality Index (simulated)
- Sunrise and sunset times
- Comfort Level Indicator: Shows how comfortable the weather feels
- Activity Recommendations: Suggests activities based on current conditions
- Lifestyle Tips: Personalized advice based on weather and air quality
- Weather Alerts: Warnings for extreme weather conditions
- Python 3.7 or higher
- Modern web browser (Chrome, Firefox, Safari, Edge)
-
Clone or Download the Project
cd "WEATHER APP"
-
Install Python Dependencies
pip install -r requirements_web.txt
-
Start the Flask Backend
python backend.py
The backend will start on
http://localhost:5000 -
Open the Web Application
- Open
index.htmlin your web browser - Or serve it using a local web server:
# Using Python's built-in server python -m http.server 8080Then visit
http://localhost:8080 - Open
The app uses AccuWeather API. The API key is already included for demo purposes, but for production use, you should:
- Get your own API key from AccuWeather Developer Portal
- Replace the
API_KEYinbackend.pywith your key
WEATHER APP/
├── index.html # Main HTML file
├── styles.css # CSS styles and animations
├── app.js # Frontend JavaScript logic
├── backend.py # Flask backend API
├── requirements_web.txt # Python dependencies
├── sounds/ # Weather sound files
│ ├── rain.wav
│ ├── thunder.wav
│ └── wind.wav
├── app.py # Original Streamlit app
└── README_WEB.md # This file
- Search for a City: Type any city name in the search box
- Use Popular Cities: Click on any of the popular city buttons
- Auto-location: Click "My Location" to detect your current location
- Navigate Tabs: Switch between Current, Forecast, Charts, and Details tabs
- View current temperature and conditions
- See comfort level and weather metrics
- Get activity recommendations and lifestyle tips
- Toggle weather sounds on/off
- 5-day weather forecast with icons and temperatures
- 12-hour detailed hourly forecast
- Precipitation probability for each period
- Interactive temperature trend chart for 5 days
- Hourly temperature chart for next 12 hours
- Responsive charts that work on all devices
- Comprehensive weather information
- Sun and moon data (sunrise/sunset times)
- Air quality information
- Atmospheric conditions
- Weather alerts and warnings
- Extended lifestyle recommendations
- Weekly weather summary
- Rain Sound: Plays during rainy conditions
- Thunder Sound: Plays during storms
- Wind Sound: Plays during windy conditions
- Sound Toggle: Enable/disable sounds using the toggle switch
- Sound Test: Test different weather sounds from the welcome screen
- Chrome: Full support
- Firefox: Full support
- Safari: Full support
- Edge: Full support
- Mobile Browsers: Responsive design works on all mobile browsers
-
Backend Not Starting
- Ensure Python is installed and in PATH
- Install dependencies:
pip install -r requirements_web.txt - Check if port 5000 is available
-
API Errors
- Check internet connection
- Verify API key is valid
- Some locations might not be found - try different city names
-
Sounds Not Playing
- Ensure sound files exist in the
sounds/directory - Check browser audio permissions
- Some browsers require user interaction before playing audio
- Ensure sound files exist in the
-
Charts Not Loading
- Ensure Chart.js is loaded (check internet connection)
- Try refreshing the page
- Check browser console for JavaScript errors
- Caching: The app caches location data to reduce API calls
- Lazy Loading: Charts are only rendered when the Charts tab is opened
- Responsive Images: Weather icons are optimized for all screen sizes
- Styling: Modify
styles.cssto change colors, animations, or layout - Weather Sources: Update
backend.pyto use different weather APIs - Sound Effects: Add new sound files to the
sounds/directory - Cities: Modify the popular cities list in
index.html
- New Weather Metrics: Add to the
displayWeatherMetrics()function inapp.js - Additional Charts: Use Chart.js to create new visualizations
- Enhanced Animations: Add CSS animations in
styles.css
- Weather Data: AccuWeather API
- Icons: Unicode emoji and Bootstrap Icons
- Charts: Chart.js library
- Framework: Bootstrap 5
- Fonts: Google Fonts (Inter)
This project is for educational and personal use. Please respect the AccuWeather API terms of service.
Enjoy your beautiful weather app! 🌤️