Here’s the README content in a direct copy-and-paste format:
This Weather App allows users to check the current weather and a 5-day forecast for any city. The app fetches real-time weather data using the OpenWeather API and displays it in an easy-to-understand format. Users can also view their search history and toggle the temperature between Celsius and Fahrenheit.
- Real-time weather updates: Get current weather details for any city.
- 5-day forecast: See the weather forecast for the next five days.
- Search history: View your previously searched cities.
- Temperature toggle: Switch between Celsius and Fahrenheit.
- Responsive design: Works across desktop and mobile devices.
- HTML: For structuring the web pages.
- CSS: For styling the user interface.
- JavaScript: For handling logic, API calls, and interactivity.
- OpenWeather API: For fetching real-time weather data.
- Enter a city: Type the name of a city in the search bar.
- Click "Search": Get the current weather and 5-day forecast for that city.
- View Weather Data: You can see the temperature, weather description, wind speed, humidity, and pressure.
- Search History: Previously searched cities will appear in the history list. Click any city to view its weather again.
- Toggle Temperature: Click the "Toggle Temperature" button to switch between Celsius and Fahrenheit.
-
Clone the repository or download the project files.
git clone <repository_url>
-
Open the project in any code editor (like VSCode).
-
Add your OpenWeather API key:
- Get your free API key from OpenWeather.
- In the
app.jsfile, replace"your_openweather_api_key_here"with your actual API key.
const API_KEY = "your_openweather_api_key_here";
-
Run the project:
- Open the
index.htmlfile in a web browser to view and test the app.
- Open the
- Customizable Look: Modify the
styles.cssfile to customize the design. - More Weather Info: Add additional weather data from the API like UV index, sunrise/sunset times, etc.
This project is for learning purposes and can be modified as needed.