Build a Spin-the-Wheel Random Decision Maker With Editable Options in HTML
You get one HTML file with a canvas spin wheel. Edit your own options, spin with an eased animation, and hear the result announced, with an instant pick when reduced motion is on.
The prompt
Act as a senior front-end developer who builds polished, accessible micro-tools.
Build Lucky Dial, a spin-the-wheel random decision maker. Each option the user types becomes a colored slice on a canvas wheel, and a spin picks one at random.
Rules:
1. Layout: the wheel has a fixed top pointer and a large Spin button. Beside it, an options panel lets the user rename inline, add (Enter key or an Add button) and remove, keeping 2 to 16 options. The panel also has a Shuffle button, four realistic preset sets and a list of the last 5 picks. Use one column below 760px.
2. Spin: choose the winner first, then animate for about 4 seconds with a quartic ease-out so the pointer lands inside that slice. Trigger it with the button, a click or tap on the wheel, or Space. Lock editing during the spin, then outline the winning slice.
3. Announce "Spinning" and the result in an aria-live status region. Show visible focus rings and readable label contrast on every slice color.
4. With prefers-reduced-motion, skip the animation, show the pick instantly and say so in a short note.
5. Play Web Audio ticks as slices pass the pointer and a soft chime on the result. Create the AudioContext on first interaction, keep it quiet and add a mute toggle.
6. Keep it crisp on high-DPI screens and resizing with the window. Use no external assets, storage or alerts.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- Choosing the winner before animating guarantees the pointer always lands on the announced slice, with no rounding mismatches.
- An aria-live status region plus a reduced-motion instant pick make the tool usable without watching the spin.
- A fixed 2-16 option range and preset sets keep the wheel legible and give the page real content on first load.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as lucky-dial.html and open it in any browser, or run it in the chat's preview or canvas panel.
Common edits
- Swap the slice palette and preset lists for a classroom name picker, a team standup order or a dinner chooser.
- Make the spin longer or shorter by changing the duration, or add a 'remove winner after spin' checkbox for no-repeat draws.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a BMI and Daily Calorie Calculator with Metric and Imperial Units in HTML
A prompt that makes an AI build Steady Scale, a single-file BMI and calorie calculator using Mifflin-St Jeor, activity levels, unit switching and plain-language ranges.
Build a Countdown Timer to Any Date With a Confetti Finish in One HTML File
Get a polished single-file countdown page with a custom event title, a large days-hours-minutes-seconds display and a confetti-and-chime celebration at zero.
Build a HIIT and Tabata Interval Workout Timer in a Single HTML File
A self-contained interval timer with adjustable work, rest and rounds, color-coded phases, synthesized countdown beeps and a tap-anywhere pause, all in one HTML file.
Build a Keyboard-Friendly To-Do Checklist with Priorities and Filters in One HTML File
A ready-to-paste prompt that makes an AI build a single-file to-do checklist where you can add, reorder, prioritize, filter and export tasks as plain text, all with keyboard shortcuts.
Build a Live Word and Character Counter with Reading Time in One HTML File
A single-file text counter showing live words, characters, sentences, paragraphs, reading and speaking time, and color-coded progress bars for common post length limits.
Build a Loan and Mortgage Calculator with Amortization Table in One HTML File
Get a polished, offline loan and mortgage calculator that shows monthly payment, total interest, an SVG balance chart, extra-payment savings and a full amortization schedule.