Use draw mode to create rooms. Use select mode to move and resize rooms.
+ ++ drag on the grid to create +
From 696bb5c10f8449e084f95f6bb1ba78737a2cbe1a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 5 Sep 2026 20:13:37 +0000 Subject: [PATCH 1/3] Initial plan From 262c4945c727dd76182fd2c923302aafb9014d1d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 5 Sep 2026 20:20:01 +0000 Subject: [PATCH 2/3] Refactor into modular app with persistence and PWA baseline Co-authored-by: TalaeiDev <90834494+TalaeiDev@users.noreply.github.com> --- README.md | 81 +- icons/icon.svg | 6 + index.html | 216 +++ js/app.js | 2026 ++++++++++++++++++++++++++++ js/canvas.js | 38 + js/state.js | 6 + js/storage.js | 19 + js/tools.js | 28 + js/utils.js | 36 + manifest.json | 23 + pixel-forge-page.html | 2980 +---------------------------------------- service-worker.js | 39 + styles/components.css | 668 +++++++++ styles/layout.css | 243 ++++ styles/theme.css | 91 ++ 15 files changed, 3482 insertions(+), 3018 deletions(-) create mode 100644 icons/icon.svg create mode 100644 index.html create mode 100644 js/app.js create mode 100644 js/canvas.js create mode 100644 js/state.js create mode 100644 js/storage.js create mode 100644 js/tools.js create mode 100644 js/utils.js create mode 100644 manifest.json create mode 100644 service-worker.js create mode 100644 styles/components.css create mode 100644 styles/layout.css create mode 100644 styles/theme.css diff --git a/README.md b/README.md index f18bdbf..bc32a7b 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,49 @@ # Pixel Forge -Pixel Forge is a browser-based dungeon level designer for game developers, RPG creators, and world-builders. You can create intricate dungeon layouts with a drag-and-drop interface, edit in real time, and export or import your work. - -It works well for tabletop RPGs, video game level design, and quick prototyping. The project is maintained by [Pixel Clover](https://github.com/pixelclover). +Pixel Forge is a browser-based dungeon designer for creating room layouts with doors and hallways. + +## Project Structure + +- `index.html` – app markup and script/style includes +- `styles/theme.css` – theme variables, focus states, accessibility helpers +- `styles/layout.css` – base layout and panel/grid structure +- `styles/components.css` – room/door/hallway/UI component styles +- `js/app.js` – main editor logic and event wiring +- `js/canvas.js` – PNG/SVG export helpers +- `js/tools.js` – install prompt + service worker registration helpers +- `js/state.js` – lightweight runtime metrics store +- `js/utils.js` – debounce, raf-throttle, download, and time utilities +- `js/storage.js` – localStorage key and JSON helpers +- `manifest.json` / `service-worker.js` – basic PWA support ## Features -### Core Design Tools - -- Draw rooms by clicking and dragging with snap-to-grid precision. -- Select and move any room by clicking and dragging it. -- Resize rooms using the white handle on each room. -- Add doors to connect rooms with interactive anchors. -- Create hallways between rooms with movable anchor points. - -### Customization - -- Dark and light theme with local storage persistence. -- Wall thickness and color controls. -- Individual colors for each room. -- Connection labels that show the distance between rooms. - -### Power Features - -- Undo and redo with full history using Ctrl+Z and Ctrl+Y. -- Export and import levels as JSON files. -- Mini-map for an overview of the entire dungeon. -- Context menu with right-click for quick actions. -- Keyboard shortcuts for a professional workflow. -- Room preview with instant info on hover. +- Draw/select/move/resize dungeon rooms +- Doors and hallways with draggable anchors +- Undo/redo history +- JSON export/import +- PNG and SVG export +- Auto-save every 30 seconds to localStorage +- Manual save/load of latest project snapshot with timestamp status +- Mini-map, zoom controls, and fit-to-view +- Keyboard shortcut help modal +- PWA manifest + offline cache via service worker -### Keyboard Shortcuts +## Accessibility -| Key | Action | -|-----|--------| -| `1` | Draw mode | -| `2` | Select mode | -| `3` | Door mode | -| `4` | Hallway mode | -| `Ctrl+Z` | Undo | -| `Ctrl+Y` | Redo | -| `Ctrl+D` | Duplicate room | -| `Delete` | Delete selected | -| `Right-click` | Context menu | +- ARIA labeling for interactive controls +- Live status updates for save and toast feedback +- Focus-visible outlines for keyboard users +- Keyboard access for workspace and mini-map -## Getting Started +## Responsive Breakpoints -### Quick Start +- `900px` compact layout +- `768px` tablet adjustments +- `480px` mobile button wrapping +- `320px` small phone fallback -Clone the repository: +## Development -```bash -git clone https://github.com/pixelclover/pixel-forge.git +This repository is static HTML/CSS/JS and does not currently include a test runner. +Open `index.html` in a browser (or serve the directory) to use Pixel Forge. diff --git a/icons/icon.svg b/icons/icon.svg new file mode 100644 index 0000000..54446ef --- /dev/null +++ b/icons/icon.svg @@ -0,0 +1,6 @@ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..9c9d0c9 --- /dev/null +++ b/index.html @@ -0,0 +1,216 @@ + + +
+ + + + + + + + +Use draw mode to create rooms. Use select mode to move and resize rooms.
+ +Pixel Forge moved to index.html.
- \ No newline at end of file +