Wheel Spinner / Random Name Picker
Enter a list of names or options, hit Spin, and let the wheel decide. Share the wheel via URL or remove the winner and spin again for the next round.
How It Works
The wheel is drawn on an HTML5 Canvas element. Each entry gets an equal-sized segment calculated as 2π / numberOfEntries radians. Segments are filled with a cycling palette of distinct colours, and labels are drawn using canvas text with a transform to rotate each label to the centre of its segment.
When you click Spin, a random target angle is calculated: target = currentAngle + (5 to 10 full rotations) + random segment offset. The animation uses requestAnimationFrame with an ease-out deceleration — the angular velocity starts high and is multiplied by a friction factor (≈ 0.98) each frame until the wheel crawls to a stop at the target angle. The winner is the segment sitting at the top of the wheel (the 12 o'clock position) when the animation ends.
For sharing, the entry list is URL-encoded as a comma-separated query parameter. Anyone with the link sees the same wheel preloaded and ready to spin.
Frequently Asked Questions
Is the spin truly random?
Yes. The target angle includes a random number of full rotations plus a random offset within a segment, generated with Math.random(). Every entry has an equal probability of winning since segments are equal in size.
How do I add or change names?
Edit the text area on the left — one name or item per line. The wheel redraws automatically as you type. Blank lines are ignored.
Can I remove the winner and spin again?
Yes. After a spin, a "Remove winner" button appears. Clicking it removes the winning entry from the list and redraws the wheel so you can spin again for the next selection.
How do I share my wheel with others?
Click "Share link" to copy a URL that encodes your current list. Anyone opening that link will see the same entries preloaded in the wheel.