This is a component you can use freely to show others your city's weather data.
View Documentation . Report bug
This is a demo site's repository. You can clone this repo and adjust to your liking, or even build your website on top of it. It took a long time to adjust bits of this component, and I believe it was worth it. weatherCard utilizes Open Weather API, so you will need an API key from them. You can use their free plan if you plan on building a small project. Also, for the maps feature, you will need Maps Static API from Google.
- SvelteKit
- Vite
- Tailwind CSS
- Skeleton
- Floating UI (with Skeleton)
- APIs mentioned in features.
First, install npm. The latest version recommended as all the packages in this project were updated to their latest versions on February 2024.
npm install -g npm
After, clone the repository.
git clone https://github.com/ondersumer07/weatherCard.git
Then, you need to install the project packages.
npm install
Go crazy!
This component supports every possible weather condition mentioned in Open Weather API. It has 7 different animated backgrounds for various situations. Even if the title isn't directly supported, it's replaced by the most similar weather condition. Here are those animations:
Besides the weather condition, weatherCard also has a popup feature that shows the geographical location of your city. It uses Google's Maps Static API which is also customizable. You need to adjust your city name in the +page.server.js. You can find more detailed information about how to customize it in the documentation. Here's how the maps function work:
To run this project, you will need to add the following environment variables to your .env file
OPEN_WEATHER_API_KEY
MAPS_API_KEY
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after you edit the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PR for each suggestion.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Licensed under BSD-3.
If you have any feedback or questions, you can always reach out to [email protected]