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.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
You are a senior front-end developer who designs calm, high-contrast fitness tools. Build Ember Intervals, a HIIT and Tabata interval timer in a single HTML file. The user sets work seconds, rest seconds and rounds, presses Start, and the timer runs a 5-second get-ready, then alternating work and rest phases, skipping the rest after the final round.

Rules:
1. Setup panel with plus and minus stepper buttons for work (5-600 s), rest (0-300 s) and rounds (1-50), three presets (Tabata 20/10 x8, HIIT 40/20 x10, Endurance 60/30 x6) and a live total duration.
2. Color-code every phase: amber get-ready, coral work, teal rest, violet done. Tint the page background and an SVG progress ring to match, and show a color legend.
3. While running, show a huge countdown, round counter, next-phase preview and total time left. Tapping or clicking anywhere pauses and resumes; also add Pause, Skip and Reset buttons.
4. Keyboard: Space pauses, S skips, R resets, M mutes. Announce phase changes in an aria-live region.
5. Web Audio beeps only: short ticks on the last 3 seconds, distinct tones for work, rest and finish. Create the AudioContext on first input, keep volume low, show a visible mute toggle.
6. Use performance.now for accurate timing. No external files, storage or forms; responsive from 360 to 1280px; honor prefers-reduced-motion.

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: Ember Intervals, a color-coded HIIT and Tabata timer.

Pick a preset or use the + and − steppers to set work, rest and rounds, then press Start workout. The page turns amber for get-ready, coral for work and teal for rest, and a ring drains as each phase runs. Tap anywhere or press Space to pause. Try S to skip, R to reset and M to mute. Beeps tick down the last three seconds.

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

Tips and common edits

Why this works

  • Building the phase list up front (prep, work, rest… final work) makes skip, rounds and total-time-left simple and bug-free.
  • Elapsed time from performance.now keeps the countdown accurate even if the tab throttles timers.
  • Tap-anywhere pause plus large color-coded phases makes it usable mid-workout from across the room.

Paste into ChatGPT, Claude or Gemini. Save the reply's code as ember-intervals.html and open it in any browser, or run it in the chat's preview or canvas. Keep the tab visible while training.

Common edits

  • Change the presets or the get-ready length, for example a 10-second prep and an EMOM 50/10 x12 option.
  • Swap the palette and beep pitches, or add a spoken-style cue by layering a second oscillator on work starts.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Mini Apps & Tools