A modern, responsive weather application that allows users to check weather conditions for their current location or any city worldwide. Built with HTML, CSS, and JavaScript, this application provides real-time weather data using the OpenWeather API.
- Current Location Weather: Get instant weather updates for your current location
- City Search: Search for weather information in any city worldwide
- Detailed Weather Information: View comprehensive weather data including:
- Temperature in Celsius
- Wind Speed
- Humidity Percentage
- Cloud Coverage
- Visual Indicators:
- Weather condition icons
- Country flags
- Loading animations
- Responsive Design: Works seamlessly on both desktop and mobile devices
- HTML5
- CSS3
- JavaScript (ES6+)
- OpenWeather API
- Flag API for country flags
- Google Fonts (Merriweather Sans)
-
Your Weather Tab:
- Click on "Your Weather" tab
- Grant location access when prompted
- View detailed weather information for your current location
-
Search Weather Tab:
- Click on "Search Weather" tab
- Enter a city name in the search box
- Click the search button or press Enter
- View weather details for the searched city
This project uses the OpenWeather API. You'll need to:
- Sign up at OpenWeather
- Get your API key
- Replace the API_KEY constant in
vikas.js
with your key
- Location Access: Uses browser's Geolocation API to fetch current coordinates
- Real-time Data: Fetches current weather conditions from OpenWeather API
- Dynamic UI: Smooth transitions between different views (loading, weather info, search)
- Error Handling: Graceful handling of API errors and invalid searches
- Responsive Design: Media queries ensure proper display across all device sizes
- Clone the repository
- Replace the API key in
vikas.js
with your OpenWeather API key - Open
index.html
in a web browser - Grant location access for local weather information
weatherinyourcity/
├── index.html
├── style.css
├── vikas.js
└── Images/
├── cloud.png
├── favicon.ico
├── humidity.png
├── loading.gif
├── location.png
├── not-found.png
├── search.png
└── wind.png
Feel free to fork this project and make improvements. Pull requests are welcome!
This project is open source and available under the MIT License.
- OpenWeather API for weather data
- Flag API for country flags
- Google Fonts for typography