性能
需注意帧率: 平均 60 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 5.3 KB · 运行时 153 KB
Wake sliderMIT输入框Bencho
由 Lorenzo Cabra 制作的输入框 React 组件。依据 MIT 许可从 Bencho 原样收录,此处为实时预览。
质量报告
等级和分数来自构建或测试时跑过的自动检查。没跑过的项目会标成「未检测」,不会填假数据。
帧率: 平均 60 fps,p5 59.5 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 5.3 KB · 运行时 153 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;
}
}
/* WakeSlider.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.
*/
/* ══ Wake slider ══════════════════════════════════════════
lab/WakeSlider.tsx. Thin bars, the reading beside them. The bars
are data marks, so they take the ink strengths: ink when lit,
faint after the value. Heights are written by the component */
.wks {
display: flex;
align-items: center;
gap: 16px;
padding: 16px;
color: var(--fill-on, #17181a);}
.wks-track {
display: flex;
align-items: center;
gap: 4px;
cursor: ew-resize;
touch-action: none;
user-select: none;
-webkit-user-select: none;
-webkit-tap-highlight-color: transparent;
border-radius: 6px;}
.wks-track:focus-visible { outline: 2px solid #2231dd; outline-offset: 6px; }
.wks-bar {
flex: none;
width: 3px;
border-radius: 3px;
background: color-mix(in srgb, var(--fill-on, #17181a) 32%, var(--fill-slab, #fff));
transform-origin: 50% 50%;
transition: background-color 160ms ease;}
.wks-bar[data-on] { background: var(--fill-on, #17181a); }
.wks-value {
min-width: 3ch;
font-size: 14px;
font-weight: 500;
letter-spacing: -0.01em;
font-variant-numeric: tabular-nums;
color: color-mix(in srgb, var(--fill-on, #17181a) 72%, var(--fill-slab, #fff));}
// bencho source (MIT). npm i motion react · Tailwind CSS v4
// ── blocks/wake-slider/WakeSlider.tsx (https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/wake-slider/WakeSlider.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";
/* ══ Wake slider ══════════════════════════════════════════
A range with no thumb: a row of thin bars, solid up to the
value and faint after it, with the reading beside them. Drag
anywhere along it. Drag slowly and the bars simply fill; drag
fast and every bar the value sweeps past springs up, taller the
faster you went, and settles back — a wake left behind the hand.
── EACH BAR HOLDS A LITTLE ENERGY ──────────────────────
When the value crosses a bar, that bar takes energy from the
speed of the drag. Every frame all of it decays at the same
rate, so the bars crossed longest ago have fallen furthest: the
tallest ones are always at the hand and the run tails off
behind it. That falloff IS the wake; nothing draws it.
── WRITTEN, NOT RENDERED ───────────────────────────────
The heights change every frame, so they go straight onto each
bar's transform from a ref. React renders when the value
changes, which is what the reading and the colours need, and
the loop runs only while some bar still has energy. */
const H = 20; // a bar at rest, px
const GAP = 4; // bar pitch minus its width
const BAR = 3;
const clamp = (v: number, a: number, b: number) => Math.min(b, Math.max(a, v));
export function WakeSlider({
/* how many bars make the track */
bars = 36,
/* how high the wake rises, 0..100 */
wake = 60,
}: {
bars?: number;
wake?: number;
} = {}) {
const n = Math.round(clamp(bars, 12, 64));
const [value, setValue] = useState(50);
const track = useRef<HTMLDivElement | null>(null);
const els = useRef<(HTMLSpanElement | null)[]>([]);
const st = useRef({
energy: new Float32Array(n),
down: false,
lastX: 0,
lastT: 0,
speed: 0,
raf: 0,
at: 0.5, // the value as a fraction, without React in the way
lastBar: -1,
});
const knob = useRef(wake);
knob.current = wake;
/* a new bar count is a new row */
useEffect(() => {
st.current.energy = new Float32Array(n);
}, [n]);
const loop = () => {
const s = st.current;
if (s.raf) return;
let prev = performance.now();
const run = (now: number) => {
const dt = Math.min(0.05, (now - prev) / 1000);
prev = now;
let live = false;
const fall = Math.exp(-dt * 6.5);
for (let i = 0; i < s.energy.length; i++) {
s.energy[i] *= fall;
if (s.energy[i] < 0.002) s.energy[i] = 0;
else live = true;
const b = els.current[i];
/* up to 2.6 times as tall at the very top of the knob */
if (b) b.style.transform = `scaleY(${(1 + s.energy[i] * 1.6).toFixed(3)})`;
}
s.raf = live || s.down ? requestAnimationFrame(run) : 0;
};
s.raf = requestAnimationFrame(run);
};
useEffect(() => () => cancelAnimationFrame(st.current.raf), []);
/* move the value to a fraction, waking every bar it passes */
const to = (f: number, speed: number) => {
const s = st.current;
f = clamp(f, 0, 1);
const from = s.at;
s.at = f;
const a = Math.round(from * (n - 1)), b = Math.round(f * (n - 1));
/* how hard: the drag's speed in bars per second, through a
curve that saturates, scaled by the knob */
const push = (1 - Math.exp(-speed / 900)) * (knob.current / 60);
const lo = Math.min(a, b), hi = Math.max(a, b);
for (let i = lo; i <= hi; i++) s.energy[i] = Math.max(s.energy[i], push);
if (b !== s.lastBar) {
s.lastBar = b;
}
setValue(Math.round(f * 100));
loop();
};
const frac = (clientX: number) => {
const r = track.current!.getBoundingClientRect();
return (clientX - r.left) / r.width;
};
const lit = Math.round((value / 100) * (n - 1));
return (
<div className="wks">
<div
ref={track}
className="wks-track"
role="slider"
tabIndex={0}
aria-label="Value"
aria-valuemin={0}
aria-valuemax={100}
aria-valuenow={value}
style={{ width: n * (BAR + GAP) - GAP, height: H * 2.6 }}
onPointerDown={(e) => {
const s = st.current;
try { e.currentTarget.setPointerCapture(e.pointerId); } catch { /* a scripted pointer */ }
s.down = true;
s.lastX = e.clientX;
s.lastT = performance.now();
s.speed = 0;
to(frac(e.clientX), 0);
}}
onPointerMove={(e) => {
const s = st.current;
if (!s.down) return;
const now = performance.now();
const dt = Math.max(0.008, (now - s.lastT) / 1000);
/* speed in px per second, smoothed so one jittery frame
cannot fake a fling */
const v = Math.abs(e.clientX - s.lastX) / dt;
s.speed = s.speed * 0.5 + v * 0.5;
s.lastX = e.clientX;
s.lastT = now;
to(frac(e.clientX), s.speed);
}}
onPointerUp={(e) => {
st.current.down = false;
try { e.currentTarget.releasePointerCapture(e.pointerId); } catch { /* never captured */ }
}}
onPointerCancel={() => { st.current.down = false; }}
onKeyDown={(e) => {
const step = e.shiftKey ? 10 : 1;
let next: number | null = null;
if (e.key === "ArrowRight" || e.key === "ArrowUp") next = value + step;
if (e.key === "ArrowLeft" || e.key === "ArrowDown") next = value - step;
if (e.key === "Home") next = 0;
if (e.key === "End") next = 100;
if (next === null) return;
e.preventDefault();
/* a key press is a small, quick step: a little wake */
to(clamp(next, 0, 100) / 100, 600);
}}
>
{Array.from({ length: n }, (_, i) => (
<span
key={i}
ref={(b) => { els.current[i] = b; }}
className="wks-bar"
data-on={(value > 0 && i <= lit) || undefined}
style={{ height: H }}
/>
))}
</div>
<span className="wks-value">{value}</span>
</div>
);
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

在线编辑每个组件,用控件微调,下载完整源码,复制进阶提示词。
一次性 $49占位价格
测试模式:不会真实扣款。
免费:预览、复制按钮和课程说明。
可见的标签、安静的边框和清楚的焦点状态引导输入。
搜索、登录和短文本字段。
调高度、边框颜色和焦点光晕。
把 Bencho (github.com/cabralorenzo/bencho)(MIT)中的「尾迹滑杆」组件加入我的 React + Tailwind CSS 应用。源文件:https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/wake-slider/WakeSlider.tsx。可见的标签、安静的边框和清楚的焦点状态引导输入。 适用场景:搜索、登录和短文本字段。 可调参数:调高度、边框颜色和焦点光晕。 支持浅色与深色主题,遵循 prefers-reduced-motion。保留 MIT 许可声明。
更完整的提示词,包含调参、无障碍和接入步骤。