A simple weather application built with JavaScript that fetches and displays weather information using a weather API.
- Fetch current weather information for a specific location.
- Display temperature, weather conditions, humidity, and wind speed.
- Responsive design for different screen sizes.
- Error handling for invalid location inputs.
You can check out the live demo of the app here.
- Clone the repository:
git clone https://github.com/MALB1993/weather-with-js.git
- Navigate to the project directory:
cd weather-app - Open
index.htmlin your favorite browser to run the app locally.
- Enter the name of the city in the input field.
- Click the "Get Weather" button to fetch and display the weather information.
This application uses the OpenWeatherMap API to fetch weather data.
- Sign up at OpenWeatherMap.
- Go to the API keys section in your account.
- Generate a new API key.
Replace YOUR_API_KEY in the script.js file with your actual API key.
const apiKey = 'YOUR_API_KEY';- install npm
npm install- Development
npm run devif you want change port goto package.json line-7 => scripts => dev "dev": "vite --port=YOUR_PORT",
http://localhost:3000-Build Project
npm run build-Preview
npm run preview- HTML5
- CSS3
- JavaScript (ES6)
- OpenWeatherMap API
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Demo Section: Update the demo link with the actual link to your live app if it's hosted somewhere.
- License Section: Ensure you have a
LICENSEfile in your repository, or you can remove that section if you do not have one. - API Key Instructions: Provide clear instructions on obtaining and setting up the API key, as this is crucial for the app to work.
This README.md provides a comprehensive guide to your weather app, covering all essential aspects from installation to usage and contribution guidelines.