Build an Isometric Voxel Island Day-Night Scene on Canvas

Get one offline HTML file that draws an isometric voxel island on plain canvas, runs a day-night cycle where lights switch on at dusk, and turns in 90-degree steps.

Text prompt for Claude and ChatGPT

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

The prompt

Prompt
You are a creative front-end developer. Build Lanternfall Isle: an isometric voxel island diorama in one HTML file, drawn with the plain 2D canvas API only (no Three.js, no WebGL, no libraries, no CDN, no images).

The island sits on a 14x14 heightmap ringed by sea: sand beaches, stepped grass hills, a stone path, three small houses with windows, trees, lamp posts and a red-and-white lighthouse. Draw every voxel as three shaded faces sorted back to front so overlaps stay correct.

Rules:
1. Day-night cycle of about 40 seconds: the sky gradient, sea and face shading change through dawn, day, dusk and night, with a sun, a moon and night stars.
2. At dusk, the windows, lamps and lighthouse switch on with a soft radial glow, and they switch off at dawn.
3. Drag left or right (mouse or touch), arrow keys or two buttons turn the island in 90-degree steps with an eased turn.
4. A Pause/Play button (Space also works) freezes the clock; a readout shows the phase and time, e.g. Dusk 18:50.
5. prefers-reduced-motion: rotation snaps, no shimmer or twinkle, and the clock starts paused at dusk with the lights on.
6. Fit the canvas to the window with devicePixelRatio; show a title and a controls legend.

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)
Lanternfall Isle at a glanceA voxel island that lives through a day
Day length
40 seconds
Morning sun to dusk
Rotation
90-degree steps
Drag, arrow keys or buttons
Lights at dusk
3 kinds
Windows, lamp posts, lighthouse

Example: Lanternfall Isle, a voxel island that lives through a day.

The island opens in the morning sun and runs a 40-second day. Watch the sky turn orange at dusk, when the house windows, lamp posts and lighthouse light up and stars appear. Drag sideways, press the arrow keys or use the rotate buttons to turn the island in 90-degree steps. Press Pause or Space to freeze the hour, for example at 18:50.

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

Tips and common edits

Why this works

  • Plain 2D canvas with three shaded faces per voxel and back-to-front sorting gives a real 3D look with no Three.js, so it runs in any sandboxed preview.
  • One time value drives the sky, shading, stars and light switch, so pausing at any hour shows a coherent scene.
  • Rotating in 90-degree steps keeps the isometric angle exact, so faces line up and the drag gesture never feels mushy.

Paste into Claude and it renders as a live artifact preview on any plan; ChatGPT or Gemini canvas also work. Or save the code as an .html file and open it in a browser. No Three.js or internet needed.

Common edits

  • Swap the island for a snowy village or a desert oasis by changing the heightmap rows and the palette.
  • Shorten the cycle to 20 seconds, or add rain voxels and a wind sound made with the Web Audio API and a mute toggle.

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

Animations & Effects

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.

Animations & Effects

Build an Interactive Double-Pendulum Chaos Visualizer in HTML

Create a single-file HTML5 Canvas double-pendulum simulator with RK4 physics, draggable bobs, gravity presets, trail controls, and a twin-pendulum divergence mode.

Animations & Effects

Build an Interactive Flocking Boids Physics Playground in HTML

A ready-to-use prompt that generates a self-contained HTML5 canvas boids simulation with real-time flocking sliders, cursor attract/scatter modes, and live telemetry.

Animations & Effects

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.

Animations & Effects

Build an Interactive Particle Network Background in HTML

You get one HTML file with a full-screen canvas particle network that links nearby dots, follows mouse or touch, and has density, color and low-power controls.

Animations & Effects

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.