Built as an experiment to try out zustand and a Vite + ShadCN + Express stack.
carousel-editor.mp4
-
Navigate around:
- Scroll to move the view
- Hold Cmd/Ctrl + scroll to zoom in/out
- Hold Cmd/Ctrl + drag to move the view
-
Add stuff:
- Click the "Add layer" button to upload an image
- Or just drag images directly onto a slide
- Click "Add slide" to create a new slide
-
Work with images:
- Click on an image to select it
- When an image is selected, press backspace or delete to remove it
- Drag the corners to resize (Hold shift to to keep aspect ratio)
- Drag the rotation handle to rotate (Hold shift to rotate in 45 degree increments)
- Images snap to edges of other images and slides
-
Delete slides:
- Right-click on any slide to get a delete button
You'll need Node.js and pnpm installed.
# Install dependencies
pnpm install
# Start both the frontend and backend
pnpm dev-
Frontend: React + TypeScript + Vite + Tailwind
-
State: Zustand with Immer for state management Uses DOM elements to manage layers and slides (canvases). Zoom + Pan + Rotates made possible via CSS transforms.
-
UI: A few shadcn/Radix UI components + Lucide icons
-
Backend: Express (didn't end up using)
This is just a prototype but it's set up to work well with:
- Saving projects (it has serialisable state)
- Live collaboration (Zustand+Immer works well with Yjs)