PendulumPRO
A Newton's cradle in fine lines: momentum passes through the row and back, steady as a metronome.
Code
2 files · 148 lines of TypeScriptPRO
Pendulum is part of Pro
Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.
Motion notes
- The outer balls swing on a sine, the motion of a real small-angle pendulum: they leave the row at full speed and hang for a moment at the top, which is what makes it hypnotic.
- At each impact a pulse of light runs through the resting balls and lingers on the one that leaves, so you see the momentum travel, not just the ends move.
- Balls are outlined rings with a faint arc trailing the swing; strings stop at the rim. Use fewer balls at 24px so each ring stays a ring.
- Spacing is solved from the swing, so the outermost ball never clips the canvas at any size or ball count. Reduced motion holds the right ball at the top of its arc.
Usage
Example
<StatusPill icon={<NewtonCradle size={32} />} label="Working" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | number | 32 | Size in px. |
| balls | number | 5 | Number of balls, 3–7. |
| cycle | number | 1.8 | Seconds for a full swing out and back on both sides. |
| className | string | — | Classes for the canvas. |