성능
주의프레임 속도: 평균 60 fps, p5 59.5 · 긴 작업: 0개, 총 0 ms, 최장 0 ms · 소스 gzip 6.7 KB · 런타임 153 KB
ParticlesMIT패턴Bencho
Lorenzo Cabra가 만든 패턴 React 컴포넌트입니다. MIT 라이선스에 따라 Bencho에서 수정 없이 수집했으며 여기서 실시간으로 보여 줍니다.
품질 보고
등급과 점수는 빌드 또는 테스트 때 실행한 자동 검사에서 나옵니다. 실행하지 않은 항목은 '미검사'로 표시하며, 숫자를 지어내지 않습니다.
프레임 속도: 평균 60 fps, p5 59.5 · 긴 작업: 0개, 총 0 ms, 최장 0 ms · 소스 gzip 6.7 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;
}
}
/* Particles.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.
*/
/* ══ Particles ═════════════════════════════════════════════
lab/Particles.tsx. The dots are drawn on a canvas in the
element's own `color`, so the ink is set here and the theme
carries it. */
.ptc {
position: relative;
display: grid;
place-items: center;}
.ptc-canvas {
display: block;
color: var(--fill-on, var(--ink));
cursor: crosshair;
touch-action: none;}
// bencho source (MIT). npm i motion react · Tailwind CSS v4
// ── blocks/particles/Particles.tsx (https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/particles/Particles.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 } from "react";
/* ══ Particles ════════════════════════════════════════════
A shape made of dots. Move over it and the dots are pushed
away from the pointer and spring home behind it; press and a
shockwave throws them out, and they gather again into the
NEXT shape — circle, square, flower, round again.
── ONE SET OF DOTS, MANY SHAPES ────────────────────────
The dots never change, only where home is. Every shape is
sampled to the same number of points, and a change of shape
pairs each dot with a new home by angle round the middle, so
the swarm sweeps round into the new outline rather than
crossing itself.
── STRETCHED BY SPEED ──────────────────────────────────
A dot at rest is round; a moving one is drawn a little long
along the way it is going, which is what makes a burst read
as a splash rather than a scatter of points. */
/* ── 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 = 480;
const H = 400;
const CX = W / 2;
const CY = H / 2;
/* how many dots every shape is sampled to */
const N = 720;
export const SHAPES = ["Circle", "Square", "Flower"] as const;
type Shape = (typeof SHAPES)[number];
type Dot = { hx: number; hy: number; x: number; y: number; vx: number; vy: number };
const clamp = (v: number, a: number, b: number) => Math.min(b, Math.max(a, v));
function outline(s: Shape): Path2D {
const p = new Path2D();
if (s === "Circle") p.arc(CX, CY, 150, 0, Math.PI * 2);
else if (s === "Square") p.roundRect(CX - 140, CY - 140, 280, 280, 36);
else {
/* five round petals round a smaller middle — circles drawn
the same way round, so the fill is their union. Petals
just touching their neighbours, so the notches between
them read at the dots' own grain */
for (let i = 0; i < 5; i++) {
const a = -Math.PI / 2 + (i * Math.PI * 2) / 5;
const x = CX + Math.cos(a) * 104;
const y = CY + 8 + Math.sin(a) * 104;
p.moveTo(x + 60, y);
p.arc(x, y, 60, 0, Math.PI * 2);
}
p.moveTo(CX + 58, CY + 8);
p.arc(CX, CY + 8, 58, 0, Math.PI * 2);
}
return p;
}
/* ── N points, spread evenly over the inside of a shape ──
A hex grid spaced so the shape holds about N of them — its
area over N, which is the spacing that fills it evenly — then
trimmed or topped up to exactly N. It was a fixed fine grid
thinned by a stride, and the stride beat against the grid:
the circle came out in zigzag bands. */
function homes(s: Shape): [number, number][] {
const c = document.createElement("canvas");
c.width = W;
c.height = H;
const g = c.getContext("2d")!;
const path = outline(s);
let area = 0;
for (let y = 1; y < H; y += 2) for (let x = 1; x < W; x += 2) if (g.isPointInPath(path, x, y)) area += 4;
const sp = Math.sqrt((area / N) * (2 / Math.sqrt(3)));
const rowH = (sp * Math.sqrt(3)) / 2;
const pts: [number, number][] = [];
for (let y = rowH / 2, row = 0; y < H; y += rowH, row++) {
for (let x = sp / 2 + (row % 2) * (sp / 2); x < W; x += sp) {
if (g.isPointInPath(path, x, y)) pts.push([x, y]);
}
}
/* within a few of N either way; drop evenly or repeat evenly */
const out: [number, number][] = [];
for (let i = 0; i < N; i++) out.push(pts[Math.floor((i * pts.length) / N)]);
return out;
}
const angle = (x: number, y: number) => Math.atan2(y - CY, x - CX);
export function Particles({
/* the shape it opens as */
shape = "Circle",
/* how far the pointer's push reaches, px */
reach = 80,
/* how hard it pushes, 0..100 */
force = 60,
/* the size of a dot */
grain = "Fine",
}: {
shape?: string;
reach?: number;
force?: number;
grain?: string;
} = {}) {
const still = stillness();
const cv = useRef<HTMLCanvasElement | null>(null);
const dots = useRef<Dot[]>([]);
const at = useRef<Shape>("Circle");
const hand = useRef<{ x: number; y: number } | null>(null);
const raf = useRef(0);
const knobs = useRef({ reach, force, grain });
knobs.current = { reach, force, grain };
/* ── give every dot a home in a shape ────────────────── */
const become = (s: Shape) => {
at.current = s;
const next = homes(s);
const ds = dots.current;
if (!ds.length) {
dots.current = next.map(([x, y]) => ({ hx: x, hy: y, x, y, vx: 0, vy: 0 }));
return;
}
/* pair by angle round the middle, so the swarm sweeps */
const a = ds.map((d, i) => [angle(d.x, d.y), i] as const).sort((p, q) => p[0] - q[0]);
const b = next.map((h, i) => [angle(h[0], h[1]), i] as const).sort((p, q) => p[0] - q[0]);
a.forEach(([, di], k) => {
const h = next[b[k][1]];
ds[di].hx = h[0];
ds[di].hy = h[1];
if (still) { ds[di].x = h[0]; ds[di].y = h[1]; }
});
};
const draw = () => {
const c = cv.current;
if (!c) return;
const x = c.getContext("2d")!;
const k = c.width / W;
x.setTransform(k, 0, 0, k, 0, 0);
x.clearRect(0, 0, W, H);
x.fillStyle = getComputedStyle(c).color;
const r = knobs.current.grain === "Coarse" ? 2.7 : 1.9;
x.beginPath();
for (const d of dots.current) {
const sp = Math.hypot(d.vx, d.vy);
if (sp < 0.3) {
x.moveTo(d.x + r, d.y);
x.arc(d.x, d.y, r, 0, Math.PI * 2);
} else {
/* long along its path, a little thin across it */
const s = Math.min(2.6, 1 + sp * 0.12);
const rot = Math.atan2(d.vy, d.vx);
x.moveTo(d.x + Math.cos(rot) * r * s, d.y + Math.sin(rot) * r * s);
x.ellipse(d.x, d.y, r * s, r / Math.sqrt(s), rot, 0, Math.PI * 2);
}
}
x.fill();
};
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 h = hand.current;
const R = clamp(knobs.current.reach, 30, 160);
const S = (clamp(knobs.current.force, 0, 100) / 100) * 11;
let busy = !!h;
for (const d of dots.current) {
if (h) {
const dx = d.x - h.x;
const dy = d.y - h.y;
const dd = Math.hypot(dx, dy);
if (dd < R && dd > 0.01) {
const f = Math.pow(1 - dd / R, 2) * S;
d.vx += (dx / dd) * f * dt;
d.vy += (dy / dd) * f * dt;
}
}
d.vx = (d.vx + (d.hx - d.x) * 0.05 * dt) * Math.pow(0.84, dt);
d.vy = (d.vy + (d.hy - d.y) * 0.05 * dt) * Math.pow(0.84, dt);
d.x += d.vx * dt;
d.y += d.vy * dt;
if (Math.abs(d.hx - d.x) < 0.05 && Math.abs(d.hy - d.y) < 0.05 && Math.abs(d.vx) < 0.02 && Math.abs(d.vy) < 0.02) {
d.x = d.hx; d.y = d.hy; d.vx = 0; d.vy = 0;
} else busy = true;
}
draw();
raf.current = busy ? requestAnimationFrame(tick) : 0;
};
raf.current = requestAnimationFrame(tick);
};
/* set up once, then follow the Shape knob */
useEffect(() => {
const c = cv.current;
if (!c) return;
const dpr = Math.min(2, window.devicePixelRatio || 1);
c.width = Math.round(W * dpr);
c.height = Math.round(H * dpr);
}, []);
useEffect(() => {
const s = (SHAPES as readonly string[]).includes(shape) ? (shape as Shape) : "Circle";
become(s);
draw();
run();
}, [shape]);
useEffect(() => { draw(); }, [grain]);
useEffect(() => () => { cancelAnimationFrame(raf.current); raf.current = 0; }, []);
useEffect(() => {
const mo = new MutationObserver(() => draw());
mo.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"] });
return () => mo.disconnect();
}, []);
const where = (e: React.PointerEvent) => {
const r = e.currentTarget.getBoundingClientRect();
const k = r.width / W;
return { x: (e.clientX - r.left) / k, y: (e.clientY - r.top) / k };
};
return (
<div className="ptc">
<canvas
ref={cv}
className="ptc-canvas"
style={{ width: W, height: H }}
role="img"
aria-label="A shape made of dots. Move over it; press to change the shape."
onPointerMove={(e) => {
if (still) return;
hand.current = where(e);
run();
}}
onPointerLeave={() => { hand.current = null; run(); }}
onPointerDown={(e) => {
/* the shockwave, then the next shape */
const p = where(e);
if (!still) {
const S = 0.4 + (clamp(knobs.current.force, 0, 100) / 100) * 1.2;
for (const d of dots.current) {
const dx = d.x - p.x;
const dy = d.y - p.y;
const dd = Math.hypot(dx, dy);
if (dd > 200 || dd < 0.01) continue;
const f = (1 - dd / 200) * 30 * S;
d.vx += (dx / dd) * f;
d.vy += (dy / dd) * f;
}
}
become(SHAPES[(SHAPES.indexOf(at.current) + 1) % SHAPES.length]);
draw();
run();
}}
/>
</div>
);
}컨트롤 · HTML · CSS · JS
코드를 고치고 컨트롤로 다듬어 보세요. 입력하는 대로 미리보기가 바뀝니다.

이 컴포넌트는 번들된 빌드로 실행되므로 여기서는 스크립트를 읽기만 할 수 있습니다. HTML과 CSS는 수정할 수 있고 전체 소스는 코드 탭에 있습니다.
모든 컴포넌트를 바로 편집하고, 컨트롤로 다듬고, 전체 소스를 내려받고, 고급 프롬프트를 복사하세요.
1회 결제 $49임시 가격
테스트 모드: 실제 결제는 이루어지지 않습니다.
무료: 미리보기, 복사 버튼, 레슨 설명.
반복되는 무늬가 글과 경쟁하지 않으면서 질감을 더합니다.
히어로 배경, 구역 구분, 빈 공간.
타일 크기를 바꾸고 대비를 낮추고 두 가지 색을 고릅니다.
Bencho (github.com/cabralorenzo/bencho)(MIT)의 "Particles" 컴포넌트를 내 React + Tailwind CSS 앱에 추가해 줘. 소스 파일: https://github.com/cabralorenzo/bencho/blob/c65992417427bb09e661674ffa800bef29adef49/blocks/particles/Particles.tsx. 반복되는 무늬가 글과 경쟁하지 않으면서 질감을 더합니다. 사용처: 히어로 배경, 구역 구분, 빈 공간. 조정할 설정: 타일 크기를 바꾸고 대비를 낮추고 두 가지 색을 고릅니다. 라이트와 다크 테마를 지원하고 prefers-reduced-motion을 존중해 줘. MIT 라이선스 고지는 유지해 줘.
조정, 접근성, 연동 단계까지 담은 긴 프롬프트입니다.