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

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

One HTML file. Save it and open it in any browser.Open full screen

Example: Fair Squads, a random team picker that deals names into balanced groups.

The page loads with 18 sample names already split into teams. Paste your own list (lines or commas), switch between Number of teams and People per team, and set the number with the stepper or the + / − keys. Press Shuffle, R or Space to watch names flicker and settle into new teams. Sizes never differ by more than one. Use the speaker button to mute the ticks.

Written by AI from this prompt. Your results will vary.

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 in Mini Apps & Tools