Build a Random Team Picker That Splits Names Into Fair Groups in One HTML File
You get a single-file team picker: paste names, choose a team count or team size, watch an animated shuffle deal everyone into evenly sized teams, then reshuffle with one key.
The prompt
Act as a senior front-end developer and product designer who builds small, polished browser tools.
Build Fair Squads, a random team picker for teachers, coaches and meeting hosts. The user pastes a list of names, one per line or comma separated, picks how to split them, and the page deals everyone into balanced teams with a short animated shuffle.
Rules:
1. Layout: a settings panel with a large text area prefilled with 18 realistic sample names, a live name count, a segmented control for 'Number of teams' or 'People per team', and a stepper from 1 to 20. Beside it, a responsive grid of team cards. Stack to one column under 760px wide.
2. Fairness: shuffle with Fisher-Yates, then deal round-robin so team sizes never differ by more than one. Ignore blank lines and trim spaces. Show a summary line such as '18 names, 4 teams, sizes 4 to 5'.
3. Animation: names flicker through random entries, then settle one by one with a small pop. Under prefers-reduced-motion, show results instantly.
4. Controls: a Shuffle button, R or Space to reshuffle when not typing, Ctrl+Enter inside the text area, plus and minus keys to change the number.
5. Style: warm off-white background, dark ink text, one blue accent, each team card with its own colored top border and a short name like Team Ember.
6. Sound: soft Web Audio ticks as names settle, created on first interaction, with a visible mute toggle. Announce results in an aria-live region.
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
- Naming Fisher-Yates plus round-robin dealing guarantees fair, evenly sized teams instead of a vague 'random groups' request.
- Spelling out both split modes and the stepper range keeps the UI predictable and stops the model from inventing extra settings.
- Sample names, key shortcuts and reduced-motion rules mean the file looks finished and works for everyone on first open.
Paste into ChatGPT, Claude or Gemini. Save the reply's code as fair-squads.html and open it in any browser, or run it in the chat's preview or canvas panel. Replace the sample names with your own list.
Common edits
- Change the team nicknames and border colors to match your school houses or club colors.
- Add a 'lock captain' option so the first name in each line block is always spread across different teams.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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 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 Restaurant Tip and Bill Splitter With Uneven Shares in One HTML File
A ready-to-paste prompt that builds a bill splitter where diners pay for what they ordered, tax and tip are shared fairly, totals round neatly, and every cent adds up.
Build a Strong Password Generator with Strength Meter in One HTML File
You get a single HTML file that makes cryptographically random passwords, with toggles for character sets, an entropy-based strength meter and one-click copy.
Build an Instant Two-Way Unit Converter With Kitchen Measurements in HTML
A prompt that produces a single-file unit converter for length, weight, temperature, volume and cooking that updates both directions as you type, including cups-to-grams by ingredient.
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.