A minimalistic weather web app built with vanilla HTML, CSS, and JavaScript. Features current weather conditions, 12-hour forecasts, city search, and offline functionality.
- Current weather display with temperature and conditions
- 12-hour hourly forecast with weather icons
- City search and save multiple locations
- Works offline after first visit
- Responsive design for all devices
- Keyboard navigation and accessibility support
- Automatic dark/light mode switching
- Progressive Web App (installable)
No API key required. This app uses the free Open-Meteo weather API.
-
Download or clone this project
-
Serve the files using a local server:
# Python 3 python -m http.server 8000 # Node.js npx http-server # PHP php -S localhost:8000
-
Open browser and go to
http://localhost:8000
- Upload all files to your hosting service
- Access via your domain/URL
No configuration needed.
- Click menu button to open city search and saved cities
- Type city names to search and add new locations
- Click any saved city to view its weather
- Press Escape key to close the city menu
- Large temperature display with weather icon and background
- Four metrics showing temperature, humidity, wind, and pressure
- Scrollable 12-hour forecast with icons and temperatures
- Vanilla JavaScript with modern ES6+ features
- CSS custom properties for consistent theming
- Service worker for offline caching
- LocalStorage for persistent city preferences
- Open-Meteo Weather API (free, no sign-up required)
- Open-Meteo Geocoding for city search
- 15-minute request caching
- Graceful error handling
- 10,000 daily requests limit
- File sizes: HTML (~2KB), CSS (~8KB), JavaScript (~12KB), Icons (~3KB)
- Aggressive caching with service worker
- Minimal DOM manipulation
- Modern browsers: Chrome 80+, Firefox 75+, Safari 13+, Edge 80+
- Uses: Fetch API, CSS Grid, Service Worker, Web App Manifest
Edit CSS custom properties in styles.css:
:root {
--bg: #0e1116;
--surface: #1e232b;
--accent: #4c9be8;
--text: #ffffff;
--muted: #9aa5b1;
}Replace SVG files in /icons/ directory:
clear.svg- Clear weathercloud.svg- Cloudy conditionsrain.svg- Rainsnow.svg- Snowthunder.svg- Thunderstormsmist.svg- Fog/mist
-
Weather not loading:
- Check internet connection
- Check browser console for errors
- Verify Open-Meteo API is accessible
-
Search not working:
- Check geocoding API accessibility
- Try refreshing the page
- Verify city name spelling
-
App not installing:
- Use HTTPS (required for PWA)
- Check manifest.json accessibility
- Verify service worker registration
Open browser developer tools:
- Console: Check for JavaScript errors and API responses
- Network: Monitor API request status and caching
- Application: View service worker status and cache contents
WeatherApp/
├── index.html # Main HTML structure
├── styles.css # Styling and themes
├── app.js # JavaScript logic and API calls
├── sw.js # Service worker for caching
├── manifest.json # PWA configuration
├── .eslintrc.json # Code linting rules
├── README.md # Documentation
└── icons/ # Weather condition icons
├── clear.svg
├── cloud.svg
├── rain.svg
├── snow.svg
├── thunder.svg
└── mist.svg
- No data collection or personal information storage
- City preferences stored locally in browser only
- API calls only to Open-Meteo (free service)
- No tracking or analytics
- No sign-up required
Open source under the MIT License. See the root LICENSE file in the repository for full details.
Contributions welcome. Please submit issues, feature requests, or pull requests.
Built with vanilla web technologies.