A clean and simple weather application that displays the current weather and a 5-day forecast for any location. It features dynamic backgrounds that change based on the weather conditions and time of day.
- Current Weather: Displays temperature, feels like, humidity, wind speed, UV index, visibility, sunrise, and sunset times.
- 5-Day Forecast: Shows a summary for the next five days, including high/low temperatures and weather icons.
- Automatic Location Detection: On first load, the app attempts to show weather for the user's current location.
- Manual Search: Users can search for any city or location worldwide.
- Dynamic UI:
- The background and theme change between day and night.
- Animated backgrounds for cloudy and rainy conditions.
- Animated stars for the night theme.
- Loading & Error States: Provides clear feedback to the user while fetching data or if an error occurs.
To run this project locally, follow these simple steps:
-
Clone the repository:
git clone <your-repository-url>
-
Get a free API Key: This project uses the Visual Crossing Weather API. You will need to get your own free API key to make it work.
- Go to https://www.visualcrossing.com/weather-api
- Sign up for a free account.
- Get your API key from your account page.
-
Add the API Key to the project:
- Open the
javascript.jsfile. - Find the
apiKeyconstant on line 45. - Replace the placeholder string with your actual API key.
const apiKey = "YOUR_REAL_API_KEY";
Note: It's important not to commit your real API key to a public repository.
- Open the
-
Run the application:
- Simply open the
index.htmlfile in your favorite web browser.
- Simply open the
Just go to issues page and show your innovations