A clean, functional weather dashboard built with vanilla JavaScript and ES modules. Features a modern dark/light theme, animated weather effects, and a responsive design.
Coded by Nate
- City Search - Autocomplete with 300ms debounce and keyboard navigation
- Geolocation - "My Location" button with permission handling
- Current Weather - Temperature, feels like, high/low, humidity, wind, precipitation
- 3-Day Forecast - Daily forecasts with weather icons
- Temperature Toggle - Switch between °F and °C
- Dark/Light Mode - Toggle with preferences saved to localStorage
- Recent Searches - Quick access to last 5 searched cities
- Dynamic Backgrounds - Background changes based on weather conditions
- Animated Weather Icons - Subtle animations for different weather types
- Backend Proxy - Firebase Functions for secure API key storage
| Category | Technology |
|---|---|
| Frontend | HTML5, CSS3, Vanilla JavaScript (ES Modules) |
| Styling | CSS Custom Properties, Flexbox, Grid, Animations |
| Backend | Firebase Cloud Functions (Node.js 20) |
| Hosting | Firebase Hosting |
| API | OpenWeatherMap (Geocoding, Weather, Forecast) |
| Build | No build tools required - runs directly in browser |
- Get an API key from OpenWeatherMap
- Edit
js/config.js:MODE: 'direct', API_KEY: 'your-api-key-here',
- Run a local server:
npx serve . - Open http://localhost:3000
- Install Firebase CLI:
npm install -g firebase-tools - Login:
firebase login - Create project:
firebase projects:create stratus-update - Set API key securely:
firebase functions:config:set openweather.key="YOUR_API_KEY" - Install functions dependencies:
cd functions && npm install && cd ..
- Deploy:
firebase deploy
stratus-update/
├── index.html # Main HTML file
├── styles.css # All styling (themes, animations)
├── firebase.json # Firebase config
├── README.md # This file
├── js/
│ ├── config.js # Mode & API settings
│ ├── api.js # API calls (supports proxy mode)
│ ├── app.js # Main entry point
│ └── ... # Other modules
└── functions/
├── index.js # Cloud Functions (API proxy)
└── package.json # Functions dependencies
The app supports two modes configured in js/config.js:
| Mode | API Key Location | Use Case |
|---|---|---|
direct |
Client-side (visible) | Local development |
proxy |
Server-side (secure) | Production |
In proxy mode, the API key is stored in Firebase Functions config and never exposed to the client.
MIT License - Feel free to use and modify!