Glitch Postcards

A playful postcard designer where users upload (or pick from built-in) photos, then apply simple “glitch” effects—pixel-sorting strips, RGB channel shift, scanlines, and noise—with live preview and a one-click randomize button. Users can add a short message with typographic presets, choose a color frame, and export the final postcard as a PNG. All created postcards are saved locally with a small gallery view for re-editing, duplicating, and deleting.

To Do30
Scaffold app baseline

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

by system

Add Tailwind styles

Configure Tailwind content paths and add @tailwind directives to src/index.css.

by system

Set up shadcn UI

Add shadcn/ui components needed (Button, Card, Dialog, Input, Slider, Select, Tabs, DropdownMenu, Tooltip) via the shadcn CLI.

by system

Define postcard types

Create src/types/postcard.ts with interfaces for Postcard, EffectsConfig, TextConfig, and FrameConfig.

by system

Add localStorage helpers

Create src/lib/storage.ts with load/save CRUD helpers for postcards in localStorage.

by system

Add ID + date utils

Create src/lib/id.ts to generate unique IDs and timestamps for saved postcards.

by system

Add built-in images list

Create src/data/builtinImages.ts exporting a small array of bundled image URLs + labels.

by system

Create app layout shell

Implement src/App.tsx with a two-column layout (editor + gallery) using shadcn Card/Tabs.

by system

Create top header bar

Add src/components/HeaderBar.tsx with app title and primary actions placeholder.

by system

Create canvas preview

Implement src/components/PostcardCanvas.tsx rendering a <canvas> and exposing a redraw() via props.

by system

Implement base render pipeline

Create src/lib/render/renderPostcard.ts to draw photo, frame, text, and effects onto a canvas.

by system

Add image loading helper

Create src/lib/render/loadImage.ts returning an HTMLImageElement from a URL/DataURL safely.

by system

Implement scanlines effect

Create src/lib/effects/scanlines.ts applying scanline overlay to ImageData.

by system

Implement noise effect

Create src/lib/effects/noise.ts applying adjustable monochrome noise to ImageData.

by system

Implement RGB shift effect

Create src/lib/effects/rgbShift.ts shifting color channels by configurable offsets.

by system

Implement pixel-strip sort

Create src/lib/effects/pixelStrips.ts generating horizontal/vertical glitch strips with sorting/offset.

by system

Compose effects pipeline

Create src/lib/effects/applyEffects.ts to apply enabled effects in a deterministic order.

by system

Add randomize effects

Create src/lib/randomize.ts to generate a randomized EffectsConfig (with sane bounds).

by system

Create photo picker UI

Implement src/components/PhotoPicker.tsx with upload input plus built-in image selection.

by system

Add upload to DataURL

Create src/lib/fileToDataUrl.ts converting an uploaded file to a DataURL for storage/rendering.

by system

Create effects controls UI

Implement src/components/EffectsPanel.tsx with sliders/toggles for all glitch effects.

by system

Create text presets data

Create src/data/textPresets.ts defining a few typographic presets (font size, weight, tracking, alignment).

by system

Create message editor UI

Implement src/components/MessagePanel.tsx with textarea and preset selector.

by system

Create frame selector UI

Implement src/components/FramePanel.tsx with color swatches and thickness slider.

by system

Wire editor state

Create src/hooks/usePostcardEditor.ts managing current postcard draft state and change handlers.

by system

Add live preview updates

Update src/components/EditorPage.tsx to call render pipeline on state changes and redraw canvas.

by system

Implement export to PNG

Create src/lib/exportPng.ts to download the current canvas as a PNG file.

by system

Create gallery list UI

Implement src/components/GalleryPanel.tsx showing saved postcards as thumbnails with actions.

by system

Add gallery actions logic

Implement duplicate/delete/re-edit handlers in src/components/GalleryPanel.tsx using storage helpers.

by system

Persist postcards locally

Create src/hooks/usePostcardsStore.ts to load/save/update postcards in localStorage and expose actions.

by system

In Progress0
In Review0
Done0