Build an Animated Dawn-to-Night Landscape Scene in a Single HTML File
You get one HTML file that draws a canvas valley village whose sky, sun, moon, stars, clouds and window lights all follow a single time-of-day scrubber with autoplay.
The prompt
Act as a senior front-end developer and illustrator who builds polished canvas scenes. Build "Lanternvale", a single-page animated landscape of a small valley village that cycles smoothly from dawn through noon, dusk and night. One time-of-day value from 0 to 24 hours drives everything, controlled by a range scrubber and an autoplay loop.
Rules:
1. Interpolate a three-stop sky gradient across at least 10 keyframes (deep night, pre-dawn, sunrise, morning, noon, golden hour, dusk) with smoothstep easing, so there are no visible jumps.
2. Move the sun and moon on opposite elliptical arcs that set behind four layered mountain ridges. Tint ridges, clouds and houses from night to day colors, and blend them toward the horizon color for haze.
3. Fade in twinkling stars as the sun drops. Light each house window at its own random threshold after dusk, and switch some off between 1 and 5 a.m.
4. Controls: Play/Pause button, a speed button (1x, 2x, 4x, where 1x is one day per minute), and jump buttons for Dawn, Noon, Dusk and Midnight. Space plays or pauses, arrow keys move 15 minutes (Shift moves an hour), and clicking the scene toggles play. Show the clock and phase name over the scene.
5. Respect prefers-reduced-motion: start paused, and turn off twinkle and cloud drift.
6. Make the canvas scale with devicePixelRatio and fit 360–1280px wide. Use no external assets, a dark control panel and readable contrast.
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
- One hour value drives every layer: sky, sun, moon, stars and windows, so the scrubber and autoplay can never drift out of sync.
- Smoothstep keyframe blending and haze toward the horizon color give smooth, painterly transitions with no external assets.
- Reduced-motion users start paused with still stars, but the scrubber and jump buttons still let them see the whole cycle.
Paste the prompt into ChatGPT, Claude or Gemini. Save the code as lanternvale.html and open it in any browser, or run it in the chat's preview or canvas panel.
Common edits
- Change the theme: swap the ridge and house colors for a snowy alpine town or a desert mesa, and rename the scene.
- Add sound: a soft Web Audio cricket chirp at night and birdsong tones at dawn, started on first click and with a mute toggle.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Parallax Starfield Night Sky Hero Section on Canvas in One HTML File
A prompt that produces a single HTML hero section with a three-layer canvas starfield, pointer and tilt parallax, shooting stars, a density slider and a calm mode.
Build a Click-to-Launch Fireworks Celebration Animation in One HTML File
A prompt that produces a single HTML page where clicks, taps or keys launch fireworks with gravity, fading trails, soft synthesized pops and a mute toggle.
Build an Animated Gradient Glitch Title Hero Header in One HTML File
A ready-to-paste prompt for a website hero header with a shifting gradient headline, a subtle glitch flicker, three switchable color presets and a reduced-motion fallback.
Build an Interactive Particle Network Background With Mouse and Touch Controls
A single HTML file with a full-screen canvas particle network that links nearby dots, reacts to mouse and touch, and has density, color and low-power controls.
Build a Confetti and Fireworks Celebration Effect in a Single HTML File
A ready-to-paste prompt that builds a reusable canvas confetti and fireworks layer with color theme presets, burst size control, Web Audio pops and automatic particle cleanup.
Build a Gallery of 12 Pure-CSS Loading Spinners with Copyable Code
You get a single HTML page showing 12 live CSS-only loaders, each with its own isolated CSS, a copy button, and a reduced-motion fallback that pulses gently instead of spinning.