Skip to content

A simple and responsive weather application built using HTML, CSS, and JavaScript. It uses the OpenWeatherMap API to fetch real-time weather data based on city names entered by the user. Includes geolocation via the Geocoding API, displays weather icons and descriptions, and handles empty or invalid input gracefully.

Notifications You must be signed in to change notification settings

Pxdarkshadow/Weather-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🌦️ Simple Weather App

A minimalist weather application built using HTML, CSS, and JavaScript, which fetches real-time weather data using the OpenWeatherMap API. Users can enter a city name to get the current weather, including temperature and conditions.


📸 Preview

![Weather App Screenshot]Screenshot 2025-05-30 124824


🔧 Features

  • 🔍 Search weather by city name
  • 🌍 Uses Geocoding API to convert city names into coordinates
  • 📡 Fetches weather data in real-time
  • 🌤️ Displays:
    • City name
    • Temperature in Celsius
    • Weather description
    • Weather icon
  • ❌ Handles:
    • Empty input
    • Invalid city names
    • Failed API requests

🛠️ Tech Stack


📂 Project Structure


/weather-app
│
├── index.html           # Main HTML file
├── weather.js           # JavaScript for fetching & displaying weather
├── style.css            # Basic styling


⚙️ Setup Instructions

  1. Clone the repository:

    git clone https://github.com/your-username/weather-app.git
    cd weather-app
  2. Get your API key from OpenWeatherMap and replace the placeholder in weather.js:

    const apiKey = "your_api_key_here";
  3. Open the index.html file in your browser.


🧠 How It Works

  • User enters a city name.
  • The app uses OpenWeatherMap’s Geocoding API to get latitude and longitude.
  • Those coordinates are used in a weather data API request.
  • The response is parsed and displayed on the UI.

🧪 Error Handling

The app will show user-friendly messages for:

  • Empty inputs
  • Non-existent cities
  • API or network failures

🙌 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Open pull requests

📄 License

This project is open-source and available under the MIT License.


✨ Credits

  • Icons and data from OpenWeatherMap
  • UI design inspiration from clean and minimal weather apps
  • Project inspired by Codedex's "View Weather with HTML, CSS & JS"

📬 Contact

Created by Shaun – feel free to connect!

About

A simple and responsive weather application built using HTML, CSS, and JavaScript. It uses the OpenWeatherMap API to fetch real-time weather data based on city names entered by the user. Includes geolocation via the Geocoding API, displays weather icons and descriptions, and handles empty or invalid input gracefully.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published