htmlboard 0.1.0 → 0.3.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/README.md +120 -92
- package/bin/htmlboard.js +93 -59
- package/package.json +2 -2
- package/skills/htmlboard/SKILL.md +27 -33
- package/src/client/explorer.css +302 -598
- package/src/client/explorer.js +983 -601
- package/src/client/favicon.svg +1 -0
- package/src/client/fonts/OFL-bricolage-grotesque.txt +93 -0
- package/src/client/fonts/OFL-inter.txt +93 -0
- package/src/client/fonts/bricolage-grotesque.woff2 +0 -0
- package/src/client/fonts/inter.woff2 +0 -0
- package/src/client/index.html +87 -175
- package/src/client/logo.svg +1 -0
- package/src/client/mark.svg +1 -0
- package/src/designs.js +398 -0
- package/src/index.js +8 -2
- package/src/migrate.js +193 -0
- package/src/server.js +93 -212
- package/src/templates/{artboards/desktop.html → 01-screens/01-desktop.html} +2 -0
- package/src/templates/{artboards/mobile.html → 01-screens/02-mobile.html} +2 -0
- package/src/templates/{artboards/components.html → 02-components/01-ui-kit.html} +2 -0
- package/src/templates/designs.json +0 -50
|
@@ -5,7 +5,7 @@ description: Design UI in plain HTML files and show them side by side on an infi
|
|
|
5
5
|
|
|
6
6
|
# HtmlBoard
|
|
7
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.
|
|
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 that says its own name and size, so you design by writing HTML and CSS, and the user sees the result update live while you work.
|
|
9
9
|
|
|
10
10
|
## Start the canvas
|
|
11
11
|
|
|
@@ -16,24 +16,26 @@ npx htmlboard designs --open
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
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
|
|
19
|
+
- `-p <port>` picks the port. `--init` adds sample designs; skip it unless the user wants a starter.
|
|
20
20
|
- If the artboards link to files above the designs folder (`../css/theme.css`), serve from the project root: `npx htmlboard design --root .`
|
|
21
21
|
- An empty folder gets the samples automatically, so write your first artboard before starting the server.
|
|
22
22
|
- If a server is already running for this folder, reuse it. `GET /api/health` answers `{"status":"ok","dir":…}`.
|
|
23
23
|
|
|
24
24
|
## Write an artboard
|
|
25
25
|
|
|
26
|
-
One design per file
|
|
26
|
+
One design per file, self-contained so it renders on its own, with its facts in the `<head>`:
|
|
27
27
|
|
|
28
28
|
```html
|
|
29
29
|
<!DOCTYPE html>
|
|
30
30
|
<html lang="en">
|
|
31
31
|
<head>
|
|
32
32
|
<meta charset="UTF-8">
|
|
33
|
-
<title>Checkout ·
|
|
33
|
+
<title>Checkout · one page</title> <!-- its name on the canvas -->
|
|
34
|
+
<meta name="description" content="Address and payment on one screen">
|
|
35
|
+
<meta name="htmlboard" content="width=390, height=844"> <!-- its size -->
|
|
34
36
|
<style>
|
|
35
37
|
body { margin: 0; }
|
|
36
|
-
.screen { width: 390px;
|
|
38
|
+
.screen { width: 390px; height: 844px; /* … */ }
|
|
37
39
|
</style>
|
|
38
40
|
</head>
|
|
39
41
|
<body>
|
|
@@ -42,54 +44,46 @@ One design per file. Keep each file self-contained so it renders on its own:
|
|
|
42
44
|
</html>
|
|
43
45
|
```
|
|
44
46
|
|
|
47
|
+
- Always give the `width`: it is the frame's viewport, and the page's CSS needs it. Give the `height` for fixed sizes (a phone screen, a flyer: the frame cuts at it); leave it out for pages that should grow with their content.
|
|
45
48
|
- 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
49
|
- Use real content in the user's language, not lorem ipsum.
|
|
47
50
|
- 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
51
|
- No build step: plain HTML, CSS and browser JavaScript (ES modules and CDN scripts work).
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
More tags, all optional:
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
- `category=…` in the `htmlboard` tag files the design under the explorer's filters: `mobile`, `tablet`, `desktop`, `components` or your own word. Usually not needed: it comes from words in the path, then from the size when it is a screen's.
|
|
56
|
+
- `<meta name="htmlboard:variant" content="?theme=dark · dark">` shows the same file again with that query string, named "<title> · dark". Use it for states the page builds from its URL (themes, empty or error states, data). Add one tag per variant; they follow the file.
|
|
57
|
+
- `<meta name="htmlboard:label" content="light">` adds a label to the name of the file's own frame ("Checkout · light"), to tell it from its variants.
|
|
58
|
+
- `<meta name="htmlboard" content="skip">` leaves a file out (partials, templates, a page that isn't a design).
|
|
53
59
|
|
|
54
|
-
|
|
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.
|
|
60
|
+
## Group and order
|
|
57
61
|
|
|
58
|
-
**
|
|
62
|
+
- **A folder is a section** (a row on the canvas), named after the folder. Put related designs in a folder: `designs/03-checkout/`.
|
|
63
|
+
- **Number prefixes set the order** of files and folders: `01-one-page.html`, `02-steps.html`. They don't show in names or links, so you can renumber freely. Files at the top of the designs folder form a first row without a title.
|
|
64
|
+
- New files and folders show up on the canvas by themselves; you don't register them anywhere.
|
|
65
|
+
|
|
66
|
+
**`designs.json`** is optional. When a project has one (in the designs folder), it curates: sections with titles (accents, capitals, an order across folders), and values that win over the files'. Designs it doesn't list still show after the ones it lists, in their folder's section, unless it says `"unlisted": "hide"`. If the project's designs.json groups designs by hand, add a new design to the right section there:
|
|
59
67
|
|
|
60
68
|
```json
|
|
61
69
|
{
|
|
62
|
-
"title": "Checkout redesign",
|
|
63
70
|
"sections": [
|
|
64
|
-
{
|
|
65
|
-
|
|
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
|
-
}
|
|
71
|
+
{ "title": "Checkout · mobile", "designs": ["03-checkout/01-one-page.html", "03-checkout/02-steps.html"] },
|
|
72
|
+
{ "title": "Launch flyers", "folder": "04-flyers" }
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
|
|
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.
|
|
77
|
+
An entry is a file name (its variants follow it), or `{ "file", "title", "width", "height", "category", "description" }` to override the file. `"folder"` brings a whole folder. `npx htmlboard migrate <folder>` moves an old designs.json's sizes, names and variants into the files (`--write` to apply; without it, it only shows the plan).
|
|
84
78
|
|
|
85
79
|
## Live reload
|
|
86
80
|
|
|
87
|
-
- Saving an artboard's HTML reloads just that frame; the user's
|
|
88
|
-
- Saving
|
|
89
|
-
-
|
|
81
|
+
- Saving an artboard's HTML reloads just that frame; the user's view stays put. A new name or size in its `<head>` updates in place.
|
|
82
|
+
- Saving a file artboards use (a stylesheet, a script, an image, data) reloads the artboards that loaded it.
|
|
83
|
+
- Adding, removing or moving artboards, or saving `designs.json`, rebuilds the canvas.
|
|
90
84
|
|
|
91
85
|
## Working with the user
|
|
92
86
|
|
|
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
|
|
87
|
+
- Put variants in separate files next to each other (`01-hero-a.html`, `02-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.
|
|
88
|
+
- 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 prefixes and `.html`, other symbols turned into `-` (`03-checkout/02-steps.html` → `checkout-steps`; a variant adds its query: `checkout-steps-theme-dark`).
|
|
95
89
|
- 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.
|