Weather Sprite Lab

Build a playful “forecast-to-art” studio that turns today’s local weather (using the browser’s Geolocation + a public weather API fetch) into a tiny animated pixel sprite scene—sunny, rainy, windy, snowy—rendered on a grid canvas. Users can tweak parameters (palette, animation speed, scene elements like clouds/trees/umbrellas), save favorite generated sprites as “cards” to localStorage, and export the current scene as a PNG. The app is split into clear modules: weather fetch + parsing, sprite generator, canvas renderer/animator, controls panel, saved gallery, and export/share modal.

To Do30
Scaffold project

Run: npm create vite@latest . -- --template react-ts && npm i && npm i -D tailwindcss postcss autoprefixer && npx tailwindcss init -p && npm i @radix-ui/react-dialog @radix-ui/react-slider @radix-ui/react-tabs class-variance-authority clsx tailwind-merge lucide-react && npx shadcn@latest init.

by system

Add Tailwind styles

Configure tailwind.config + src/index.css with Tailwind directives and a minimal app background.

by system

Install shadcn components

Generate core shadcn/ui components (button, card, dialog, slider, tabs, switch, select, toast) via CLI.

by system

Define scene types

Create src/types.ts with WeatherData, SceneParams, SpriteFrame, SavedCard, and Palette types.

by system

Weather API module

Create src/lib/weatherApi.ts to fetch forecast data from Open-Meteo and normalize into WeatherData.

by system

Geolocation hook

Create src/hooks/useGeolocation.ts to request location and expose coords/loading/error.

by system

Weather query hook

Create src/hooks/useWeather.ts that consumes coords, fetches WeatherData, and exposes status + refresh.

by system

Weather-to-scene mapper

Create src/lib/weatherToScene.ts to map WeatherData into a base SceneParams preset (sun/rain/wind/snow).

by system

Palette presets

Create src/lib/palettes.ts exporting a few pixel-art palette presets and defaults.

by system

Seeded RNG helper

Create src/lib/rng.ts for deterministic sprite generation using a numeric seed.

by system

Sprite generator core

Create src/lib/spriteGenerator.ts that turns SceneParams + seed into a SpriteFrame[] pixel grid.

by system

Scene elements library

Create src/lib/elements.ts with pixel templates for sun, cloud, raindrop, snowflake, tree, umbrella.

by system

Animation frame builder

Create src/lib/animate.ts to derive multi-frame animations (cloud drift, rain fall, snow drift) from a base frame.

by system

Canvas renderer

Create src/lib/canvasRenderer.ts to draw a SpriteFrame onto an HTMLCanvasElement with scaling.

by system

Animator hook

Create src/hooks/useCanvasAnimator.ts to run requestAnimationFrame over frames with adjustable speed.

by system

PNG export utility

Create src/lib/exportPng.ts to export the current canvas to a downloadable PNG blob.

by system

LocalStorage repository

Create src/lib/storage.ts to save/load/delete SavedCard items from localStorage with versioning.

by system

Saved cards hook

Create src/hooks/useSavedCards.ts to manage SavedCard state backed by storage.ts.

by system

App shell layout

Implement src/App.tsx with header, main two-column layout, and footer placeholders.

by system

Sprite canvas component

Create src/components/SpriteCanvas.tsx to host the canvas and invoke renderer + animator.

by system

Controls panel UI

Create src/components/ControlsPanel.tsx with sections for palette, speed, and scene toggles.

by system

Palette selector

Create src/components/PaletteSelect.tsx using shadcn Select to choose among palette presets.

by system

Speed slider control

Create src/components/SpeedSlider.tsx using shadcn Slider to control animation speed.

by system

Scene toggles group

Create src/components/SceneToggles.tsx with Switches for clouds/trees/umbrella intensity options.

by system

Weather status badge

Create src/components/WeatherStatus.tsx to show location permission, fetch state, and current condition label.

by system

Regenerate button logic

Create src/components/RegenerateButton.tsx to bump the seed and trigger sprite regeneration.

by system

Save card button

Create src/components/SaveCardButton.tsx to snapshot current params/seed and add a SavedCard.

by system

Saved gallery grid

Create src/components/SavedGallery.tsx to render SavedCard thumbnails and basic metadata.

by system

Saved card item

Create src/components/SavedCardItem.tsx with preview canvas thumbnail and delete/load actions.

by system

Export/share modal

Create src/components/ExportModal.tsx (Dialog) to preview and download PNG from the current canvas.

by system

In Progress0
In Review0
Done0