性能
需注意帧率: 平均 59.7 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 20 KB · 运行时 171 KB
Action nodeMIT按钮Bencho
由 Lorenzo Cabra 制作的按钮 React 组件。依据 MIT 许可从 Bencho 原样收录,此处为实时预览。
质量报告
等级和分数来自构建或测试时跑过的自动检查。没跑过的项目会标成「未检测」,不会填假数据。
帧率: 平均 59.7 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 20 KB · 运行时 171 KB
问题 0 · 读屏: 需注意
没有持续动效
无溢出
帧率和长任务是在无界面的 Chromium 里用软件 WebGL 测的,只适合在本站组件之间比较,不代表真机表现。
不适用:静止时没有可见动画;由悬停触发的动画没有测试。
没有 axe-core 违规。

检测于 2026年11月15日 · 数据来自自动脚本,不是手工填写。
按实际尺寸显示。
复制内容以许可声明开头,使用代码时请保留。
<div id="root"></div>:root{--bg:#f6f4f0;--ink:#17181a;--background:40 20% 96%;--foreground:24 10% 8%;--card:0 0% 100%}html,body{min-height:100%;margin:0;background:var(--bg);color:var(--ink)}html,body{height:100%;overflow:hidden}body{display:grid;place-items:center}#root{display:grid;place-items:center;max-width:100%;max-height:100%;box-sizing:border-box;padding:16px;color:hsl(var(--foreground))}#root.full{width:100%;height:100%;padding:0}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-play-state:paused!important;transition-duration:0s!important}}
/*
MIT License
Copyright (c) 2026 Lorenzo Cabra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Not covered by this licence: the Bencho name and the goat mark, and the
photographs shown on bencho.dev (none are included here). Third-party
material keeps its own licence; see THIRD_PARTY.md.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
Sample photographs were replaced with Incidental AI assets. The Bencho name and goat mark are not licensed for marketing use.
*/
/* ── Bencho tokens ─────────────────────────────────────────
The custom properties the free blocks read, at the values
bencho.dev draws them with. Light by default; dark under
[data-theme="dark"] on any ancestor, or automatically with
the system setting unless [data-theme="light"] says otherwise.
Map these to your own theme rather than keeping two: a block
only ever reads the names, never the values. */
:root {
--font-ui: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
--bg: #ffffff;
--board: #ffffff;
--card: #f7f7f6;
--surface: #f7f7f6;
--surface-2: #f1f1f0;
--surface-3: #ecebe7;
--ink: #17181a;
--ink-rgb: 23, 24, 26;
--ink-2: #3c3b37;
--ink-3: #5c5b56;
--ink-4: #6f6e68;
--ink-5: #85847e;
--on-ink: #ffffff;
--on-ink-rgb: 255, 255, 255;
--slab: #17181a;
--on-slab: #ffffff;
--slab-dark: #0e0f11;
--fill-slab: #ffffff;
--fill-on: #17181a;
--fill-on-rgb: 23, 24, 26;
--pane: var(--fill-slab);
--pane-edge: rgba(23, 24, 26, 0.08);
--pane-thumb: rgba(23, 24, 26, 0.07);
--inlay: rgba(255, 255, 255, 0.55);
--inlay-hi: rgba(23, 24, 26, 0.09);
--elev-rgb: 255, 255, 255;
--glass-rgb: 255, 255, 255;
--shadow-rgb: 23, 24, 26;
--wash: 0.06;
--pick: #0d99ff;
--signal: #2231dd;
--focus: #2231dd;
--ok: #15803d;
--ember: #b8431c;
color-scheme: light;
}
[data-theme="dark"] {
--bg: #000000;
--board: #1a1a1a;
--card: #0a0a0a;
--surface: #0f0f0f;
--surface-2: #181818;
--surface-3: #202020;
--ink: #ffffff;
--ink-rgb: 255, 255, 255;
--ink-2: #b4b4b4;
--ink-3: #9a9a9a;
--ink-4: #828282;
--ink-5: #6b6b6b;
--on-ink: #000000;
--on-ink-rgb: 0, 0, 0;
--slab: #1a1a1a;
--on-slab: #ffffff;
--slab-dark: #262626;
--fill-slab: #262626;
--fill-on: #ffffff;
--fill-on-rgb: 255, 255, 255;
--pane-edge: rgba(255, 255, 255, 0.08);
--pane-thumb: rgba(255, 255, 255, 0.07);
--inlay: rgba(255, 255, 255, 0.1);
--inlay-hi: rgba(255, 255, 255, 0.09);
--elev-rgb: 32, 32, 32;
--shadow-rgb: 0, 0, 0;
--wash: 0.09;
--pick: #3aa9ff;
--ok: #34d17a;
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #000000;
--board: #1a1a1a;
--card: #0a0a0a;
--surface: #0f0f0f;
--surface-2: #181818;
--surface-3: #202020;
--ink: #ffffff;
--ink-rgb: 255, 255, 255;
--ink-2: #b4b4b4;
--ink-3: #9a9a9a;
--ink-4: #828282;
--ink-5: #6b6b6b;
--on-ink: #000000;
--on-ink-rgb: 0, 0, 0;
--slab: #1a1a1a;
--on-slab: #ffffff;
--slab-dark: #262626;
--fill-slab: #262626;
--fill-on: #ffffff;
--fill-on-rgb: 255, 255, 255;
--pane-edge: rgba(255, 255, 255, 0.08);
--pane-thumb: rgba(255, 255, 255, 0.07);
--inlay: rgba(255, 255, 255, 0.1);
--inlay-hi: rgba(255, 255, 255, 0.09);
--elev-rgb: 32, 32, 32;
--shadow-rgb: 0, 0, 0;
--wash: 0.09;
--pick: #3aa9ff;
--ok: #34d17a;
color-scheme: dark;
}
}
/* ActionNode.css */
/*
MIT License
Copyright (c) 2026 Lorenzo Cabra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Not covered by this licence: the Bencho name and the goat mark, and the
photographs shown on bencho.dev (none are included here). Third-party
material keeps its own licence; see THIRD_PARTY.md.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
Sample photographs were replaced with Incidental AI assets. The Bencho name and goat mark are not licensed for marketing use.
*/
/* ── the rest of them ────────────────────────────────────────
Not every block has a ::before to hang a border on, and
giving each one a pseudo-element it does not otherwise need
is a lot of stylesheet for a hairline. A 1px spread shadow
is the same mark by another means — the create menu has
used exactly this since it was written, for exactly this
reason — and it composites without touching layout.
This is what makes Stroke honest on every entry rather than
on the dozen that happened to be built on a glass pane. */
[data-stroke="on"] .bal,
[data-stroke="on"] .bar-rail,
[data-stroke="on"] .fan-core,
[data-stroke="on"] .step-pill,
[data-stroke="on"] .liq-sw,
[data-stroke="on"] .deck-card,
[data-stroke="on"] .tick-row,
/* NOT the rows. Stroke is a question about the block's own
edge, and hanging it on every row inside drew four
hairlines in the middle of a panel that still had none
round it. `.lab` already carries the ::before this control
was built for, and the roster's box is a .lab. */
/* ── a ring on a metaball ────────────────────────────────────
The reorder list's rows are blobs on a filtered layer, and a
spread shadow drawn there does not survive: the blur smears
it and the alpha row then crushes what is left to nothing,
so Stroke appeared to do nothing on this block in either
theme.
The ring goes on the UNFILTERED twin instead. Every row is
drawn twice — a blob that merges and an ink layer above it
that carries the avatar and the name — and the two share
their geometry exactly, so an outline on the top one traces
the shape of the bottom one for free. */
/* ── and the node card ─────────────────────────────────────
It drew its hairline unconditionally for a revision, which
is the one thing a block with a Stroke control must not do:
the control then reads as broken in the Off position,
because the edge it promises to remove is still there. The
ring follows the card's own corner, which is a knob. */
[data-stroke="on"] .nod-card {
box-shadow: 0 0 0 1px var(--pane-edge);
border-radius: var(--nod-r, 20px);}
/* and the buttons, which have nothing else on them */
[data-stroke="on"] .nod-act {
box-shadow: 0 0 0 1px var(--pane-edge);}
/* ══ Action node ══════════════════════════════════════════
A node card whose controls live in its top-right corner
until the pointer asks for them. The component owns the
geometry — every number that decides where a button sits is
in lab/ActionNode.tsx, because it is arithmetic on an arc
and not a style. What is here is what the card and the
buttons are MADE of.
The vertical padding on .nod is set inline for the same
reason: it is the fan's own reach, and a rule here would be
a second copy of a number that already exists. */
/* ── the box is the card, plus air ABOVE AND BELOW ───────────────────────────────────
Never beside. The wall sizes a component by its LARGEST
side, so air reserved to the left or right is width the
card does not get — which is what made this card draw at
199 against a neighbour's 260 once. Height is free until it
passes the width, and the fan needs somewhere of its own to
be: see AIR in ActionNode.tsx. */
.nod {
position: relative;
width: max-content;
font-family: var(--font-ui);}
/* ── the card is painted OVER the fan ──────────────────────
Which is what makes the buttons come out of the corner
rather than out of the middle of the card. They are struck
from a point 26px inside it, so at rest they are sitting
under the card with nothing of them showing; travelling out
along the arc is what brings them past the edge.
Without this they emerge from inside the card, small, and
grow — which reads as the card sprouting things rather than
as a drawer being opened. One line of stacking, and the
whole gesture changes meaning.
`position: relative` only so z-index applies. Nothing here
is offset. */
.nod-card {
position: relative;
z-index: 1;
box-sizing: border-box;
/* 272. It was 300, the width the rest of the wall is drawn
at, and read as a banner rather than a node — a card on a
canvas is taller than it looks wide. Narrower also draws it
a touch larger on the wall, which scales by the longest
side. */
width: 272px;
padding: 20px;
/* set per render — the Corner knob. The BUTTONS are not cut
with it: they are discs, and a disc with a 12px corner is
a squircle, which is a different object rather than the
same one adjusted. One knob, one shape. */
border-radius: var(--nod-r, 20px);
background: var(--fill-slab, var(--card));
color: var(--fill-on, var(--ink));
/* ── it lifts a hair while the fan is out ──────────────
Not a hover state for its own sake: the card is the thing
the buttons came out of, and a card that answers at the
same moment they do reads as one object doing one thing.
0.4px of travel — you would not find it if you looked for
it, and you would miss it if it were not there. */
transition: translate 220ms cubic-bezier(0.24, 1.34, 0.38, 1);}
.nod-card[data-on] { translate: 0 -1px; }
.nod-top {
display: flex;
align-items: center;
gap: 8px;}
/* the product's mark, on its own ground. A disc rather than a
square because everything else in the card that stands for
a service is a disc, and two shapes for one idea is how a
card stops reading as a set. */
.nod-mark {
display: grid;
place-items: center;
width: 30px;
height: 30px;
/* ── cut with the card, not pinned to a circle ──────────
Written from the Corner knob — see the note on --nod-mark-r
in ActionNode.tsx. At the top of the range it is 15, which
on a 30px box is the disc this used to be, so nothing is
lost at the end it came from.
The FACES are not cut with it and must not be. A face is a
photograph of a person, and how a photograph of a person is
cut has nothing to do with the radius of the card it
happens to be sitting on — the reorder list's note makes
the same call about the same thing. The buttons on the fan
stay discs for their own reason, written on the knob. */
border-radius: var(--nod-mark-r, 14px);
background: rgba(var(--ink-rgb), var(--wash));
color: var(--fill-on, var(--ink));}
/* ── the step's name ────────────────────────────────
500, not 600. The bench uses 600 all over, but almost all of
it is at 10 to 13px — furniture, where the weight is buying
back legibility a small size gave away. At 15px nothing has
been given away, so the same 600 is just loud, and it was
the heaviest thing on a card whose whole subject is four
quiet buttons.
The badge beside it is what keeps the hierarchy: this line
does not need to be bold to be the name, it needs to be the
darkest and the largest, and it is both. */
.nod-name {
font-size: 16px;
font-weight: 500;
letter-spacing: -0.01em;}
/* The "Connected" badge that sat at the end of the header row
is gone — see the note where it was drawn in ActionNode.tsx.
Its rules went with it, and so did the green it used: a
token kept alive for a rule nobody draws is the next thing
somebody restyles by accident. */
/* ── the services, overlapped ──────────────────────────────
A negative margin and a ring in the card's own colour, so
the discs read as a stack rather than as a row with a
spacing problem. The ring has to be the CARD's fill and not
a fixed white: on the dark fill a white ring would draw
four bright arcs across the middle of the card. */
/* ── after the sentence, and further from it than the
sentence is from the name ───────────────────────────────
The faces are a different KIND of thing from the two lines
above them — a name and a description are one block of
reading, and who is on the step is an aside under it. 16
against the description's 13 is what says so. */
.nod-chain {
display: flex;
align-items: center;
margin-top: 16px;}
.nod-link {
display: grid;
place-items: center;
width: 24px;
height: 24px;
border-radius: 999px;
overflow: hidden;
background: color-mix(in srgb, var(--fill-on, #17181a) 12%, transparent);
box-shadow: 0 0 0 2px var(--fill-slab, var(--card));
/* the fallback when a photograph does not load, which is
what the initials in the component are for */
font-size: 11px;
font-weight: 500;
color: var(--ink-4);
letter-spacing: 0em;}
.nod-link img {
width: 100%;
height: 100%;
object-fit: cover;}
.nod-link + .nod-link { margin-left: -6px; }
.nod-more {
margin-left: 8px;
font-size: 11px;
font-weight: 500;
color: var(--ink-4);
letter-spacing: 0em;}
.nod-say {
margin: 13px 0 0;
font-size: 13px;
line-height: 1.5;
color: var(--ink-3);
letter-spacing: 0em;}
/* ── AND THE GREEN DOT IS GONE WITH IT ─────────────────────
Two rules and a colour pair lived here: .nod-state, a row at
the foot of the card holding a dot and the word Connected,
and then .nod-dot and --nod-live after the pair moved up
into the header badge. The badge has gone now, so the dot
has nothing left to sit in and the token has nothing left to
colour.
Written down rather than simply deleted because the COLOUR
was a decision and the next status dot on this bench will
want it: #12b055 on light, #3ce085 on dark, which is the
humidity wheel's pair. A text green (#16a34a) goes grey at
seven pixels — a small mark needs a brighter one to read as
the same colour. And no halo: a 3px spread at a tenth alpha
makes a connection look like it is transmitting. */
/* ── the fan ───────────────────────────────────────────────
A zero-sized box pinned to the card's top-right corner.
Every button is absolutely placed against it and carries
its own translate, so they all share one origin and the arc
is the only thing that separates them.
`position: absolute` with width 0: the anchor is a POINT,
and giving it a size would mean every button's offset was
measured from an edge that has nothing to do with the
corner they are supposed to be coming out of. */
.nod-fan {
position: absolute;
/* under the card. It comes after it in the markup, so
without this it would paint on top and every button would
be visible from the first frame. */
z-index: 0;
width: 0;
height: 0;}
/* ── the pad that makes the fan reachable ───────────────
Invisible, and it has no business being anything else: its
whole job is to be part of .nod so that the air between the
card and the buttons stops being a place the pointer can
fall through. Shape, size and the bite out of it are all in
ActionNode.tsx, where the geometry they follow lives.
Inert until the fan is out. The card opens on its own hover
and nothing else, and a pad that could open it would put a
trigger in blank space beside the card. */
.nod-reach {
position: absolute;
pointer-events: none;}
.nod-reach[data-on] { pointer-events: auto; }
.nod-act {
position: absolute;
/* the anchor is a point and the translate in the component
moves the button from it. The half-a-button that centres
it on that point is set inline, next to the DOT it is
half OF — see ActionNode.tsx. */
top: 0;
left: 0;
display: grid;
place-items: center;
padding: 0;
border: 0;
border-radius: 999px;
background: var(--fill-slab, var(--card));
color: var(--fill-on, var(--ink));
/* ── no shadow, and none to put back ───────────────────
It had a soft lift, on the reasoning that a button off
the edge of a card needs separating from the page. It
does not: it is a filled disc on flat ground and the fill
already separates it. What the shadow actually did was
make four small objects look like they were hovering
above a card they are supposed to have come out of.
The hairline is the Stroke control's to draw and is not
here either \u2014 a button outlined whatever that switch says
makes the switch look broken. */
cursor: pointer;
-webkit-tap-highlight-color: transparent;
/* ── two writers, one scale ────────────────────────────
The spring owns how far out of the corner a button is and
the hover owns whether it is being pointed at, and both
want to scale it. An inline `scale` beats any rule, so
the component writes --pop instead and the two are
multiplied here.
ONLY --zoom IS TRANSITIONED, which is the whole reason
for the split. A transition on `scale` itself would smooth
the spring's own frames — two animations arguing over one
property, which is the note Sound and Tilt both carry.
--zoom changes twice per hover and can be eased; --pop
changes every frame and must not be. */
scale: calc(var(--pop, 1) * var(--zoom, 1));
transition: --zoom 160ms cubic-bezier(0.24, 1.34, 0.38, 1);}
/* ── the hover is the size, and nothing else ───────────────
It inverted first — ink disc, card-coloured glyph — which
made four small buttons the darkest thing on screen the
moment you went near them. Then it was eight per cent of
ink mixed into the fill, which is quieter and still a
second answer to a question the scale had already answered.
So: one cue. The button grows and stays the colour it was.
Nothing here changes the fill, which is why the rule above
has no background transition left to run. */
.nod-act:hover { --zoom: 1.12; }
// bencho source (MIT). npm i @tabler/icons-react motion react · Tailwind CSS v4
// ── blocks/action-node/ActionNode.tsx (https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/action-node/ActionNode.tsx)
/*
MIT License
Copyright (c) 2026 Lorenzo Cabra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Not covered by this licence: the Bencho name and the goat mark, and the
photographs shown on bencho.dev (none are included here). Third-party
material keeps its own licence; see THIRD_PARTY.md.
Icon substitution (this copy only): lucide-react (ISC) was replaced with @tabler/icons-react (MIT).
Sample photographs were replaced with Incidental AI assets. The Bencho name and goat mark are not licensed for marketing use.
*/
import { useEffect, useRef, useState } from "react";
import { IconCopy as Copy, IconGitCommit as GitCommitHorizontal, IconLink as Link2, IconPlus as Plus, IconSettings as Settings2 } from "@tabler/icons-react";
/* ── inlined from lab/spring ──────────────────────── */
/* ── one spring, for everything that settles ───────────────
The maths was already on this bench twice, copied by hand:
Humidity's wheel and Brightness's column both accumulate
velocity toward a target, damp it, and snap when both the
delta and the velocity fall under 0.02. Two copies is a
coincidence; five would be a policy, so it comes out here
before the elastic blocks are written against it.
The two shipped copies are deliberately NOT refactored onto
this. They work, they are tuned, and rewriting the innards
of two live components to prove a point about duplication
is how a good afternoon becomes a bad one. This is the one
new code uses.
Frames, not milliseconds. `dt` is expressed in sixtieths of
a second and the damping is RAISED to it rather than
multiplied by it, so a dropped frame decays the same amount
of energy as the two frames it replaced. Multiplying is the
version that makes a spring behave differently on a busy
page, which is the hardest kind of bug to see.
The loop parks itself the moment the value has settled.
CLAUDE.md is not complimentary about the one permanent
requestAnimationFrame already on this bench and there is no
case for five more. */
/* 0..100 into the two numbers a spring actually has.
50 is what Humidity and Brightness were tuned at, which is
the rule every elastic knob on this bench follows — see
lab/motion. Turn the panel to the middle and nothing has
changed.
Both ends have to be usable, which is what fixes the range:
at 0 it is slow and heavy and still arrives, at 100 it is
quick with a visible overshoot, and nowhere in between does
it ring for longer than it takes to read. */
/* The pair is chosen by DAMPING RATIO and then written back
as stiffness and decay, because the ratio is the thing a
person is actually setting and the two numbers on their own
do not say what they add up to.
zeta = -ln(d) / (2 * sqrt(k))
The first version of this ran 0.06..0.26 stiffness against
0.93..0.74 decay, which reads as a sensible spread and is
not one: it puts zeta between 0.15 and 0.16 across the
WHOLE range, so every setting overshot by about sixty per
cent and the knob only changed how fast it did it. Pull's
return went 130px past its own resting position and lifted
the content off the top of the card.
0 → zeta ~0.85, heavy, arrives without a ring
50 → zeta ~0.41, near where Humidity and Brightness sit
100 → zeta ~0.20, lively, two visible rebounds
Both ends shippable, which is the constraint that fixed the
numbers rather than taste. */
const springOf = (tune: number) => ({
/* stiffness: how hard it is pulled toward the target */
k: 0.08 + (tune / 100) * 0.16,
/* decay, per frame: how much of the velocity survives */
d: 0.62 + (tune / 100) * 0.2,
});
/* Units matter. The snap threshold is absolute, so a caller
works in pixels or in 0..100 — a spring driven over 0..1
would be "settled" before it had visibly moved. */
function useSpring(target: number, tune = 50, instant = false) {
const [at, setAt] = useState(target);
const cur = useRef(target);
const vel = useRef(0);
const raf = useRef(0);
useEffect(() => {
if (instant) {
cur.current = target;
vel.current = 0;
setAt(target);
return;
}
const { k, d } = springOf(tune);
let prev = 0;
const tick = (t: number) => {
const dt = prev ? clamp((t - prev) / 16.67, 0, 2.5) : 1;
prev = t;
vel.current += (target - cur.current) * k * dt;
vel.current *= Math.pow(d, dt);
cur.current += vel.current * dt;
if (Math.abs(target - cur.current) < 0.02 && Math.abs(vel.current) < 0.02) {
cur.current = target;
vel.current = 0;
setAt(target);
raf.current = 0;
return;
}
setAt(cur.current);
raf.current = requestAnimationFrame(tick);
};
raf.current = requestAnimationFrame(tick);
return () => {
cancelAnimationFrame(raf.current);
raf.current = 0;
};
/* `tune` sits here beside `target` for the reason
Brightness spells out: the loop closes over it, so
without it a knob turned mid-flight would do nothing
until something else restarted the effect. Restarting
picks up from the refs, so it continues rather than
snapping. */
}, [target, tune, instant]);
return at;
}
/* Read once, the way the wheel and the pill nav do. A
preference, not a live input. */
const stillness = () =>
typeof window !== "undefined" &&
!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
/* A drawn placeholder: Bencho's photographs are licensed to
the site and do not travel. Point this at your own. */
const AVATARS: Record<string, string> = {
kai: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2096%2096%22%20width%3D%2296%22%20height%3D%2296%22%3E%3Crect%20width%3D%2296%22%20height%3D%2296%22%20fill%3D%22rgb%28187%2C187%2C189%29%22%2F%3E%3Ctext%20x%3D%2248%22%20y%3D%2261%22%20text-anchor%3D%22middle%22%20font-family%3D%22Inter%2C%20Helvetica%2C%20Arial%2C%20sans-serif%22%20font-size%3D%2240%22%20font-weight%3D%22500%22%20fill%3D%22%23fff%22%3EA%3C%2Ftext%3E%3C%2Fsvg%3E",
mara: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2096%2096%22%20width%3D%2296%22%20height%3D%2296%22%3E%3Crect%20width%3D%2296%22%20height%3D%2296%22%20fill%3D%22rgb%28164%2C164%2C166%29%22%2F%3E%3Ctext%20x%3D%2248%22%20y%3D%2261%22%20text-anchor%3D%22middle%22%20font-family%3D%22Inter%2C%20Helvetica%2C%20Arial%2C%20sans-serif%22%20font-size%3D%2240%22%20font-weight%3D%22500%22%20fill%3D%22%23fff%22%3EP%3C%2Ftext%3E%3C%2Fsvg%3E",
sofia: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2096%2096%22%20width%3D%2296%22%20height%3D%2296%22%3E%3Crect%20width%3D%2296%22%20height%3D%2296%22%20fill%3D%22rgb%28201%2C201%2C203%29%22%2F%3E%3Ctext%20x%3D%2248%22%20y%3D%2261%22%20text-anchor%3D%22middle%22%20font-family%3D%22Inter%2C%20Helvetica%2C%20Arial%2C%20sans-serif%22%20font-size%3D%2240%22%20font-weight%3D%22500%22%20fill%3D%22%23fff%22%3EN%3C%2Ftext%3E%3C%2Fsvg%3E",
ines: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2096%2096%22%20width%3D%2296%22%20height%3D%2296%22%3E%3Crect%20width%3D%2296%22%20height%3D%2296%22%20fill%3D%22rgb%28178%2C178%2C180%29%22%2F%3E%3Ctext%20x%3D%2248%22%20y%3D%2261%22%20text-anchor%3D%22middle%22%20font-family%3D%22Inter%2C%20Helvetica%2C%20Arial%2C%20sans-serif%22%20font-size%3D%2240%22%20font-weight%3D%22500%22%20fill%3D%22%23fff%22%3EM%3C%2Ftext%3E%3C%2Fsvg%3E",
};
/* ══ Action node ══════════════════════════════════════════
A card for one step of an automation, with its controls
folded into the corner until you want them.
THE CONTROLS ARE THE COMPONENT. Everything else here — the
mark, the name, the row of faces, the line about what it
does — is a node card, and a node card is not an
interaction. What this block is
about is where a card's actions live when you are not using
them, and the answer it argues for is: inside the corner
they belong to.
── THEY COME OUT OF THE CORNER, THEY DO NOT ARRIVE AT IT ─
The reflex is to fade a toolbar in above the card, and it
is wrong in a way that is easy to miss: a control that
fades in has no relationship to the thing it controls. It
could belong to anything. These are drawn on an arc struck
from the card's own top-right corner, they start AT that
corner with no radius and no size, and they travel out
along it — so the card is visibly where they came from and
the corner is visibly what they are attached to.
Which is also why they scale as they travel rather than
arriving full size: a thing coming out of somewhere is
small when it is still mostly inside it.
── ONE SPRING EACH, AND THE STAGGER IS A DELAY ON THE
TARGET, NOT AN EASE ─────────────────────────────────
Four springs, always constructed, because hooks cannot be
conditional — the count knob decides how many are drawn,
not how many exist. Each one is told to open a beat after
the one before it, and the spring does the rest: the
cascade is four objects with their own physics rather than
one animation with offsets, which is the difference between
a fan opening and a list appearing in order.
Closing runs the other way, last out first back, so the
fan folds into the corner rather than collapsing from the
inside. */
const clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));
/* the button and half of it. Everything else that has a size
is measured off this one — the spacing, the hiding place,
the air the block keeps — so the buttons grow by changing
this number and nothing else. */
const DOT = 36;
const R = DOT / 2;
/* centre to centre along the path. A real distance rather
than an angle, which is the point of laying these out by
arc length: twelve pixels of air between two buttons is
twelve pixels whatever the corner is doing. */
const SPACING = DOT + 12;
/* ── they ride the card's OWN corner, offset ───────────────
The path is the card's outline pushed out by a constant
distance: straight along the top edge, round the corner on
an arc concentric with it, straight down the right edge.
Buttons are placed by how far along that path they are.
── WHY NOT A CIRCLE STRUCK FROM ONE POINT ──────────────
That is what this was, with the centre parked 26px inside
the corner, and it only looked right at one corner radius —
the 18 it was tuned against. Square the card off and the
card's material comes out to meet a path that has not
moved: measured at Corner 0, the middle button cleared the
corner by 2px while the ones at the ends of the fan still
had thirteen. Round it right up and the opposite happens.
A circle also cannot go round more than the quarter between
the two edges. Past that the buttons carry on rotating away
from an edge that has stopped curving, and a wide fan put
its end buttons THROUGH the card's top edge.
An offset path has neither problem because it is the card's
own shape: every point on it is exactly `gap` from the
nearest card surface, corner or edge, at every radius.
── how far along the path a button sits ────────────────
`s` is arc length measured from where the corner arc meets
the top edge, so the corner occupies 0..len and anything
outside that has run onto a straight. Returns the point and
the direction out of the card there, which is what the
button slides along when it opens. */
function ride(s: number, corner: number, off: number) {
/* the offset arc is concentric with the card's, so its
radius is the card's plus the offset — and floored just
above zero for a square card, where the corner is a
point and the arc is a quarter turn about it */
const arc = Math.max(0.001, corner + off);
const len = (arc * Math.PI) / 2;
if (s <= 0) {
/* along the top edge, going left */
return { x: -corner + s, y: -off, nx: 0, ny: -1 };
}
if (s >= len) {
/* down the right edge */
return { x: off, y: corner + (s - len), nx: 1, ny: 0 };
}
const th = Math.PI / 2 - s / arc;
return {
x: -corner + arc * Math.cos(th),
y: corner - arc * Math.sin(th),
nx: Math.cos(th),
ny: -Math.sin(th),
};
}
/* ── where they hide, and it has to be PROVABLY inside ─────
A point on the card's diagonal, far enough in that a whole
button fits behind the card with nothing showing past the
corner.
It cannot simply be "back along the normal", which is what
it was: a button over the top edge slid down behind the
top edge fine, but the one sitting on the corner slid back
toward a corner that, when Corner is 0, has no material in
the diagonal to hide behind. Measured at Corner 1, four
pixels of every folded button showed past the point.
Two cases, because a rounded corner is bitten out of the
very material a square one has:
· corner >= R + 2, and the corner's own centre is the
answer. It is `corner` from both edges and `corner`
from the arc, so a button there is at least R inside
everything, with two pixels to spare. The margin is not
decoration: at exactly R the button is tangent to the
boundary, which draws a hairline of it.
· below that, and there is no room near the corner at
all — the arc has eaten it. So go past the corner's
disc entirely and stop where both edges are clear.
The distance is along the diagonal, so this is one number.
Nobody ever sees the position; what they see is that
nothing shows when the fan is shut. */
const hideAt = (corner: number) =>
corner >= R + 2
? corner * Math.SQRT2
: Math.max(R * Math.SQRT2 + 2, corner * Math.SQRT2 + corner + 2);
/* ── Reach is the air between the card and the fan ─────────
The scale is the original 0..100 one and the knob is
allowed a narrow window of it: 20 to 40, which is 11px of
gap to 16. That window is the whole of what is worth
having — tighter and the buttons foul the corner, wider and
they stop reading as attached to the card — so the knob
spends all twenty of its steps inside it.
NOT a pixel count, which it was for one revision and should
not have been. Turning the number itself into pixels
doubled every setting: 20 on this scale is 11px of air, and
20 read as px is a fan sitting twice as far out as the one
that had just been approved. The scale a value was judged
on is part of the value. */
const gapPx = (reach: number) => 6 + (clamp(reach, 20, 40) / 100) * 24;
/* ── the air the BLOCK keeps above and below the card ─────
The fan hangs outside the card, and until now it hung
outside the block as well: the wrapper's box was the card
and nothing else. That is right about width and wrong about
height. The wall measures a component and pads what it
measures, so a card reserving no vertical room of its own
arrived as the squattest tile on the wall — 303px against
neighbours at 364 and 424 — and the buttons the block is
ABOUT were drawn in the tile's margin rather than in the
block.
So the block keeps the room the fan uses. Measured at the
top of the Reach window and not at the current setting,
because a box that changed size as the knob moved would
resize its own tile on the wall while you dragged it. One
constant, both sides, symmetrical so the card stays centred
in the overlay.
THE WIDTH IS UNTOUCHED, which was the whole of the old
note: the wall scales by the LARGEST side, so a wider box
is a smaller card. 300 across against 256 down keeps the
width governing and the card exactly the size it was. */
const AIR = Math.ceil(gapPx(100) + DOT);
/* the beat between one button and the next, at the top of the
range. 90ms is about as long as a cascade can be before the
last one reads as late rather than as following. */
const BEAT = 90;
/* ── what the buttons do, and why these four ───────────────
Connect, add a step, duplicate, settings: the four things
you do to a node without opening it. They are all about the
node's place in the flow, which is what a card in a canvas
is for — running it is a property of the whole flow and
belongs to the canvas, not to one step of it.
Deliberately not delete. The one action here that cannot be
undone does not belong in a row that appears under your
cursor. */
const ACTS = [
{ id: "link", label: "Connect", Icon: Link2 },
{ id: "add", label: "Add a step", Icon: Plus },
{ id: "copy", label: "Duplicate", Icon: Copy },
{ id: "settings", label: "Settings", Icon: Settings2 },
];
/* ── who is on the step ────────────────────────────────────
Three of the bench's own faces, from lab/avatars.ts, which
is the same set the arrange list and the roster draw. One
photograph of a person belongs to one person across the
whole site: seeing the same face on three blocks reads as
one product, and four different stock sets read as three.
THREE PICTURED, not four. A row of four discs and a count
beside them is most of the width of this card given over to
who is on a step, which is the least urgent thing on it —
see the note where the row is drawn. Three reads as a
handful and leaves the sentence above room.
Names are here because initials are the fallback when a
photograph does not load, and a blank disc is worse than
two letters. */
const CREW = [
{ id: "mara", name: "Mara Quinn" },
{ id: "ines", name: "Tom\u00e1s Oliveira" },
{ id: "kai", name: "Lars Andersen" },
];
/* ── and how many are on it altogether ─────────────────────
The chip beside the faces is the DIFFERENCE, not a typed
number. It read "+2" next to a row of four, which was right
until the row became three and then quietly was not: the two
halves of one fact, kept in two places, and only one of them
edited. Six on the step, three pictured, three counted. */
const ON_STEP = 6;
const initials = (n: string) =>
n.split(" ").map((w) => w[0]).join("").slice(0, 2).toUpperCase();
/* ── the step's own number ─────────────────────────────────
A node in a flow is identified by where it sits in the
flow, not by the service it happens to call: two steps can
both be Claude and they are not the same step. So the
heading is the id and the service is a line under it \u2014 which
is also what every automation tool on the market does, for
the same reason. */
const NODE = "Node 07";
export function ActionNode({
/* how far the fan travels out from the corner, 0..100 */
/* the air between the card and the buttons, 20..40. It was
the Reach knob; it is fixed at 25 and off the panel now
(2026-09-26), and stays a prop so the value lives here. */
reach = 25,
/* the spring, 0..100 — see springOf in ./spring */
bounce = 20,
/* how far apart the buttons open, 0..100 */
stagger = 55,
/* how many of ACTS are drawn, 2..4 */
count = 4,
/* the card's own corner, in px. The buttons keep theirs. */
corner = 20,
}: {
reach?: number;
bounce?: number;
stagger?: number;
count?: number;
corner?: number;
} = {}) {
const n = clamp(Math.round(count), 2, 4);
const still = stillness();
/* ── open, and then open PER BUTTON ─────────────────────
`on` is the pointer. `lit` is what each spring is aiming
at, which is the same thing a moment later — and the
moment is the stagger. Kept as four flags rather than as
a count, so the reverse fold is the same mechanism read
backwards rather than a second one. */
const [on, setOn] = useState(false);
const [lit, setLit] = useState([false, false, false, false]);
const timers = useRef<number[]>([]);
useEffect(() => {
timers.current.forEach(clearTimeout);
timers.current = [];
const gap = still ? 0 : (clamp(stagger, 0, 100) / 100) * BEAT;
for (let i = 0; i < 4; i += 1) {
/* opening runs first to last; closing runs last to
first, so the fan folds back into the corner in the
order it came out of it */
const place = on ? i : n - 1 - i;
const at = gap * place;
const set = () =>
setLit((prev) => {
if (prev[i] === on) return prev;
const next = [...prev];
next[i] = on;
return next;
});
if (at <= 0) set();
else timers.current.push(window.setTimeout(set, at));
}
return () => {
timers.current.forEach(clearTimeout);
timers.current = [];
};
}, [on, n, stagger, still]);
/* Four, always, whatever `count` says: a hook cannot be
drawn conditionally and a spring nobody reads costs a
number that never moves. */
const p0 = useSpring(lit[0] ? 100 : 0, bounce, still);
const p1 = useSpring(lit[1] ? 100 : 0, bounce, still);
const p2 = useSpring(lit[2] ? 100 : 0, bounce, still);
const p3 = useSpring(lit[3] ? 100 : 0, bounce, still);
const at = [p0, p1, p2, p3];
/* ── where each button ends up ──────────────────────────
The path is offset from the card by the gap PLUS a
button's own half, so the gap is measured from the card
to the button's edge rather than to its middle.
Centred on the corner's midpoint and spread by arc
length, so the fan is symmetrical about the diagonal
however many are on it and however square the card is.
Laid out from the top edge down, so the cascade opens
over the card's top and comes round. */
const c = clamp(corner, 0, 32);
const off = gapPx(reach) + R;
const mid = ((c + off) * Math.PI) / 4;
const spots = Array.from({ length: n }, (_, i) =>
ride(mid + (i - (n - 1) / 2) * SPACING, c, off),
);
/* the one place they all fold back to */
const deep = hideAt(c) / Math.SQRT2;
const hid = { x: -deep, y: deep };
/* ── the air between the card and the fan is a HOLE ─────
The wrapper's box is the card and the buttons hang
outside it, so the eleven to sixteen pixels of air the
Reach knob puts between the two belong to nothing at all.
Move the pointer from the card toward a button and it
leaves .nod on the way across — the fan folds itself away
from under the cursor that was reaching for it, and the
buttons cannot be got at by hand. Only a jump that clears
the gap in one frame ever landed on one.
So the fan carries a hit area: the box its own buttons
occupy, bled a little, hung off the same corner anchor
they are. Measured off `spots`, so it follows Reach,
Corner and the count without a second copy of the
geometry living anywhere.
Live only while the fan is open — an always-on pad would
mean empty space beside the card opened it, which is the
opposite complaint. */
const BLEED = 6;
const box = spots.reduce(
(b, s) => ({
l: Math.min(b.l, s.x - R - BLEED),
r: Math.max(b.r, s.x + R + BLEED),
t: Math.min(b.t, s.y - R - BLEED),
d: Math.max(b.d, s.y + R + BLEED),
}),
/* seeded on the anchor, so the pad reaches back to the
corner however far out the fan has been sent */
{ l: 0, r: 0, t: 0, d: 0 },
);
const pw = box.r - box.l;
const ph = box.d - box.t;
/* the corner itself, in the pad's own coordinates */
const px = -box.l;
const py = -box.t;
/* ── and the bite taken out of it is INSIDE the card ────
The pad is a rectangle and the card is in one corner of
it, so a piece has to come out or the pad lies over the
card's surface. Cut the quadrant — x < 0 and y > 0 — and
the cut is too greedy: just outside a ROUNDED corner, on
the diagonal, the material has pulled back but the
quadrant has not, and that is exactly where the middle
button's path crosses. It leaves a hole 0.41c deep, 8px
at the default, in the one place the hand goes.
x < -c with y > c is card at every radius, so that is the
rectangle to lose: the card keeps its whole surface and
the pad keeps every scrap of the air. */
const bx = Math.max(0, px - c);
const by = Math.min(ph, py + c);
return (
<div
className="nod"
/* the corner rides on the wrapper as a variable rather
than on the card as a style, because the Stroke rule
has to cut its ring to the same radius and a rule
cannot read an inline style. One number, two readers. */
style={
{
"--nod-r": `${c}px`,
/* ── the mark is cut with the card ────────────────
It was a disc, which is the shape a service badge
usually is — and on a card whose corner is a knob
it was the one thing that ignored the knob. Square
the card off and a perfect circle sat inside it
looking like it had come from somewhere else.
Not concentric, because concentric is for a thing
sitting IN the corner and this one is inset from
it by the card's whole padding: `c - 18` is 2 at
the default, which is a square with a chip off it
rather than a rounded square.
A share of the card's radius instead, capped at
half its own 30 — so the top of the Corner range
hands back exactly the circle it used to be, the
bottom is a square in a square card, and the
default is the rounded square in between. */
"--nod-mark-r": `${Math.min(15, c * 0.47).toFixed(2)}px`,
/* here rather than in the sheet because the fan's
anchor below has to be offset by the same number,
and two copies of it is one copy too many */
paddingBlock: AIR,
} as React.CSSProperties
}
onPointerEnter={() => setOn(true)}
/* ── `out` with a containment test, not `leave` ──────
The same swap Tilt makes and for the same reason: the
rehearsal's last beat walks a scripted pointer off the
card carrying `relatedTarget: null`, which React never
turns into a leave — so every card on the wall would
finish its demo with the fan still out. */
onPointerOut={(e) => {
const to = e.relatedTarget as Node | null;
if (!to || !e.currentTarget.contains(to)) setOn(false);
}}
onPointerCancel={() => setOn(false)}
>
<div className="nod-card" data-on={on || undefined}>
<div className="nod-top">
<span className="nod-mark" aria-hidden="true">
{/* ── the mark, from the same set as the buttons ─
lucide's git-commit-horizontal: a ring with a
wire running out of either side of it. Which is
what this card literally is — one step with a
flow arriving and a flow leaving — where the
diamond and the astroid before it were both
shapes that STOOD FOR a step rather than
drawing one.
── AND IT IS WIDER THAN THE OTHERS WERE ──────
The glyph spans its full 24 units where those
filled a square, so at the same nominal size it
reads as a much lighter mark: 15 puts the ring
at under four pixels. 18 is what gives the ring
its weight back without the wires reaching the
mark's own edge — measured, the glyph is 18
across in a 30 box, so six pixels of air stay
on each side.
From the set rather than drawn by hand. The
rule about not drawing marks is really a rule
about not wearing somebody else's LOGO, and a
shape out of the icon set the four buttons
already use is the furthest thing from one. */}
<GitCommitHorizontal size={18} strokeWidth={2} />
</span>
<span className="nod-name">{NODE}</span>
{/* ── AND THERE IS NO BADGE ANY MORE ─────────────
A "Connected" pill sat here, green dot and all, at
the right-hand end of this row. It had already
survived being the wrong word once — it read
"Action", which the mark and the sentence below
both said better — and being moved up from a row
of its own at the foot of the card.
It is gone because of what this block IS. The
controls are the component; the card is the thing
they fold into. A status pill is the loudest
element in the header and it belongs to a node
card that does not exist, telling you about a
connection to nothing — furniture arguing for
attention on a card whose whole job is to sit
still while the corner does the work.
The header is the mark and the name now, which is
as much card as the demonstration needs. */}
</div>
<p className="nod-say">
Reads the thread, writes a summary, and posts it back to the channel it
came from.
</p>
{/* ── the faces, and they come AFTER the sentence ───
They sat between the name and the description,
which put four photographs of people through the
middle of a paragraph — the eye stopped on them and
then had to go back for the line it was reading.
A card like this reads name, then what the step
does, then who is on it. The faces are the least
urgent of the three and the heaviest to look at,
which is exactly the thing to put last. */}
<div className="nod-chain" aria-hidden="true">
{CREW.map((p) => (
<span key={p.id} className="nod-link">
{AVATARS[p.id] ? (
/* draggable={false} for the reason the arrange
list documents: an img is natively
draggable, and a drag started here cancels
the pointer sequence the card is watching. */
<img src={AVATARS[p.id]} alt="" draggable={false} />
) : (
initials(p.name)
)}
</span>
))}
<span className="nod-more">+{ON_STEP - CREW.length}</span>
</div>
</div>
{/* ── the fan ──────────────────────────────────────────
Anchored ON the corner, so every button's travel is
measured from the one point they all came out of.
Positioned rather than laid out: a flex row would put
them in a line and the line is the thing this is
arguing against. */}
{/* ── anchored on the card's own top-right corner ────
Every spot above is measured from that point, so the
fan needs no offset of its own and the arithmetic has
one origin.
THE FAN HANGS OUTSIDE THE BOX, which is deliberate
and is what fixes the card looking half the size of
every other block on the wall. The wall scales a
component so its LARGEST side lands on 260 — so the
air this used to reserve as padding was coming
straight out of the card's own budget: a 375px box
for a 288px card meant the card drew at 199 where a
plain 300px block drew at 260.
The buttons overflow instead. The wall's cards carry
82px of vertical padding and centre what they hold,
so there is room for the fan on both sides it uses,
and the component's box is now the card and nothing
else \u2014 which is also what centres the card in the
tile. */}
{/* `top: AIR`, not 0: an absolutely positioned child is
laid against the PADDING box, so the air above pushes
the card down and would leave the anchor behind at
the top of the block. The corner it is struck from is
the card's corner or it is nothing. */}
<div className="nod-fan" style={{ top: AIR, right: 0 }}>
<i
className="nod-reach"
aria-hidden="true"
data-on={on || undefined}
style={{
left: box.l,
top: box.t,
width: pw,
height: ph,
clipPath: `polygon(0 0, ${pw}px 0, ${pw}px ${ph}px, ${bx}px ${ph}px, ${bx}px ${by}px, 0 ${by}px)`,
}}
/>
{ACTS.slice(0, n).map((a, i) => {
const u = clamp(at[i] / 100, 0, 1.4);
const spot = spots[i];
/* ── out of the corner, in a straight line ───────
From the hidden point to its place on the path,
so the fan opens OUT of the corner rather than
each button dropping off its own edge. Which is
also the only version that can be hidden at every
corner radius — see hideAt.
`u` is not clamped, so the spring's overshoot
carries each button a little past its place and
back, rather than being flattened at the end of
the journey. */
const put = (a: number, b: number) => a + (b - a) * u;
return (
<button
key={a.id}
className="nod-act"
type="button"
aria-label={a.label}
title={a.label}
/* hidden from the keyboard while it is folded
away: a control you cannot see should not be
the next thing tab lands on */
tabIndex={on ? 0 : -1}
style={{
width: DOT,
height: DOT,
/* its own centre on the anchor before anything
moves it. Here rather than in the sheet
because it is exactly half a button, and a
copy of that over there is a number that
goes stale the day DOT changes — which it
just did. */
marginTop: -R,
marginLeft: -R,
translate: `${put(hid.x, spot.x)}px ${put(hid.y, spot.y)}px`,
/* ── barely any scale, and no fade at all ──
Both were doing a job the stacking does
better now. A button hidden UNDER the card
does not need to be transparent to be
hidden, and a fade on something sliding out
of a drawer is the one cue that says it was
never really in there.
The 0.18 that is left is not concealment,
it is weight: a thing being pushed out
arrives at its full size a moment after it
arrives at its place, and the spring's own
overshoot carries the rest.
── A VARIABLE, NOT THE SCALE ────────────
Because the hover has to grow the button
too, and two writers cannot share one
property: an inline `scale` wins over any
rule, so a CSS hover would have been
ignored. The stylesheet multiplies this by
its own factor and sets `scale` once from
both — see .nod-act, which also explains why
only one of the two is transitioned. */
"--pop": 0.82 + 0.18 * Math.min(u, 1),
} as React.CSSProperties}
>
{/* 16 in a 36 disc, which is the 14-in-32 the
smaller button had. A glyph that stayed put
while the disc grew would read as the button
getting emptier rather than bigger. */}
<a.Icon size={16} strokeWidth={2} />
</button>
);
})}
</div>
</div>
);
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

在线编辑每个组件,用控件微调,下载完整源码,复制进阶提示词。
一次性 $49占位价格
测试模式:不会真实扣款。
免费:预览、复制按钮和课程说明。
清楚的形状、一种强色和短促的按压反馈,让它有实体感。
主要操作、行动号召和工具栏。
改圆角、内边距和悬停过渡的时长。
把 Bencho (github.com/cabralorenzo/bencho)(MIT)中的「操作节点」组件加入我的 React + Tailwind CSS 应用。源文件:https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/action-node/ActionNode.tsx。清楚的形状、一种强色和短促的按压反馈,让它有实体感。 适用场景:主要操作、行动号召和工具栏。 可调参数:改圆角、内边距和悬停过渡的时长。 支持浅色与深色主题,遵循 prefers-reduced-motion。保留 MIT 许可声明。
更完整的提示词,包含调参、无障碍和接入步骤。