Bencho Originals

Features

  • Drag the ball out of its ring and two elastic strands follow it, thinning as they stretch.
  • Five ticks around the ring light up, one for every 18px of pull.
  • Past the 92px limit the pull turns stiff and the ball trembles in place.
  • The arrow on the ball always points where it will fly, then along its path while it flies.
  • Release launches the ball the opposite way. It loses speed to air, bounces off the card's edges and springs home.
  • Fill switches between a dark ball and a light one.

API reference

<Slingshot /> from components/bencho/slingshot.tsx

PropTypeDefaultDescription
fill"dark" | "light""dark"Ball colour.
powernumber (0–100)100Launch speed for a full pull.
bouncenumber (0–100)30How much speed the ball keeps off each wall.
onLaunch(strength: number) => void—Called on release with the pull length from 0 to 1.

Keyboard interactions

TabFocuses the ball.
Arrow keysPull the ball back 14px in that direction.
Enter / SpaceLaunches. With no pull it fires a default shot up and to the right.
EscapeLets the band go slack and sends the ball home.

Accessibility

  • The ball is a focusable button with a label that explains how to pull and launch.
  • A polite live region says how far the band is pulled and when the ball launches.

Sound & haptics

Silent by design: no audio and no vibration. All of the feedback is visual, so it works anywhere, muted or not.

Files

Written from scratch for sher.md and inspired by bencho.dev. It contains none of bencho's code or assets.