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
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
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.
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 Pomodoro Focus Timer With SVG Progress Ring in One HTML File
A ready-to-paste prompt that builds a Pomodoro timer with focus, short and long break cycles, an SVG progress ring, a soft synthesized chime, keyboard shortcuts and a session counter.
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 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.