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

检测于 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;
}
}
/* Scrub.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.
*/
/* ══ Time scrubber ═══════════════════════════════════════ */
.tms {
width: 300px;
padding: 20px 20px 16px;
border-radius: var(--tms-r);
background: var(--fill-slab, var(--card));
color: var(--fill-on, var(--ink));
font-family: var(--font-ui);
user-select: none;
-webkit-user-select: none;}
[data-stroke="on"] .tms { box-shadow: 0 0 0 1px var(--pane-edge); }
.tms-read {
display: flex;
align-items: baseline;
justify-content: center;
gap: 8px;}
.tms-time {
display: inline-flex;
font-size: 30px;
font-weight: 500;
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: tabular-nums;}
/* a digit rolls through a window that FADES rather than clips.
Each cell is 1.5em for a 1em line, the digit centred in it, so
at rest the neighbours sit wholly outside the window; the mask
takes the top and bottom quarter-em to nothing, so a digit on
the move leaves and arrives through a fade, never an edge. The
negative margin keeps the line box at 1em. */
.tms-col {
display: inline-block;
height: 1.5em;
margin: -0.25em 0;
overflow: hidden;
mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);}
.tms-strip {
display: flex;
flex-direction: column;
transition: transform 220ms cubic-bezier(0.24, 1.34, 0.38, 1);}
.tms-strip > span { height: 1.5em; line-height: 1.5em; }
/* and it smears a little while it rolls */
.tms-strip[data-flip="a"] { animation: tms-blur-a 260ms ease-out; }
.tms-strip[data-flip="b"] { animation: tms-blur-b 260ms ease-out; }
.tms-colon { padding: 0 0.02em; }
.tms-mer {
font-size: 14px;
font-weight: 500;
color: color-mix(in srgb, var(--fill-on, #17181a) 52%, var(--fill-slab, #ffffff));
letter-spacing: -0.01em;}
.tms-ruler {
position: relative;
height: 58px;
margin-top: 16px;
cursor: grab;
touch-action: pan-y;
outline: none;
/* the ruler fades out at both ends, like a wheel turning away */
mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);}
.tms-ruler:active { cursor: grabbing; }
.tms-ruler:focus-visible { box-shadow: inset 0 0 0 2px var(--signal, #2231dd); border-radius: 10px; }
.tms-track { position: absolute; left: 50%; top: 0; bottom: 0; }
.tms-tick {
position: absolute;
left: -1px;
top: 8px;
width: 2px;
height: 10px;
border-radius: 1px;
background: var(--fill-on, var(--ink));
transform-origin: 50% 0;}
.tms-tick[data-kind="quarter"] { height: 17px; }
.tms-tick[data-kind="hour"] { height: 25px; }
.tms-hour {
position: absolute;
left: 0;
top: 38px;
font-size: 11px;
font-weight: 400;
white-space: nowrap;
color: color-mix(in srgb, var(--fill-on, #17181a) 52%, var(--fill-slab, #ffffff));
letter-spacing: 0em;}
/* the fixed mark the ruler runs under */
.tms-mark {
position: absolute;
left: 50%;
top: 2px;
width: 3px;
height: 32px;
margin-left: -1.5px;
border-radius: 2px;
background: #e5484d;}
@keyframes tms-blur-a { from { filter: blur(2px); } to { filter: blur(0); } }
@keyframes tms-blur-b { from { filter: blur(2px); } to { filter: blur(0); } }
// bencho source (MIT). npm i motion react · Tailwind CSS v4
// ── blocks/time-scrubber/Scrub.tsx (https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/time-scrubber/Scrub.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";
/* ══ Time scrubber ════════════════════════════════════════
A time over a ruler. Drag the ruler under the centre mark and
the time runs with it; fling it and it coasts, then settles on
the nearest step.
── ONE SPRING FOR THE THROW AND THE SNAP ───────────────
On release the landing is decided at once: where the ruler
would coast to at the speed it was let go, rounded to the
nearest step. Then one spring carries it there, starting with
the hand's own velocity — so a flick coasts and a slow
release just settles, and there is no seam between "gliding"
and "snapping" because they are the same motion.
── A DIAL SEEN FROM THE FRONT ──────────────────────────
Ticks at the centre stand tall and dark and fall away toward
the edges, in height and in ink, which is what makes a flat
strip read as the face of a wheel. Only the ticks near the
window are drawn at all, so a day of them costs thirty. */
/* ── 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. */
/* 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;
const W = 300;
/* px per minute along the ruler */
const PX = 2;
const HALF = (W - 36) / 2;
const DAY = 1440;
const clamp = (v: number, a: number, b: number) => Math.min(b, Math.max(a, v));
const wrap = (m: number) => ((m % DAY) + DAY) % DAY;
/* ── a digit that rolls, through a window that fades ────────
A strip of 0–9 slides to the digit, as it did first — but the
window it slides through is taller than the line and fades to
nothing at its top and bottom instead of clipping. Each digit
sits in a cell with room above and below it, so at rest the
neighbours are wholly outside the window, and on the move a
digit leaves and arrives through the fade rather than being
sliced by an edge. It smears a little while it rolls: a short
blur restarted on every change, two names taken in turn
because re-applying the same one does not replay. */
function Digit({ d }: { d: string }) {
const prev = useRef(d);
const flip = useRef<boolean | null>(null);
if (prev.current !== d) {
prev.current = d;
flip.current = !flip.current;
}
return (
<span className="tms-col">
<span
className="tms-strip"
data-flip={flip.current === null ? undefined : flip.current ? "a" : "b"}
style={{ transform: `translateY(${-Number(d) * 1.5}em)` }}
>
{"0123456789".split("").map((n) => <span key={n}>{n}</span>)}
</span>
</span>
);
}
function label(m: number, h24: boolean) {
const t = wrap(Math.round(m));
const h = Math.floor(t / 60);
const mm = String(t % 60).padStart(2, "0");
if (h24) return { time: `${String(h).padStart(2, "0")}:${mm}`, mer: "" };
return { time: `${h % 12 || 12}:${mm}`, mer: h < 12 ? "AM" : "PM" };
}
export function Scrub({
/* what it settles on, minutes */
step = "15",
/* how far a fling carries, 0..100 */
momentum = 50,
format = "12h",
corner = 20,
start = 570,
}: {
step?: string;
momentum?: number;
format?: string;
corner?: number;
start?: number;
} = {}) {
const still = stillness();
const [pos, setPos] = useState(start);
const p = useRef({ x: start, v: 0, to: start });
const raf = useRef(0);
const knobs = useRef({ step: Number(step) || 15, momentum });
knobs.current = { step: Number(step) || 15, momentum };
const ruler = useRef<HTMLDivElement>(null);
const lastStep = useRef(Math.floor(start / (Number(step) || 15)));
/* a tick under the thumb for every step crossed, a firmer one
on the hour */
const hear = (x: number) => {
const s = knobs.current.step;
const k = Math.floor(x / s);
if (k === lastStep.current) return;
lastStep.current = k;
};
const set = (x: number) => {
p.current.x = x;
hear(x);
setPos(x);
};
const run = () => {
if (raf.current) return;
let prev = 0;
const tick = (t: number) => {
const dt = prev ? clamp((t - prev) / 16.67, 0, 2.5) : 1;
prev = t;
const c = p.current;
/* near-critical: glides in and lands with a hint of give,
no swing back and no slow creep at the end */
c.v += ((c.to - c.x) * 0.022 - c.v * 0.26) * dt;
const x = c.x + c.v * dt;
if (Math.abs(c.to - x) < 0.01 && Math.abs(c.v) < 0.01) {
c.v = 0;
set(c.to);
raf.current = 0;
return;
}
set(x);
raf.current = requestAnimationFrame(tick);
};
raf.current = requestAnimationFrame(tick);
};
useEffect(() => () => { cancelAnimationFrame(raf.current); raf.current = 0; }, []);
/* go to a time, by the spring */
const goTo = (to: number, v = p.current.v) => {
p.current.to = to;
p.current.v = v;
if (still) { p.current.v = 0; set(to); return; }
run();
};
/* ── the drag ──────────────────────────────────────────── */
const drag = useRef<null | { x: number; t: number; v: number; k: number }>(null);
const onDown = (e: React.PointerEvent<HTMLDivElement>) => {
try { e.currentTarget.setPointerCapture(e.pointerId); } catch { /* a scripted pointer */ }
cancelAnimationFrame(raf.current);
raf.current = 0;
const k = e.currentTarget.getBoundingClientRect().width / e.currentTarget.offsetWidth || 1;
drag.current = { x: e.clientX, t: performance.now(), v: 0, k };
p.current.v = 0;
};
const onMove = (e: React.PointerEvent) => {
const g = drag.current;
if (!g) return;
const now = performance.now();
/* left is later: the ruler moves under a fixed mark */
const dm = -(e.clientX - g.x) / g.k / PX;
const dt = Math.max(1, now - g.t) / 16.67;
g.v = g.v * 0.5 + (dm / dt) * 0.5;
g.x = e.clientX;
g.t = now;
set(p.current.x + dm);
};
const onUp = (e: React.PointerEvent<HTMLDivElement>) => {
const g = drag.current;
drag.current = null;
try { e.currentTarget.releasePointerCapture(e.pointerId); } catch { /* never captured */ }
if (!g) return;
/* a hand that stopped before letting go threw nothing */
/* capped, so a flick spins it hours, never days */
const v = performance.now() - g.t > 80 ? 0 : clamp(g.v, -14, 14);
const s = knobs.current.step;
const carry = 6 + (clamp(knobs.current.momentum, 0, 100) / 100) * 30;
const land = Math.round((p.current.x + v * carry) / s) * s;
/* the landing already includes the throw, so the spring starts
with only part of the hand's speed — the whole of it on top
would carry it well past the step and swing back */
goTo(land, v * 0.6);
};
/* a trackpad's sideways swipe moves it too — only sideways, so
scrolling the page past the block is never caught */
useEffect(() => {
const el = ruler.current;
if (!el) return;
let idle = 0;
const wheel = (e: WheelEvent) => {
if (Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;
e.preventDefault();
cancelAnimationFrame(raf.current);
raf.current = 0;
set(p.current.x + e.deltaX / PX);
clearTimeout(idle);
idle = window.setTimeout(() => {
const s = knobs.current.step;
goTo(Math.round(p.current.x / s) * s, 0);
}, 120);
};
el.addEventListener("wheel", wheel, { passive: false });
return () => { el.removeEventListener("wheel", wheel); clearTimeout(idle); };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
/* ── the ticks in the window ───────────────────────────── */
const ticks: { m: number; x: number; f: number; kind: "hour" | "quarter" | "five" }[] = [];
const span = HALF / PX + 10;
for (let m = Math.ceil((pos - span) / 5) * 5; m <= pos + span; m += 5) {
const x = (m - pos) * PX;
const f = clamp(1 - Math.pow(Math.abs(x) / HALF, 2), 0, 1);
const w = wrap(m);
ticks.push({ m, x, f, kind: w % 60 === 0 ? "hour" : w % 15 === 0 ? "quarter" : "five" });
}
const h24 = format === "24h";
const { time, mer } = label(pos, h24);
const s = Number(step) || 15;
return (
<div className="tms" style={{ "--tms-r": `${Math.max(0, corner)}px` } as React.CSSProperties}>
<div className="tms-read" aria-live="polite" aria-label={`${time} ${mer}`}>
<span className="tms-time">
{time.split("").map((c, i) =>
c === ":" ? <span key={`c${i}`} className="tms-colon">:</span> : <Digit key={time.length - i} d={c} />,
)}
</span>
{mer && <span className="tms-mer">{mer}</span>}
</div>
<div
ref={ruler}
className="tms-ruler"
role="slider"
tabIndex={0}
aria-label="Time"
aria-valuetext={`${time} ${mer}`}
aria-valuenow={wrap(Math.round(pos))}
aria-valuemin={0}
aria-valuemax={DAY - 1}
onPointerDown={onDown}
onPointerMove={onMove}
onPointerUp={onUp}
onPointerCancel={onUp}
onKeyDown={(e) => {
const d = e.key === "ArrowRight" ? s : e.key === "ArrowLeft" ? -s : 0;
if (!d) return;
e.preventDefault();
goTo(Math.round(p.current.to / s) * s + d, 0);
}}
>
<div className="tms-track">
{ticks.map((t) => (
<span
key={t.m}
className="tms-tick"
data-kind={t.kind}
style={{
transform: `translateX(${t.x.toFixed(2)}px) scaleY(${(0.55 + 0.45 * t.f).toFixed(3)})`,
opacity: 0.18 + 0.82 * t.f,
}}
/>
))}
{ticks.filter((t) => t.kind === "hour").map((t) => {
const h = Math.floor(wrap(t.m) / 60);
return (
<span
key={`l${t.m}`}
className="tms-hour"
style={{ transform: `translateX(${t.x.toFixed(2)}px) translateX(-50%)`, opacity: 0.15 + 0.85 * t.f }}
>
{h24 ? String(h).padStart(2, "0") : `${h % 12 || 12} ${h < 12 ? "AM" : "PM"}`}
</span>
);
})}
</div>
<span className="tms-mark" aria-hidden="true" />
</div>
</div>
);
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

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