Skip to content

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

Site: /inspo opens with a list of its steps, the docs' tabs slide, and every small link gets a 40px target

Lucas Marques4e117e04b835
diff --git a/apps/site/app/docs/page.tsx b/apps/site/app/docs/page.tsx
index cbcb2f5..4c905fa 100644
--- a/apps/site/app/docs/page.tsx
+++ b/apps/site/app/docs/page.tsx
@@ -34,7 +34,7 @@ export default async function Docs() {
<Sidebar />
<main className="docs-main">
<header className="max-w-[64ch]">
- <h1 className="text-[36px] font-medium leading-[1.05] tracking-[-0.035em] md:text-[44px]">Six figures, one set of options.</h1>
+ <h1 className="text-[36px] font-medium leading-[1.05] tracking-[-0.035em] text-balance md:text-[44px]">Six figures, one set of options.</h1>
<p className="mt-4 text-[16px] leading-[1.55] text-muted">
Every figure takes the same four options and draws itself in SVG, with no dependencies. Install the package, paste a figure, and turn <code className="doc-code">intensity</code> up or down.
</p>
diff --git a/apps/site/app/globals.css b/apps/site/app/globals.css
index 48e4ade..7e96389 100644
--- a/apps/site/app/globals.css
+++ b/apps/site/app/globals.css
@@ -48,8 +48,16 @@ em { font-style: italic; }
}
/* the top bar's items, alike: muted 13px text, or a 16px icon, each 10px clear of its neighbours */
-.topbar-link { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; line-height: 1; color: var(--color-muted); }
-a.topbar-link:hover { color: var(--color-ink); }
+.topbar-link { position: relative; display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; line-height: 1; color: var(--color-muted); }
+@media (hover: hover) { a.topbar-link:hover { color: var(--color-ink); } }
+/* a 40px target around each link, the name and the footer's links, taller than what is drawn */
+a.topbar-link::after { content: ""; position: absolute; inset: -5px 0; }
+.topbar > a { position: relative; }
+.topbar > a::after { content: ""; position: absolute; inset: -9px -6px; }
+/* the docs' underline, kept clear until the pointer is on the link */
+footer a { position: relative; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color 150ms ease; }
+@media (hover: hover) { footer a:hover { text-decoration-color: currentColor; } }
+footer a::after { content: ""; position: absolute; inset: -12px -8px; }
.btn {
display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
@@ -63,14 +71,17 @@ a.topbar-link:hover { color: var(--color-ink); }
.pill {
display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 16px;
- border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--color-stone), var(--lift);
+ border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--color-stone), var(--lift);
font: 400 14px/1 var(--font-mono); text-align: left;
}
-.pill-line { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
+/* as tall as the pill, so the manager's 40px target fits inside the line's scroll box */
+.pill-line { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; line-height: 48px; scrollbar-width: none; }
.pill-line::-webkit-scrollbar { display: none; }
.pill-line[data-more] { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
-.pill-manager { border-radius: 5px; padding: 3px 4px; margin: -3px -4px; color: var(--color-ink); text-decoration: underline dotted var(--color-faint); text-underline-offset: 4px; cursor: pointer; }
-.pill-manager:hover { background: var(--color-stone); }
+.pill-manager { position: relative; border-radius: 5px; padding: 3px 4px; margin: -3px -4px; line-height: 1; color: var(--color-ink); text-decoration: underline dotted var(--color-faint); text-underline-offset: 4px; cursor: pointer; transition: transform 160ms var(--ease-out); }
+.pill-manager::after { content: ""; position: absolute; inset: -10px -4px; }
+@media (hover: hover) { .pill-manager:hover { background: var(--color-stone); } }
+.pill-manager:active { transform: scale(0.96); }
.slider { width: 100%; height: 18px; appearance: none; background: transparent; cursor: pointer; }
.slider::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: rgba(0, 0, 0, 0.16); }
@@ -82,9 +93,16 @@ a.topbar-link:hover { color: var(--color-ink); }
.code { overflow: hidden; border-radius: 12px; background: #fafafa; box-shadow: inset 0 0 0 1px var(--color-stone); }
.code-bar { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 4px 4px 14px; border-bottom: 1px solid var(--color-stone); }
.code-tabs { display: flex; flex: none; gap: 2px; margin-left: -8px; }
-.code-tab { border-radius: 7px; padding: 6px 10px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--color-muted); transition: background-color 150ms ease, color 150ms ease; }
+.code-tab { position: relative; border-radius: 7px; padding: 6px 10px; font-size: 13px; font-weight: 500; line-height: 1; color: var(--color-muted); transition: color 150ms ease, transform 160ms var(--ease-out); }
+.code-tab::after { content: ""; position: absolute; inset: -8px 0; }
.code-tab[aria-selected="true"] { background: #fff; color: var(--color-ink); box-shadow: 0 0 0 1px var(--color-stone); }
-.code-tab:hover { color: var(--color-ink); }
+@media (hover: hover) { .code-tab:hover { color: var(--color-ink); } }
+.code-tab:active { transform: scale(0.96); }
+/* Once measured, the selected tab's white plate and its ring are one highlight that slides: a stone layer clipped to
+ the tab plus a pixel, and a white one over it clipped to the tab. */
+.code-tabs[data-hl] .code-tab[aria-selected="true"] { background: none; box-shadow: none; }
+.code-tabs .slide-hl { top: -1px; left: -1px; background: var(--color-stone); clip-path: inset(var(--t) var(--r) var(--b) var(--l) round 8px); }
+.code-tabs .slide-hl::before { content: ""; position: absolute; inset: 0; background: #fff; clip-path: inset(calc(var(--t) + 1px) calc(var(--r) + 1px) calc(var(--b) + 1px) calc(var(--l) + 1px) round 7px); }
.code-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--color-muted); }
.code-tabs + .code-title { text-align: right; }
.code-body { overflow-x: auto; padding: 16px 18px; font: 400 13px/1.65 var(--font-mono); }
@@ -112,17 +130,20 @@ a.topbar-link:hover { color: var(--color-ink); }
.docs-main > * { min-width: 0; }
.doc-section { display: grid; gap: 16px; scroll-margin-top: var(--doc-offset); }
.doc-section > * { min-width: 0; }
-.doc-h2 { font-size: 24px; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; }
+.doc-h2 { font-size: 24px; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.doc-p, .doc-list { max-width: 64ch; font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.doc-list { display: grid; gap: 8px; padding-left: 1.2em; list-style: disc; }
.doc-note { max-width: 64ch; font-size: 14px; line-height: 1.55; color: var(--color-muted); text-wrap: pretty; }
.doc-code { font-size: 0.9em; color: var(--color-ink); }
.doc-more { justify-self: start; font-size: 14px; color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-faint); text-underline-offset: 4px; }
-.doc-more:hover { text-decoration-color: currentColor; }
+@media (hover: hover) { .doc-more:hover { text-decoration-color: currentColor; } }
/* The sidebar: the same links twice, grouped in a column from 1024px, one sideways strip under the top bar below it. */
-.doc-link { display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: var(--color-muted); white-space: nowrap; transition: color 200ms ease; }
-.doc-link:hover, .doc-link[aria-current] { color: var(--color-ink); }
+.doc-link { position: relative; display: flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: var(--color-muted); white-space: nowrap; transition: color 200ms ease; }
+.doc-link[aria-current] { color: var(--color-ink); }
+@media (hover: hover) { .doc-link:hover { color: var(--color-ink); } }
+/* in the strip, where a finger picks, a 40px target inside the strip's own padding */
+.doc-strip .doc-link::after { content: ""; position: absolute; inset: -4px 0; }
/* The marked link's text steps aside for a dot that flies in from the link marked before. The old text steps back at
once and the new one steps aside as the dot lands, so the two never meet. Nothing moves until the first mark is
drawn: the page opens with it in place. */
@@ -172,16 +193,17 @@ a.topbar-link:hover { color: var(--color-ink); }
/* A single choice whose highlight slides to the checked option. */
.slide { position: relative; display: flex; isolation: isolate; }
.slide-hl { position: absolute; top: 0; left: 0; z-index: -1; pointer-events: none; }
-.slide[data-ready] .slide-hl { transition: transform 200ms var(--ease-out), clip-path 200ms var(--ease-out); }
+.slide[data-ready] .slide-hl, .slide[data-ready] .slide-hl::before { transition: transform 200ms var(--ease-out), clip-path 200ms var(--ease-out); }
/* a choice made with the keyboard lands at once */
-.slide[data-keyed] .slide-hl { transition: none; }
+.slide[data-keyed] .slide-hl, .slide[data-keyed] .slide-hl::before { transition: none; }
.slide-item { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; white-space: nowrap; color: var(--color-muted); transition: color 150ms ease; }
-.slide-item:hover, .slide-item[aria-checked="true"] { color: var(--color-ink); }
+.slide-item[aria-checked="true"] { color: var(--color-ink); }
+@media (hover: hover) { .slide-item:hover { color: var(--color-ink); } }
/* Copy as an icon: the clipboard blurs and shrinks away as the check grows in. */
.icopy { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--color-muted); transition: color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out); }
.icopy::after { content: ""; position: absolute; inset: -2px; }
-.icopy:hover { color: var(--color-ink); background: var(--color-stone); }
+@media (hover: hover) { .icopy:hover { color: var(--color-ink); background: var(--color-stone); } }
.icopy:active { transform: scale(0.96); }
.icopy[data-copied] { color: var(--color-ink); }
.icopy svg { grid-area: 1 / 1; transition: opacity 200ms var(--ease-icon), transform 200ms var(--ease-icon), filter 200ms var(--ease-icon); }
@@ -226,44 +248,82 @@ a.topbar-link:hover { color: var(--color-ink); }
.s-range { flex: 1; width: auto; }
}
-/* Inspo: one column, prose at a reading measure, pictures on the dark plate they were taken on. */
-.inspo { --gutter: clamp(18px, 5vw, 28px); display: grid; gap: 72px; max-width: 1080px; margin: 0 auto; padding: 64px var(--gutter) 96px; }
-.inspo > * { min-width: 0; }
-.inspo-prose, .inspo-step > :not(.inspo-figure, .inspo-split) { width: 100%; max-width: 640px; }
+/* Inspo: an essay. Everything sits on one centred axis: prose keeps to the measure, and the evidence (pictures, the
+ ledger of pushback) takes the page's width around it. */
+.inspo { --gutter: clamp(18px, 5vw, 28px); --measure: 640px; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 80px; max-width: 1080px; margin: 0 auto; padding: 56px var(--gutter) 96px; }
+.inspo-prose, .inspo-step > * { width: 100%; max-width: var(--measure); }
.inspo-label { font: 400 12px/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; color: var(--color-muted); }
-.inspo-title { margin-top: 16px; font-size: 40px; font-weight: 500; line-height: 1.05; letter-spacing: -0.04em; text-wrap: balance; }
-.inspo-lede { margin-top: 20px; font-size: 18px; line-height: 1.5; color: var(--color-muted); text-wrap: pretty; }
-.inspo-step { display: grid; gap: 20px; }
-.inspo-step > * { min-width: 0; }
-.inspo-h2 { display: flex; align-items: baseline; gap: 12px; font-size: 24px; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; }
-.inspo-n { font: 400 13px/1 var(--font-mono); letter-spacing: 0; color: var(--color-faint); font-variant-numeric: tabular-nums; }
-.inspo-p { font-size: 16px; line-height: 1.6; text-wrap: pretty; }
-.inspo-prompt { padding: 16px 18px; border-radius: 12px; background: var(--color-stone); }
-.inspo-quote { display: grid; gap: 14px; margin-top: 18px; font-size: 16px; line-height: 1.55; text-wrap: pretty; }
-.inspo-part { display: grid; gap: 8px; }
-.inspo-pushback { display: grid; gap: 0; counter-reset: turn; }
-.inspo-pushback li { display: grid; gap: 8px; padding: 18px 0 18px 36px; border-top: 1px solid var(--color-line); counter-increment: turn; position: relative; }
+.inspo-title { margin-top: 20px; font-size: 44px; font-weight: 500; line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance; }
+.inspo-title em { font-family: var(--font-serif); font-size: 1.08em; font-weight: 400; letter-spacing: -0.02em; }
+.inspo-lede { margin-top: 24px; font-size: 18px; line-height: 1.5; color: var(--color-muted); text-wrap: pretty; }
+/* the seven steps as a way in: two columns that read down, each row a 40px target */
+.inspo-toc { margin-top: 40px; }
+.inspo-toc ol { display: grid; border-bottom: 1px solid var(--color-line); }
+.inspo-toc a { display: flex; align-items: baseline; gap: 14px; padding: 11px 0; border-top: 1px solid var(--color-line); font-size: 14px; line-height: 18px; color: var(--color-muted); transition: color 150ms ease; }
+@media (hover: hover) { .inspo-toc a:hover { color: var(--color-ink); } }
+.inspo-step { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 24px; width: 100%; }
+/* a step opens under a hairline, its number over its title */
+.inspo-h2 { display: grid; gap: 16px; padding-top: 28px; border-top: 1px solid var(--color-line); font-size: 24px; font-weight: 500; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; scroll-margin-top: calc(var(--topbar) + 16px); }
+.inspo-n { font: 400 12px/1 var(--font-mono); letter-spacing: 0.02em; color: var(--color-muted); font-variant-numeric: tabular-nums; }
+.inspo-p { font-size: 16px; line-height: 1.65; text-wrap: pretty; }
+/* A prompt: a white card like the site's other surfaces, a row per part, its label in a column of its own when there is room. */
+.inspo-prompt { margin-block: 8px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--color-stone), var(--lift); }
+.inspo-prompt > .inspo-label { padding: 18px 20px; }
+.inspo-quote { font-size: 15px; line-height: 1.6; text-wrap: pretty; }
+.inspo-part { display: grid; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--color-line); }
+.inspo-part > .inspo-label { line-height: 1.5; }
+/* The pushback: a ledger. What I said, and across from it what that changed. */
+.inspo-pushback { display: grid; counter-reset: turn; }
+.inspo-pushback li { position: relative; display: grid; gap: 10px; padding: 22px 0 22px 40px; border-top: 1px solid var(--color-line); counter-increment: turn; }
.inspo-pushback li:last-child { border-bottom: 1px solid var(--color-line); }
-.inspo-pushback li::before { content: counter(turn, decimal-leading-zero); position: absolute; top: 22px; left: 0; font: 400 13px/1 var(--font-mono); color: var(--color-faint); font-variant-numeric: tabular-nums; }
+.inspo-pushback li::before { content: counter(turn, decimal-leading-zero); position: absolute; top: 28px; left: 0; font: 400 12px/1 var(--font-mono); letter-spacing: 0.02em; color: var(--color-muted); font-variant-numeric: tabular-nums; }
.inspo-said { font-size: 16px; line-height: 1.55; text-wrap: pretty; }
-.inspo-changed { font-size: 14px; line-height: 1.55; color: var(--color-muted); text-wrap: pretty; }
+.inspo-changed { font-size: 14px; line-height: 1.6; color: var(--color-muted); text-wrap: pretty; }
.inspo-changed::before { content: "Changed: "; color: var(--color-ink); font-weight: 500; }
-.inspo-figure { display: grid; gap: 10px; margin-top: 8px; }
-.inspo-shot { padding: clamp(8px, 2vw, 16px); border-radius: 18px; background: var(--color-ink); }
+/* A picture on its plate. The plate's corner is the picture's plus the padding between them. */
+.inspo-figure { display: grid; justify-items: center; gap: 14px; margin-block: 16px; }
+.inspo-step > .inspo-figure, .inspo-step > .inspo-pushback, .inspo-step > .inspo-split { max-width: none; }
+.inspo-shot { --pad: clamp(6px, 1.6vw, 16px); width: 100%; padding: var(--pad); border-radius: calc(8px + var(--pad)); background: var(--color-ink); }
.inspo-shot img { display: block; width: 100%; height: auto; border-radius: 8px; }
-.inspo-caption { font-size: 13px; line-height: 1.5; color: var(--color-muted); }
-.inspo-split { display: grid; gap: 20px; align-items: start; }
-.inspo-split-text { display: grid; gap: 16px; max-width: 640px; }
-.inspo-split .inspo-figure { margin-top: 0; max-width: 480px; }
-.inspo-rules { display: grid; gap: 16px; }
-.inspo-rules li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding-top: 16px; border-top: 1px solid var(--color-line); }
-.inspo-rules .inspo-n { line-height: 1.6; }
+.inspo-caption { width: 100%; max-width: var(--measure); font-size: 13px; line-height: 1.5; color: var(--color-muted); text-wrap: pretty; }
+.inspo-split { display: grid; justify-items: center; gap: 24px; }
+.inspo-split-text { display: grid; gap: 16px; width: 100%; max-width: var(--measure); }
+.inspo-split .inspo-figure { width: 100%; max-width: 480px; margin-block: 8px 0; }
+.inspo-rules { display: grid; }
+.inspo-rules li { display: grid; gap: 10px; padding: 20px 0; border-top: 1px solid var(--color-line); }
+.inspo-rules li:last-child { border-bottom: 1px solid var(--color-line); }
+.inspo-rules .inspo-n { line-height: 24px; text-transform: uppercase; }
+.inspo-rules li > div { display: grid; gap: 4px; }
.inspo-rule { font-size: 16px; font-weight: 500; line-height: 1.5; }
-.inspo-keep { display: grid; gap: 12px; padding-left: 1.2em; list-style: disc; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
+.inspo-rules .inspo-p { font-size: 15px; line-height: 1.6; color: var(--color-muted); }
+/* what the story leaves behind, a line each */
+.inspo-keep { display: grid; font-size: 16px; line-height: 1.55; text-wrap: pretty; }
+.inspo-keep li { padding: 16px 0; border-top: 1px solid var(--color-line); }
+.inspo-keep li:last-child { border-bottom: 1px solid var(--color-line); }
+/* a 14px link on its own gets a taller target than its text */
+.inspo .doc-more { display: inline-block; margin-block: -10px; padding-block: 10px; }
+@media (min-width: 600px) {
+ .inspo-toc ol { grid-auto-flow: column; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, auto); column-gap: 32px; }
+ .inspo-part { grid-template-columns: 148px minmax(0, 1fr); align-items: baseline; gap: 20px; }
+ .inspo-rules li { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
+}
@media (min-width: 768px) {
- .inspo { gap: 96px; padding-top: 96px; }
- .inspo-title { font-size: 56px; }
- .inspo-split { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 40px; }
+ .inspo { gap: 112px; padding-top: 96px; }
+ .inspo-title { font-size: 64px; }
+ .inspo-lede { font-size: 20px; }
+ .inspo-h2 { font-size: 28px; }
+ .inspo-keep { font-size: 18px; }
+}
+/* from here the ledger and the bench have the width for two columns */
+@media (min-width: 960px) {
+ .inspo-pushback li { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: baseline; gap: 48px; padding-left: 56px; }
+ .inspo-said { font-size: 17px; }
+}
+/* the bench beside its story: the words keep the measure's left edge and the picture runs to the page's right */
+@media (min-width: 1024px) {
+ .inspo-split { grid-template-columns: calc((100% - var(--measure)) / 2) minmax(0, 1fr) 400px; align-items: center; justify-items: stretch; gap: 0; margin-top: 16px; }
+ .inspo-split-text { grid-column: 2; max-width: none; padding-right: 48px; }
+ .inspo-split .inspo-figure { max-width: none; margin: 0; }
}
:is(button, a, input, .code-body, .table-scroll):focus-visible { outline: 1.5px solid var(--color-ink); outline-offset: 2px; }
@@ -281,7 +341,7 @@ a.topbar-link:hover { color: var(--color-ink); }
}
@media (prefers-reduced-motion: reduce) {
.hero-rise > *, .enter, .enter-hint { animation-name: fade; }
- .slide[data-ready] .slide-hl { transition: none; }
+ .slide[data-ready] .slide-hl, .slide[data-ready] .slide-hl::before { transition: none; }
.icopy-b, .icopy[data-copied] .icopy-a { transform: none; filter: none; }
[data-live] > .doc-dot, [data-live] .doc-link > span { transition: none; }
}
diff --git a/apps/site/app/inspo/page.tsx b/apps/site/app/inspo/page.tsx
index ca28dbf..0dbafcd 100644
--- a/apps/site/app/inspo/page.tsx
+++ b/apps/site/app/inspo/page.tsx
@@ -1,6 +1,6 @@
import type { Metadata } from "next";
import Image, { type StaticImageData } from "next/image";
-import type { ReactNode } from "react";
+import type { CSSProperties, ReactNode } from "react";
import { Footer, Topbar } from "@/components/chrome";
import craft from "@/public/inspo/craft.webp";
import dissection from "@/public/inspo/dissection.webp";
@@ -18,13 +18,19 @@ export const metadata: Metadata = {
openGraph: { title: TITLE, description: DESCRIPTION, url: "/inspo", siteName: "hairline", type: "article", images: [{ url: "/og.png", width: 1200, height: 630, alt: "Line drawings that answer the pointer: the Terrain figure, its pillars rising." }] },
};
-/** One part of the story: a mono number and a title over the prose. */
-function Step({ n, title, children }: { n: number; title: string; children: ReactNode }) {
+/** The story's parts, in order: the header lists them and each step takes its title from here. */
+const STEPS = ["A feeling, not a look", "The brief", "What came back", "Pushback", "The design pass", "Into a package", "What I’d keep"];
+
+const two = (n: number) => String(n).padStart(2, "0");
+const at = (i: number) => ({ "--i": i }) as CSSProperties;
+
+/** One part of the story: under a hairline, a mono number over its title, then the prose. */
+function Step({ n, children }: { n: number; children: ReactNode }) {
return (
<section data-step aria-labelledby={`step-${n}`} className="inspo-step">
<h2 id={`step-${n}`} className="inspo-h2">
- <span className="inspo-n">{String(n).padStart(2, "0")}</span>
- {title}
+ <span className="inspo-n">{two(n)}</span>
+ {STEPS[n - 1]}
</h2>
{children}
</section>
@@ -94,15 +100,27 @@ export default function Inspo() {
<>
<Topbar />
<main className="inspo">
- <header className="inspo-prose">
- <p className="inspo-label">Inspo</p>
- <h1 className="inspo-title">{TITLE}</h1>
- <p className="inspo-lede">
+ <header className="inspo-prose hero-rise">
+ <p className="inspo-label" style={at(0)}>Inspo</p>
+ <h1 className="inspo-title" style={at(1)}>How Hairline was <em>made</em></h1>
+ <p className="inspo-lede" style={at(2)}>
Not with one prompt. With a long brief, a lot of questions, and every correction written down as a rule so it couldn&rsquo;t come back. Claude Opus did the building, a live Artifact was the bench, and the judgement stayed with me.
</p>
+ <nav aria-label="Steps" className="inspo-toc" style={at(3)}>
+ <ol>
+ {STEPS.map((title, i) => (
+ <li key={title}>
+ <a href={`#step-${i + 1}`}>
+ <span className="inspo-n">{two(i + 1)}</span>
+ {title}
+ </a>
+ </li>
+ ))}
+ </ol>
+ </nav>
</header>
- <Step n={1} title="A feeling, not a look">
+ <Step n={1}>
<p className="inspo-p">
I&rsquo;d been collecting interfaces that feel alive without moving much. One was a section of linear.app: three small line figures that answer the pointer so quietly you only notice late that they&rsquo;ve been listening the whole time.
</p>
@@ -112,7 +130,7 @@ export default function Inspo() {
<Shot src={linear} priority alt="Linear's three line figures, Fig 0.1 to 0.3, drawn in thin grey strokes on near-black: a stack of rounded layers with a sun on top, a cluster of rounded cubes, and a row of plates rising in height." caption="The reference, for the feeling: Fig 0.1 to 0.3 on linear.app." />
</Step>
- <Step n={2} title="The brief">
+ <Step n={2}>
<p className="inspo-p">
The first prompt was long, and most of it wasn&rsquo;t about drawing. It said what I was making, what I wanted to understand first, what was off limits, and what shape the answer had to take.
</p>
@@ -136,7 +154,7 @@ export default function Inspo() {
</Prompt>
</Step>
- <Step n={3} title="What came back">
+ <Step n={3}>
<p className="inspo-p">
A dissection first, as asked: a 50ms stagger, one 700ms curve, <code className="doc-code">cubic-bezier(.32, .72, 0, 1)</code>, a falloff that drops from 128 to 40 to 12 away from the pointer, frames stored as 25-bit masks. Then eight rules, and six figures built on them: Riffle, Terrain, Exploded, Phosphor, Slow and Turntable.
</p>
@@ -145,7 +163,7 @@ export default function Inspo() {
<Shot src={figures} alt="The six first-draft figures in a three by two grid of dark cards: a riffle of index cards, a field of pillars, an exploded stack of screens, a tile of lit dots, crates passing under a gate, and a turntable of blocks." caption="The first six figures, before any of the arguing." />
</Step>
- <Step n={4} title="Pushback">
+ <Step n={4}>
<p className="inspo-p">
Most of the work happened here. I questioned every number I couldn&rsquo;t feel, every figure I couldn&rsquo;t explain, and every motion that looked fine in a still and wrong under the hand. A few of those turns:
</p>
@@ -170,7 +188,7 @@ export default function Inspo() {
</div>
</Step>
- <Step n={5} title="The design pass">
+ <Step n={5}>
<p className="inspo-p">
The motion was right; the drawings weren&rsquo;t mine yet. A model won&rsquo;t flag that on its own, so I wrote the critique the way I&rsquo;d give it to a designer: what&rsquo;s wrong, why, and the exact fix.
</p>
@@ -210,15 +228,17 @@ export default function Inspo() {
<Shot src={craft} alt="The same six figures after the design pass, in a three by two grid: rounded solids with bright silhouettes, one dim crease on each top, and no words inside the drawings." caption="After the pass: rounded, quieter, and wordless." />
</Step>
- <Step n={6} title="Into a package">
+ <Step n={6}>
<p className="inspo-p">
The API was a design decision too. Six sliders became one <code className="doc-code">intensity</code>, because nobody using a figure should need to know what a falloff is. <code className="doc-code">theme</code> covers light and dark; <code className="doc-code">label</code> and <code className="doc-code">onRead</code> carry the read-out the words moved to. Then this site, and more arguing: Slow&rsquo;s gate was still being tuned after the figures shipped.
</p>
- <a className="doc-more" href="/docs">Read the docs</a>
+ <p>
+ <a className="doc-more" href="/docs">Read the docs</a>
+ </p>
</Step>
- <Step n={7} title="What I’d keep">
- <ul className="inspo-keep">
+ <Step n={7}>
+ <ul role="list" className="inspo-keep">
<li>Write the brief like a spec: what it is, what to understand first, what&rsquo;s off limits, what shape the answer takes.</li>
<li>Ask for numbers and reasons, then argue with them. A first draft is something to push against.</li>
<li>Make the model build the instrument you judge with. Sliders beat descriptions.</li>
diff --git a/apps/site/components/chrome.tsx b/apps/site/components/chrome.tsx
index 87a0478..a1c2bc8 100644
--- a/apps/site/components/chrome.tsx
+++ b/apps/site/components/chrome.tsx
@@ -26,7 +26,7 @@ export function Topbar() {
export function Footer() {
return (
- <footer className="mx-auto flex max-w-[1080px] flex-wrap items-baseline gap-x-6 gap-y-3 border-t border-line px-[clamp(18px,5vw,28px)] py-8 text-[13px] text-muted">
+ <footer className="mx-auto flex max-w-[1080px] flex-wrap items-baseline gap-x-6 gap-y-6 border-t border-line px-[clamp(18px,5vw,28px)] py-8 text-[13px] text-muted">
<p>
MIT licensed. Built by <a className="text-ink" href={LINKS.author}>Lucas Marques</a>.
</p>
diff --git a/apps/site/components/copy.tsx b/apps/site/components/copy.tsx
index b84fa4b..9d5b34d 100644
--- a/apps/site/components/copy.tsx
+++ b/apps/site/components/copy.tsx
@@ -45,7 +45,7 @@ export function CopyIcon({ text, select, label = "Copy", className = "" }: { tex
const [copied, copy] = useCopy();
return (
<button type="button" className={`icopy ${className}`} data-copied={copied || undefined} aria-label={label} title={label} onClick={() => copy(typeof text === "function" ? text() : text, select?.current)}>
- <svg className="icopy-a" viewBox="0 0 16 16" width="15" height="15" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="1.3" strokeLinejoin="round">
+ <svg className="icopy-a" viewBox="0 0 16 16" width="15" height="15" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinejoin="round">
<rect x="5.25" y="5.25" width="8.5" height="8.5" rx="2" />
<path d="M10.75 5.25V4.25a2 2 0 0 0-2-2h-4.5a2 2 0 0 0-2 2v4.5a2 2 0 0 0 2 2h1" />
</svg>
diff --git a/apps/site/components/tabs.tsx b/apps/site/components/tabs.tsx
index 389c051..a2bfcd4 100644
--- a/apps/site/components/tabs.tsx
+++ b/apps/site/components/tabs.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useEffect, useId, useRef, useState, type KeyboardEvent } from "react";
+import { useEffect, useId, useLayoutEffect, useRef, useState, type CSSProperties, type KeyboardEvent } from "react";
import { CopyIcon } from "./copy";
export type Tab = { label: string; file: string; html: string };
@@ -13,12 +13,20 @@ const KEY = "hairline:docs-tab";
* shown tab's file name and the copy icon on the right. The server renders
* the first tab; the stored one is read after mount, and storage that throws
* (private mode, blocked) leaves the first tab on.
+ *
+ * The selected tab's plate slides to a tab picked with a pointer, as in Slide:
+ * it spans the row and a clip-path cuts it down to the tab, so it never
+ * animates its size. It is turned on after the first paint, and a tab picked
+ * with the arrow keys lands at once.
*/
export function Tabs({ tabs, label }: { tabs: Tab[]; label: string }) {
const [at, setAt] = useState(0);
const panel = useRef<HTMLDivElement>(null);
const list = useRef<HTMLDivElement>(null);
const id = useId();
+ const [box, setBox] = useState<{ x: number; y: number; w: number; h: number; rowW: number; rowH: number } | null>(null);
+ const [ready, setReady] = useState(false);
+ const [keyed, setKeyed] = useState(false);
useEffect(() => {
try {
@@ -27,6 +35,29 @@ export function Tabs({ tabs, label }: { tabs: Tab[]; label: string }) {
} catch {}
}, [tabs]);
+ useLayoutEffect(() => {
+ const root = list.current;
+ if (!root) return;
+ const measure = () => {
+ const el = root.querySelector<HTMLElement>('[aria-selected="true"]');
+ const last = root.querySelector<HTMLElement>("[role=tab]:last-of-type");
+ if (el && last) setBox({ x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight, rowW: last.offsetLeft + last.offsetWidth, rowH: last.offsetTop + last.offsetHeight });
+ };
+ measure();
+ const resize = new ResizeObserver(measure);
+ resize.observe(root);
+ return () => resize.disconnect();
+ }, [at]);
+
+ useEffect(() => {
+ let inner = 0;
+ const outer = requestAnimationFrame(() => (inner = requestAnimationFrame(() => setReady(true))));
+ return () => {
+ cancelAnimationFrame(outer);
+ cancelAnimationFrame(inner);
+ };
+ }, []);
+
const pick = (i: number) => {
setAt(i);
try {
@@ -38,6 +69,7 @@ export function Tabs({ tabs, label }: { tabs: Tab[]; label: string }) {
const step = event.key === "ArrowRight" ? 1 : event.key === "ArrowLeft" ? -1 : 0;
if (!step) return;
event.preventDefault();
+ setKeyed(true);
const next = (at + step + tabs.length) % tabs.length;
pick(next);
list.current?.querySelectorAll<HTMLButtonElement>("[role=tab]")[next]?.focus();
@@ -46,7 +78,9 @@ export function Tabs({ tabs, label }: { tabs: Tab[]; label: string }) {
return (
<div className="code" data-code>
<div className="code-bar">
- <div ref={list} role="tablist" aria-label={label} onKeyDown={onKeyDown} className="code-tabs">
+ <div ref={list} role="tablist" aria-label={label} onKeyDown={onKeyDown} onPointerDown={() => setKeyed(false)} className="code-tabs slide" data-hl={box ? "" : undefined} data-ready={ready || undefined} data-keyed={keyed || undefined}>
+ {/* a pixel larger than the row on every side, for the ring around the plate */}
+ {box ? <span className="slide-hl" aria-hidden="true" style={{ width: box.rowW + 2, height: box.rowH + 2, "--t": `${box.y}px`, "--r": `${box.rowW - box.x - box.w}px`, "--b": `${box.rowH - box.y - box.h}px`, "--l": `${box.x}px` } as CSSProperties} /> : null}
{tabs.map((tab, i) => (
<button key={tab.label} type="button" role="tab" id={`${id}-tab-${i}`} aria-selected={i === at} aria-controls={`${id}-panel`} tabIndex={i === at ? 0 : -1} onClick={() => pick(i)} className="code-tab">
{tab.label}