Experience the weather, don't just read it.
A fully immersive, glassmorphism-based weather dashboard that adapts its visual and audio ambience to real-time conditions.
This isn't your average weather app. It is designed to be an Atmospheric Experience.
Instead of simple icons, the application uses Cinematic Video Backgrounds and Spatial Audio to transport the user to the location. If it's raining in London, you will see the rain on your screen and hear the droplets falling.
- π¨ Glassmorphism UI: Modern, frosted-glass aesthetic using
backdrop-filter. - π₯ Dynamic Video Backgrounds: High-quality loops that change based on weather conditions (Rain, Snow, Clear, Thunder, Mist).
- π Immersive Audio: Ambient soundscapes (Birds chirping, Wind howling, Rain pattering) that sync with the visuals.
- β‘ Smart Caching: "Singleton" audio player pattern to prevent memory leaks and audio crashes.
- π§ Intelligent Logic: Custom algorithms to prioritize hazardous weather (Storms) over standard conditions (Clouds).
- πͺοΈ CSS-Only Loader: A custom-built "Sunrise" animation without external GIFs.
The app uses a strict Priority Queue system to determine the "Vibe" of the city. We don't just take the API's word for it; we analyze temperature, wind speed, and condition codes to create the perfect atmosphere.
graph TD
A[Start: User Searches City] -->|Fetch Data| B(OpenWeatherMap API)
B --> C{Determine Theme Priority}
C -->|ID 200-232| D[βοΈ Thunderstorm]
C -->|ID 300-531| E[π§οΈ Rain]
C -->|Temp < 5Β°C| F[βοΈ Winter]
C -->|Temp > 22Β°C| G[βοΈ Summer]
C -->|ID 700-781| H[π«οΈ Mist/Fog]
C -->|Wind > 5.5m/s| I[π Autumn/Windy]
C -->|Default| J[βοΈ Clouds/Clear]
D & E & F & G & H & I & J --> K[Update UI Layer]
K --> L[Swap Video Background]
K --> M[Crossfade Ambient Audio]
Since this project uses a secured bash config.js file for API keys, you need to generate it locally.
-
Clone the Repository
git clone [https://github.com/YourUsername/Weather-App.git](https://github.com/YourUsername/Weather-App.git) cd Weather-App -
Create Config File Create a file named src/js/config.js and add your OpenWeatherMap key:
export const CONFIG = { API_KEY: "YOUR_OPENWEATHER_API_KEY", // Replace this API_BASE_URL: "[https://api.openweathermap.org/data/2.5/weather](https://api.openweathermap.org/data/2.5/weather)", ASSETS: { VIDEO_PATH: './assets/videos/', SOUND_PATH: './assets/sounds/', IMAGE_PATH: './assets/images/' } };
-
Run Locally Since this uses ES6 Modules, you must use a local server (VS Code Live Server recommended).
- Open index.html with Live Server.
If you are deploying to Netlify, you cannot push your API key to GitHub. Use the included Script Generator:
-
Push your code (excluding config.js).
-
In Netlify, go to Site Settings > Environment Variables.
-
Add MY_WEATHER_KEY with your actual API Key.
-
Set the Build Command to:
node generate-config.js
-
Deploy! The script will generate the config file on the server automatically.
π Project Structure
Weather-App/
βββ assets/
β βββ videos/ # Optimized .mp4 loops (<5MB)
β βββ sounds/ # Ambient .mp3 files
β βββ images/ # Fallback posters
βββ src/
β βββ css/
β β βββ main.css # Glassmorphism & Animations
β βββ js/
β βββ api.js # Fetch logic
β βββ audio.js # Howler.js logic
β βββ ui.js # DOM Manipulation
β βββ utils.js # Theme Priority Logic
β βββ main.js # Entry point
βββ index.html
βββ generate-config.js # Deployment script
βββ README.mdMade with β€οΈ by OMI
OpenWeatherMap API β’ HTML5 Video β’ Howler.js β’ GSAP