A simple, elegant, and responsive Weather App built with HTML, CSS, and JavaScript that allows users to search for real-time weather data of any city.
The app fetches live data from the OpenWeatherMap API and displays details like temperature, humidity, pressure, and wind information β all wrapped in a clean, modern UI.
- π City-based weather search
- Users can search for any city around the world.
- π¨ Detailed weather information
- Displays temperature, weather description, humidity, pressure, wind speed, and direction.
- π‘οΈ Dynamic weather icons
- Weather condition icons fetched directly from the OpenWeather API.
- β‘ Skeleton Loader
- A sleek skeleton loading animation appears while fetching data, giving users a smooth and responsive experience.
- π± Fully Responsive
- Works seamlessly on desktop, tablet, and mobile devices.
- π§ Wind direction converter
- Converts numerical wind degrees into compass directions (e.g., 90Β° β βEβ).
- HTML5 β for structure
- CSS3 β for styling and responsiveness
- JavaScript (ES6) β for data fetching and DOM manipulation
- OpenWeatherMap API β for real-time weather data
- When the page loads, the app automatically shows weather data for a default city (London).
- Users can type a new city name in the search bar.
- The app validates the input to ensure it only contains letters, spaces, hyphens, or apostrophes.
- While the data is being fetched, skeleton loader animations appear to indicate loading.
- Once the data is retrieved:
- The loader disappears.
- Weather details update instantly with the latest information.
weather-app/ β βββ index.html # Main HTML file βββ style.css # Styles and responsive design βββ script.js # Main JavaScript logic βββ img/ # Icon images (search, humidity, pressure, etc.)
-
Get your free API key from OpenWeatherMap.
-
Open
script.jsand replace the existing key:const APIKey = "YOUR_API_KEY_HERE";
Feel free to fork, improve, and use it whereever necessary
Pull Requests are always welcome!