htmlboard 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +289 -2
- package/bin/htmlboard.js +297 -0
- package/package.json +48 -4
- package/skills/htmlboard/SKILL.md +95 -0
- package/src/client/explorer.css +703 -0
- package/src/client/explorer.js +693 -0
- package/src/client/index.html +191 -0
- package/src/index.js +20 -0
- package/src/server.js +451 -0
- package/src/skills.js +116 -0
- package/src/templates/artboards/components.html +199 -0
- package/src/templates/artboards/desktop.html +397 -0
- package/src/templates/artboards/mobile.html +383 -0
- package/src/templates/designs.json +50 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: htmlboard
|
|
3
|
+
description: Design UI in plain HTML files and show them side by side on an infinite, live-reloading canvas with the htmlboard CLI. Use when the user asks for mockups, screens, design variants or explorations, components, flyers or any visual proposal, or mentions htmlboard, artboards or designs.json.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HtmlBoard
|
|
7
|
+
|
|
8
|
+
HtmlBoard serves a folder of HTML files as artboards on a zoomable canvas, like a Figma page. Every design is one ordinary HTML file, so you design by writing HTML and CSS, and the user sees the result update live while you work.
|
|
9
|
+
|
|
10
|
+
## Start the canvas
|
|
11
|
+
|
|
12
|
+
Run it in the background, pointed at the designs folder (it is created if missing):
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npx htmlboard designs --open
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- It prints the URL (default `http://localhost:3000`; if the port is busy it takes the next free one). Give the URL to the user.
|
|
19
|
+
- `-p <port>` picks the port. `--init` adds three sample artboards and a `designs.json`; skip it unless the user wants a starter.
|
|
20
|
+
- If the artboards link to files above the designs folder (`../css/theme.css`), serve from the project root: `npx htmlboard design --root .`
|
|
21
|
+
- An empty folder gets the samples automatically, so write your first artboard before starting the server.
|
|
22
|
+
- If a server is already running for this folder, reuse it. `GET /api/health` answers `{"status":"ok","dir":…}`.
|
|
23
|
+
|
|
24
|
+
## Write an artboard
|
|
25
|
+
|
|
26
|
+
One design per file. Keep each file self-contained so it renders on its own:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<!DOCTYPE html>
|
|
30
|
+
<html lang="en">
|
|
31
|
+
<head>
|
|
32
|
+
<meta charset="UTF-8">
|
|
33
|
+
<title>Checkout · variant B</title> <!-- the artboard's title on the canvas -->
|
|
34
|
+
<style>
|
|
35
|
+
body { margin: 0; }
|
|
36
|
+
.screen { width: 390px; min-height: 844px; /* … */ }
|
|
37
|
+
</style>
|
|
38
|
+
</head>
|
|
39
|
+
<body>
|
|
40
|
+
<main class="screen">…</main>
|
|
41
|
+
</body>
|
|
42
|
+
</html>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Design at the real size of the target: phone 390×844, tablet 768×1024, desktop 1280×800 (or 1440×900), and the exact size for print or social formats (e.g. 1080×1350).
|
|
46
|
+
- Use real content in the user's language, not lorem ipsum.
|
|
47
|
+
- Relative links to shared CSS, images, scripts and fonts work (`assets/logo.svg`; `../css/theme.css` with `--root`). Reuse the project's own stylesheet and tokens when there is one.
|
|
48
|
+
- No build step: plain HTML, CSS and browser JavaScript (ES modules and CDN scripts work).
|
|
49
|
+
|
|
50
|
+
## How the canvas lays out files
|
|
51
|
+
|
|
52
|
+
**Without `designs.json`** (zero config), every `.html` under the folder is an artboard:
|
|
53
|
+
|
|
54
|
+
- Each subfolder is a section (row); files at the top level go to "Root Designs".
|
|
55
|
+
- The size comes from words in the file's path: `mobile`, `phone`, `iphone` → 390×844; `tablet`, `ipad` → 768×1024; `component`, `ui`, `atomic` → 720×600; `desktop`, `laptop`, `screen` → 1280×800; anything else → 1200×800. Name files accordingly, e.g. `checkout/mobile-variant-b.html`.
|
|
56
|
+
- Hidden folders, `node_modules`, `dist` and `build` are skipped.
|
|
57
|
+
|
|
58
|
+
**With `designs.json`** in the designs folder, the manifest replaces discovery completely: a file not listed in it doesn't show. Use it to choose order, sizes and grouping:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"title": "Checkout redesign",
|
|
63
|
+
"sections": [
|
|
64
|
+
{
|
|
65
|
+
"title": "Checkout · mobile",
|
|
66
|
+
"description": "Three directions for the payment step",
|
|
67
|
+
"designs": [
|
|
68
|
+
{ "file": "checkout/a.html", "title": "A · current", "width": 390, "height": 844 },
|
|
69
|
+
{ "file": "checkout/b.html", "title": "B · one page", "width": 390, "tags": ["proposal"] },
|
|
70
|
+
{ "file": "checkout/b.html?theme=dark", "title": "B · dark", "width": 390, "height": 844 }
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- Sections are rows, top to bottom; designs run left to right.
|
|
78
|
+
- `file` is relative to the designs folder and may carry a query string, so one file can show several states.
|
|
79
|
+
- Omit `height` to let the frame grow to the page's full height (long pages, boards, docs).
|
|
80
|
+
- Optional: `description` and `tags` (searchable); `category` for the toolbar filters (`desktop`, `mobile`, `tablet`, `components`; guessed from the path, then the width, when left out); `id` (derived from `file`).
|
|
81
|
+
- `name` and `artboards` are accepted as synonyms of a section's `title` and `designs`.
|
|
82
|
+
|
|
83
|
+
When the project already has a `designs.json`, add every new file to it.
|
|
84
|
+
|
|
85
|
+
## Live reload
|
|
86
|
+
|
|
87
|
+
- Saving an artboard's HTML reloads just that frame; the user's pan and zoom stay put.
|
|
88
|
+
- Saving `designs.json`, or creating a new HTML file, rebuilds the canvas.
|
|
89
|
+
- Saving a shared file (CSS, script, image) reloads every frame.
|
|
90
|
+
|
|
91
|
+
## Working with the user
|
|
92
|
+
|
|
93
|
+
- Put variants in separate files next to each other (`hero-a.html`, `hero-b.html`) instead of overwriting the current design, so they can be compared on the canvas. Keep the current one as the reference until the user picks.
|
|
94
|
+
- Say which files you created or changed and what to look at; the user is watching the canvas, not the code. Link straight to an artboard with `http://localhost:3000/#<id>` (the id is the file's path without `.html`, slashes and other symbols turned into `-`: `checkout/b.html` → `checkout-b`).
|
|
95
|
+
- If you can browse or take screenshots, open the artboard directly (`http://localhost:3000/<file>`) to check it at its real size before reporting back. Fix overflow, clipped text and broken images first.
|