Build a New Year's Eve Countdown Clock with World Time Zones and Party Mode in HTML

You get one HTML file with a big countdown to midnight in any time zone, a live list of cities already in the new year, and a full-screen party mode for a TV.

Text prompt for ChatGPT and Claude

The prompt

Prompt
Act as a senior front-end developer who builds polished, offline-ready event tools. Build "Midnight Line", a New Year's Eve countdown clock for a party shown on a TV or projector. It counts down to the next 1 January 00:00 in a selected time zone. The default is the browser's own zone from Intl.DateTimeFormat().resolvedOptions().timeZone, and a select offers about 24 IANA zones from Pacific/Kiritimati to Pacific/Pago_Pago. Rules:
1. Compute midnight in any zone with the built-in Intl API only (formatToParts offsets), with no libraries or network calls. Show the target year dynamically and never hard-code it.
2. Show big days, hours, minutes and seconds with a self-correcting timer. Add a live 'Who is already in the new year' list of 20 world cities, sorted by when they reach midnight. Each city shows its local time and either 'Celebrating' with a check mark or a countdown such as 'in 3 h 20 m'.
3. A Party mode button (also the F key) calls requestFullscreen with a CSS full-window fallback. It hides everything except the giant countdown, the year and a subtle animated background. Escape leaves party mode.
4. In the final 10 seconds, show one huge pulsing number. At zero, fire a canvas fireworks burst and show 'Happy New Year' with the year. Skip big motion under prefers-reduced-motion.
5. A 'Test the finale' button simulates the last 15 seconds. A visible mute toggle controls a soft Web Audio chime; create the AudioContext on the first click or key press only.
6. Use system fonts and light and dark themes, with visible focus and full keyboard use. The page must fit 360-1280px wide and use no storage, alerts or forms.
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 (opens in a new tab)

Example: Midnight Line, a time-zone-aware New Year's Eve countdown for the big screen.

The page opens counting down to midnight in your own time zone, with a live list of 20 cities sorted from Kiritimati to Honolulu. Press Test the finale to watch the last 15 seconds: pulsing numbers, a chime and fireworks. Press Party mode or F for the projector view, and Esc to leave. Change the zone to Tokyo or New York and the target updates.

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

Tips and common edits

Why this works

  • Midnight is computed from Intl formatToParts offsets, so any IANA zone works offline with no date library or network call.
  • The timer re-aligns to each real second, so the display never drifts on a long party night.
  • The finale test, fullscreen fallback and first-click AudioContext let hosts rehearse safely before midnight.

Paste into Claude and open the result as an artifact; it runs in the artifact panel and can be published or shared from there. You can also use ChatGPT canvas or Gemini Canvas, or save the code as an .html file and open it in any browser, which also works offline.

Common edits

  • Count down to a different event, such as Lunar New Year, by changing the midnight(year) target to that date and renaming the headings.
  • Add your party's name and a custom message under the year in party mode, for example 'Rooftop at Maple Street, see you in the new year'.

Reuse it: Use in a workflowTurn into a skillAdapt in the builder

Event Planning

Build an Interactive Event Seating Chart Planner in One HTML File

A drag-and-drop and click-to-seat event planner with round and rectangular tables, live seat counters, and automatic conflict flags.

Event Planning

Christmas Eve Traditions for Families and a Calm Morning Plan

A list of 8-10 Christmas Eve and Christmas morning traditions with ages, time and cost, a timed plan around your youngest child's bedtime, and calm gift-opening tips.

Event Planning

Holiday Party Games for Mixed Ages With No Drinking

You get 6 inclusive holiday party games in a table with opt-out roles, full rules for the best 3, and a 60-minute run order for your group.

Event Planning

Plan a Holiday Houseguest Stay: Rooms, Meals, Quiet Time

You get a sleeping and bathroom plan, a day-by-day table with cooks and quiet time, a chore rota, a pre-arrival checklist and a short welcome note for guests.

Event Planning

Plan cocktail hour appetizers per person and serving times

Get how many appetizers to plan per guest for a 60- to 90-minute cocktail hour (or a cocktail-only party), a minute-by-minute schedule of when each bite goes out, and bar and station layout rules.

Event Planning

Draft a casual dinner party invite with dietary checks

Generate three friendly dinner party invitation templates that clearly state arrival times, BYOB preferences, and dietary requirements.