A tiny web app that shows how much sunshine Helsinki has received over a selected number of past days.
You can choose preset ranges (5, 10, 15, 30 days) or use a slider to pick any number of days and the app calculates the total sunshine automatically.
- Fetches sunshine data on the server side
- Converts raw seconds into readable time (hours + minutes)
- Interactive slider + preset buttons
- Tailwind UI
https://my-sunshine-rho.vercel.app/
- Next.js (App Router)
- React
- Javascript
- Tailwind CSS
git clone https://github.com/makekop/my-sunshine.git
cd my-sunshinenpm installnpm run devOpen in your browser:
http://localhost:3000
The page fetches sunshine data automatically.
1️⃣ The app calls a sunshine API on the server. 2️⃣ It stores the daily sunshine values in memory. 3️⃣ When the user selects a timeframe, the app:
- slices the last N days
- sums the total seconds
- converts them to hours + minutes
Then it displays:
Over the past X days, Helsinki has had Y hours Z minutes of sunshine.
- Add other cities
- Add forecast for sunshine
- Compare cities
All Suggestions & PRs are welcome!
MIT