Skip to content

Isometric line figures that answer the pointer. For React and for anything with a DOM.

0.4.0: play, and the skill's tour

Lucas Marques4084f87fb5ca
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 48f8dcd..a777138 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,17 @@ Every release of `@lucasmarkes/hairline`. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
[semver](https://semver.org/).
+## 0.4.0 - 2026-10-07
+
+### Added
+
+- `play`, a fifth option: an unseen pointer walks the figure through its answer in a loop until the pointer or focus arrives, and resumes after they leave. Under `prefers-reduced-motion` the figure rests. In React, `<Terrain play />`.
+
+### Changed
+
+- `hairline-create`: every figure declares a `tour`, three to six stops in the viewBox, in its `hairline()` call, and `validate.mjs` requires it. The page it writes has a play button and `?play=1`, and the person is asked to judge the lap at handoff. The seven made pages on the site declare theirs.
+- Site: the catalogue's tiles walk their figures until a hand arrives, and the docs list five options.
+
## 0.3.0 - 2026-10-05
### Added
diff --git a/README.md b/README.md
index cfe6459..6b6482e 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,7 @@ The figure fills its parent's width at a 5:4 aspect ratio. The entry is a client
```ts
import { terrain } from "@lucasmarkes/hairline";
-const figure = terrain(document.getElementById("figure")!);
+const figure = terrain(document.getElementById("figure")!, { play: true });
figure.update({ intensity: 0.8 });
figure.destroy();
@@ -85,7 +85,7 @@ A figure draws into the element you give it, at the element's width and a 5:4 as
## Options
-Every figure takes the same four, all optional:
+Every figure takes the same five, all optional:
| Option | Type | Default | |
| --- | --- | --- | --- |
@@ -93,6 +93,7 @@ Every figure takes the same four, all optional:
| `theme` | `"auto" \| "light" \| "dark"` | `"auto"` | `"auto"` follows the page: an ancestor with class `dark` or `data-theme="dark"`, then the page's `color-scheme`. |
| `label` | `string` | a description in English | The accessible name. In React, `aria-label` does the same. |
| `onRead` | `(text: string) => void` | | The figure's caption, each time it changes: `"03"`, `"gap 28.0"`, `"rate 0.20×"`. |
+| `play` | `boolean` | `false` | Walks the figure through its answer on its own, in a loop, until the pointer or focus arrives; it resumes after they leave. |
In `update`, a key set to `undefined` goes back to its default, and a key left out stays as it is.
@@ -118,14 +119,14 @@ The figure's styles have no specificity, so any rule of yours wins without `!imp
## Notes
- **Accessibility.** A figure is an image with a description you can replace with `label`. Riffle is the exception: it is a focusable group, the arrow keys walk its cards, and a live region reads the card out.
-- **Reduced motion.** With `prefers-reduced-motion`, the figures that play on their own (Phosphor and Slow) hold still, and every figure still answers the pointer.
+- **Reduced motion.** With `prefers-reduced-motion`, the figures that play on their own (Phosphor and Slow) hold still, a figure given `play` rests, and every figure still answers the pointer.
- **Performance.** Every figure on a page shares one `requestAnimationFrame` loop. A figure off screen, or at rest, does no work, and the loop stops when nothing is moving.
- **Server rendering.** On the server a component is an empty box with a 5:4 aspect ratio, so nothing shifts when it draws. The functions need a DOM: call them in an effect, in `onMount`, or in a script after the element.
- **Shadow DOM.** A figure mounted inside a shadow root styles itself there.
## Make your own
-`hairline-create` is a skill for coding agents. Give it an idea and it draws a new figure to Hairline's ten rules, on the same engine as the twenty-seven above, as one HTML file.
+`hairline-create` is a skill for coding agents. Give it an idea and it draws a new figure to Hairline's ten rules, on the same engine as the twenty-seven above, as one HTML file. Every figure it makes declares a tour, the stops a hand would visit, and the page it writes has a play button that walks it.
```sh
npx skills add lucasmarkes/hairline
diff --git a/packages/hairline/package.json b/packages/hairline/package.json
index aa0f90e..54cb2ed 100644
--- a/packages/hairline/package.json
+++ b/packages/hairline/package.json
@@ -1,6 +1,6 @@
{
"name": "@lucasmarkes/hairline",
- "version": "0.3.0",
+ "version": "0.4.0",
"description": "Twenty-seven isometric line figures that answer the pointer. For React and for anything with a DOM.",
"license": "MIT",
"type": "module",
@@ -83,18 +83,18 @@
{
"name": "vanilla, every figure",
"path": "dist/index.js",
- "limit": "34.4 kB"
+ "limit": "35.1 kB"
},
{
"name": "vanilla, one figure",
"path": "dist/index.js",
"import": "{ terrain }",
- "limit": "5.7 kB"
+ "limit": "6.3 kB"
},
{
"name": "react, every component",
"path": "dist/react.js",
- "limit": "34.9 kB",
+ "limit": "35.5 kB",
"ignore": [
"react",
"react/jsx-runtime"