Build a lightweight, responsive weather application using Vanilla JavaScript and a free Weather API to fetch and display real-time weather data based on user input (city name or geolocation).
- Must Use: HTML5, CSS3
- Vanilla JavaScript (ES6+)
- Fetch API
- Free Weather API
- LocalStorage for caching
- Error handling and loading indicators
🔍 Search weather by city 📍 Get weather for current location 🌡️ Displays temperature, weather conditions and locale date, time.
- Clone the repo:
git clone https://github.com/your-username/weather-app.git - cd
weather-app - Add your API key inside the JS file:
const api_key = "your_api_key_here"; - Open
index.htmlin any browser:
weather-app/
│
├── index.html # Main HTML file
├── style.css # CSS styles
├── script.js # JS logic (API calls, DOM updates)
└── assets/ # Optional: images, icons, etc.
You can easily deploy this app using:
- GitHub Pages
- Netlify
- Vercel