Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
09b4c01
Set up initial project structure, add WebDraft editor core, layer man…
rtcoder Jun 8, 2026
079c20b
Implement layers panel with full CRUD functionality and integrate int…
rtcoder Jun 8, 2026
aa22765
Add image upload and PNG export functionality to WebDraft editor
rtcoder Jun 8, 2026
9fc386b
Add shape tools (rectangle and ellipse) with preview and commit funct…
rtcoder Jun 8, 2026
acb5c5c
Add keyboard shortcuts for tools, export, and editor actions with siz…
rtcoder Jun 8, 2026
02af02c
Add undo/redo functionality with history management and integrate too…
rtcoder Jun 8, 2026
324b352
Add selection, copy, cut, and paste functionality with toolbar button…
rtcoder Jun 8, 2026
d216686
Add text tool with preview, input, and commit functionality; integrat…
rtcoder Jun 8, 2026
49e4fd1
Add fill options for shape tools with color picker and toggle; integr…
rtcoder Jun 8, 2026
5198179
Add color sampler tool with support for color picking, keyboard short…
rtcoder Jun 8, 2026
6418310
Add web drawing tool with sensitivity control, keyboard shortcut, and…
rtcoder Jun 8, 2026
6ca5399
Add layer renaming and preview support with UI enhancements to layers…
rtcoder Jun 8, 2026
f1b8113
Add active layer transformations: invert, rotate, and mirror with too…
rtcoder Jun 8, 2026
c28902b
Add responsive layout polish and refactor toolbar structure with impr…
rtcoder Jun 8, 2026
b643a46
Add core pixel buffer transformations (invert, rotate, mirror) with t…
rtcoder Jun 8, 2026
892566f
Add canvas resize, shadow effects, text formatting, and camera snap f…
rtcoder Jun 8, 2026
94a3dd3
Refactor: Extract canvas rendering and geometry utilities into separa…
rtcoder Jun 8, 2026
59e522e
Refactor: Modularize toolbar controls and sections, extract reusable …
rtcoder Jun 8, 2026
7e62210
Refactor: Introduce document-level history snapshot management and re…
rtcoder Jun 8, 2026
9c730dd
Refactor: Replace undo/redo stack logic with `HistoryManager` for cen…
rtcoder Jun 8, 2026
1bbcbfc
Add configurable history limit to `HistoryManager`, enforce trimming,…
rtcoder Jun 8, 2026
1d94bb9
Add status toast system with `createStatusToasts`, integrate into too…
rtcoder Jun 8, 2026
54c9e8e
Add `manual-qa-checklist.md`, update `rewrite-checklist.md` for QA st…
rtcoder Jun 8, 2026
b19aafe
Add flood-fill functionality, implement fill bucket tool, and include…
rtcoder Jun 8, 2026
0c7eee0
Add fill tolerance to flood-fill tool with UI control, update tests, …
rtcoder Jun 8, 2026
ccf21ae
Add visited pixel tracking to flood-fill algorithm and include test f…
rtcoder Jun 8, 2026
03cb0be
Add `getClippedPasteBounds` to constrain pasting within canvas bounda…
rtcoder Jun 8, 2026
0d9d87b
Add camera panel with live preview, filter controls, snapshot functio…
rtcoder Jun 9, 2026
f4bd654
Update tool configurations to use SVG icons, add `createSvgIcon` util…
rtcoder Jun 9, 2026
6ebbb21
Improve UI responsiveness by adding dynamic visibility controls for t…
rtcoder Jun 9, 2026
1ce7111
Add right panel with toolbar for layer controls, update layout to acc…
rtcoder Jun 9, 2026
159f637
Refactor right panel creation into `createRightPanel`, consolidate to…
rtcoder Jun 9, 2026
e4d9c64
Add `.wdraft` project format support with save and open functionality…
rtcoder Jun 9, 2026
ee656e0
Switch `.wdraft` format to binary encoding (v2), replacing JSON; upda…
rtcoder Jun 10, 2026
198a82e
Add interactive color picker with multiple tabs (HSV, wheel, HS recta…
rtcoder Jun 10, 2026
1940ee2
Add menu bar with dropdown functionality, refactor app structure into…
rtcoder Jun 10, 2026
4beb6a5
Add i18n support with English and Polish translations, integrate dyna…
rtcoder Jun 10, 2026
cdeac3e
Split i18n files for better modularity and maintainability, restructu…
rtcoder Jun 10, 2026
77e0c82
Add save dialog with project and PNG export options, keyboard shortcu…
rtcoder Jun 10, 2026
a1c7077
Add dynamic layer name localization in English and Polish, refactor `…
rtcoder Jun 10, 2026
d50783f
Add language selector with dynamic switching, state persistence, and …
rtcoder Jun 10, 2026
51dc4c3
Add support for layer positioning with `x` and `y` coordinates, integ…
rtcoder Jun 11, 2026
830bf2a
Add layer resizing functionality with UI dialog, enhance canvas resiz…
rtcoder Jun 11, 2026
667162b
Normalize coordinate handling by introducing `toLayerPoint` utility; …
rtcoder Jun 11, 2026
6d26847
Add support for text layers, including creation, editing, and text pe…
rtcoder Jun 11, 2026
dc9152b
Defer text layer edit-mode entry to pointerup for improved event hand…
rtcoder Jun 11, 2026
3fea509
Improve text layer detection and editing: introduce `findTextLayerAt`…
rtcoder Jun 11, 2026
8796bf2
Add rich text editing support: implement `createTextToolbar`, enhance…
rtcoder Jun 11, 2026
8739eec
Add canvas zoom support: implement zoom levels, keyboard shortcuts, m…
rtcoder Jun 11, 2026
abfdc22
Remove unused core modules: delete `canvas-drawing`, `editor-geometry…
rtcoder Jun 11, 2026
858b34c
Add custom SVG favicon and link it in `index.html`; remove `favicon.i…
rtcoder Jun 11, 2026
338a1a6
Update `vite` dependency to a fixed version and replace `esbuild` pac…
rtcoder Jun 11, 2026
013142f
Add GitHub Actions CI workflow for testing and building
rtcoder Jun 11, 2026
00d692d
Expand README with detailed project overview, features, keyboard shor…
rtcoder Jun 11, 2026
1c09916
Add GitHub Pages deployment workflow and configure Vite for productio…
rtcoder Jun 11, 2026
97d2426
Modularize editor logic: add `SelectionController`, `TextEditControll…
rtcoder Jun 11, 2026
4d90ccb
Refactor: modularize type definitions and streamline imports across c…
rtcoder Jun 11, 2026
adfccc7
Abstract platform-specific modifier key handling; update keyboard sho…
rtcoder Jun 11, 2026
8eedd8f
Remove deprecated keyboard shortcut entry for PNG export in README.
rtcoder Jun 11, 2026
a96ff62
Add keyboard shortcuts help dialog with translations and UI styling.
rtcoder Jun 11, 2026
d69cc43
Remove `createResizeSection` and references from toolbar to streamlin…
rtcoder Jun 11, 2026
8363b63
Unify file input handling for images and projects; remove redundant U…
rtcoder Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
check:
name: Test & Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests and build
run: npm run check
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to GitHub Pages

on:
push:
branches: [master, main]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/nbproject/private/
nbproject/
node_modules/*
dist/
node_modules/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/WebDraft.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/dictionaries/project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 0 additions & 54 deletions Gruntfile.js

This file was deleted.

132 changes: 131 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,132 @@
# WebDraft
App for drawing

[![CI](https://github.com/rtcoder/WebDraft/actions/workflows/ci.yml/badge.svg)](https://github.com/rtcoder/WebDraft/actions/workflows/ci.yml)

A fast, lightweight browser-based image editor built with vanilla TypeScript and the Canvas 2D API — no frameworks, no bloat, just a crisp drawing experience that loads instantly.

---

## Why WebDraft?

- **No installation** — open in any modern browser and start drawing
- **Offline-ready** — works without an internet connection after the first load
- **Privacy-first** — your images never leave your machine
- **Snappy** — built directly on Canvas 2D with zero runtime dependencies

---

## Features

### Drawing tools

| Tool | Description |
|------|-------------|
| Brush | Freehand painting with configurable size and hardness |
| Eraser | Remove pixels with smooth edges |
| Bucket fill | Flood-fill with tolerance control |
| Line | Straight lines with adjustable thickness |
| Rectangle | Outlined or filled rectangles |
| Ellipse | Outlined or filled ellipses |
| Move | Reposition the active layer |
| Eyedropper | Sample any colour from the canvas |
| Text | Rich text with live HTML editing |

### Brush & style
- Stroke and fill colour with independent opacity
- Shadow: enable/disable, colour, blur, X/Y offset
- Configurable brush size
- Web sensitivity for pressure-like variation

### Rich text editing
- Live `contenteditable` editor overlaid on the canvas
- Floating toolbar: **bold**, *italic*, underline, font family, font size, colour, alignment
- Edits render to canvas with full word-wrap matching the layer bounds

### Layers
- Add, delete, rename, and reorder layers
- Per-layer visibility toggle and opacity control
- Independent image data per layer — non-destructive editing

### Image operations
- Resize canvas with custom width/height
- Invert colours
- Mirror horizontally or vertically
- Rotate 90° left or right

### Canvas & viewport
- Zoom: 10 % – 800 % in discrete steps
- Ctrl + scroll wheel to zoom in/out
- Ctrl + `=` / `+` — zoom in
- Ctrl + `-` — zoom out
- Ctrl + `0` — reset zoom to 100 %
- Zoom percentage indicator in the menu bar

### File & export
- Save/open projects in `.wdraft` format (JSON, preserves all layers and state)
- Import images onto a new layer (PNG, JPG, …)
- Export the flattened canvas as PNG

### Undo / redo
- Full history stack
- Ctrl + Z — undo
- Ctrl + Y — redo

### Localisation
- English and Polish UI
- Language auto-detected from `navigator.languages`
- Switcher in the menu bar

---

## Keyboard shortcuts

| Shortcut | Action |
|----------|--------|
| Ctrl + Z | Undo |
| Ctrl + Y | Redo |
| Ctrl + S | Save project |
| Ctrl + O | Open project |
| Ctrl + scroll | Zoom in / out |
| Ctrl + = / + | Zoom in |
| Ctrl + - | Zoom out |
| Ctrl + 0 | Reset zoom |

---

## Getting started

```bash
git clone https://github.com/rtcoder/WebDraft.git
cd WebDraft
npm install
npm run dev
```

Then open [http://localhost:5173](http://localhost:5173).

### Build

```bash
npm run build
```

### Type-check + build (CI)

```bash
npm run check
```

---

## Tech stack

- **TypeScript** — strict, zero-`any` codebase
- **Vite** — instant HMR dev server and optimised production build
- **Canvas 2D API** — all rendering, no WebGL
- **Zero runtime dependencies**

---

## License

MIT
Loading
Loading