Snow Globe Village

A snow globe that really rocks on its base: the snow swirls, sinks and piles up on the glowing roofs, and three hard shakes crack the glass so the village ends up under open-air snowfall.

Worlds

Built by Claude Opus 5.5$8.50 · 54m27s

Loading world…

Goal & tips

Goal Make the village cozy: light every window, the bonfire and the tree, build three snowmen, gather the skaters, start the train and play the music box.

Try this
  • Drag the globe gently and watch the snow settle on the roofs
  • Tap (2) the houses, the church, the bonfire, the tree and the skaters
  • Tap the ground three times (3) to build a snowman
  • Wind the key on the base for a carol. Three very hard shakes crack the glass

Keys 1–3 Shake, Tap, BuildB big shakeW music boxT trainC Cinema

Secret Something flies past the moon at night. Who saw it?
Show hint (spoiler)

Get the Cozy meter to 100%, then set Time of day to night and wait a little: a reindeer sleigh crosses the moon with a jingle.

Remix in Claude

The prompt

Build "Snow Globe Village", a playable miniature world: a glass snow globe on a carved wooden base with a tiny winter village inside, where shaking it makes the snow swirl and settle, as ONE self-contained HTML file.

It must be **beautiful above everything**, like a premium animated film: a cozy, glowing holiday miniature with thick glass, warm windows and soft, dreamy snow. Great animation on everything that moves: nothing pops, snaps or teleports; things grow, ease, overshoot a little and settle. Calm and satisfying to play, spectacular to watch.

## Tech

* three.js r170 with WebGPURenderer (automatic WebGL2 fallback). Load it with an importmap from jsDelivr: map "three", "three/webgpu" and "three/tsl" to `three@0.170.0/build/three.webgpu.min.js`, and "three/addons/" to `three@0.170.0/examples/jsm/`.
* Use TSL node materials, OrbitControls from the addons, and a subtle BloomNode pass (strength ~0.4, threshold ~1.5) so only emissive things glow (lit windows, the bonfire, string lights, the moon, the shooting star).
* No external assets. Every texture is drawn on a canvas or generated as pixel data at startup. Every sound is synthesized with WebAudio. The only network requests are three.js from jsDelivr and the Fredoka font from Google Fonts; if the font fails to load, fall back to a system rounded sans-serif without breaking anything.
* Start the HTML with `<!doctype html>` and `<meta charset="utf-8">`.
* It must run inside a sandboxed iframe (`sandbox="allow-scripts allow-pointer-lock"`, no `allow-same-origin`). There, `localStorage` and cookies throw a SecurityError: wrap every storage access in `try/catch` and keep values in memory instead. Do not use `alert`, pop-ups or top-level navigation.
* Neutral tone mapping, soft 2048 shadow map (1024 on phones).
* Known three r170 pitfalls, avoid them:
   * the scene background is drawn after transparent objects, so draw the sky/backdrop as a mesh (or give transparent sky objects `depthWrite: true`), or they disappear;
   * never `.clone()` a CanvasTexture (the clone uploads black); create separate textures or use DataTexture;
   * never let a helper overwrite a shared temp vector that its caller is still using.
* The simulation runs on a fixed 60 Hz timestep and is frame-rate independent. At low frame rates, drop simulation time instead of exploding.
* A quality scaler lowers the pixel ratio, then particle counts, when frames get slow.
* Respect prefers-reduced-motion: softer shake, slower camera moves.

## Priorities

Build in this order and finish each tier properly before the next. A polished tier 1 beats a broken everything.

1. **Must be excellent:** the globe (glass, refraction, water, base), the shake with snow swirling in fluid and settling, snow piling on roofs and trees, lit windows at night, the demo mode.
2. **Must work:** the village life (skaters, train, chimney smoke, bonfire, snowmen), the music box, the cozy meter and milestones, day/night, sound, the card UI, camera.
3. **Polish:** the cracked-glass event, the shooting star, carol singers, the tree lights, the church bell.

Never ship a feature half-working: if a tier-3 feature can't be done well, leave it out cleanly.

## The globe

* A large **glass sphere** (thick, clear, with refraction of the backdrop, sharp highlights, Fresnel reflections and a faint caustic on the base) on a **carved wooden base** with a brass ring, a small plaque and a **wind-up key** on the side. Soft studio backdrop (deep blue gradient with bokeh lights) and a soft contact shadow.
* Inside: a small round **winter village** on a snowy hill: 6–8 cottages with steep roofs and chimneys, a little church with a bell tower, pine trees, a lamp-lit square with a Christmas tree, a frozen pond with 3 skaters, and a tiny train looping around the hill on a track.
* The globe is filled with water (very subtle tint and refraction), so snow moves like it is in liquid.

## Snow physics

* **Thousands of snow particles** (instanced flakes of different sizes, some sparkly) in a simple fluid field inside the sphere: shaking injects velocity and **swirls** (curl noise + vortices), drag slows them, and they **sink slowly** and **settle**.
* **Accumulation:** surfaces (roofs, ground, trees, the train, snowmen) have a snow height map; landed flakes add to it, so **snow piles up** visibly on roofs and branches; steep roofs shed snow in little slides. A big shake lifts settled snow back into the water.
* Flakes never pass through the glass (collide with the sphere) or through buildings.

## Shaking and interaction

* **Shake:** drag on the globe (or flick) to shake it: the whole globe **rocks on its base** with spring physics, the water sloshes, the snow swirls in the direction of the shake. A gentle drag makes a light flurry; a hard flick makes a blizzard.
* Tap things:
   * a **house** turns its lights on or off, and the chimney smokes;
   * the **train** starts or stops (it toots);
   * the **church** rings its bell;
   * the **bonfire** in the square lights;
   * the **skaters** do a spin.
* **Snowman:** in Build mode, tap the ground three times to roll a snowman (base, middle, head with a carrot nose and scarf). Up to 3.
* **Music box:** drag the wind-up key on the base around a few times: a synthesized carol plays like a real music box (slowing down as it unwinds), and the village **turntable slowly rotates** while it plays.

## Day and night

* **Time slider:** day (bright, soft blue sky through the glass), dusk (pink), night (deep blue, a moon and stars on the backdrop). At night windows glow warm, street lamps and the tree lights glow, the skaters' pond reflects them.
* A **shooting star** crosses the backdrop now and then at night; tapping it makes a wish sparkle.

## The big moment

* Shake too hard three times in a short time (or press the hidden "Too hard" combo of three max-strength flicks): a **crack** spreads across the glass with a sharp sound, water and snow **spill out in slow motion**, the glass falls away in a few large shards, and the village now sits **in open air** under a gentle real snowfall. A toast says "Oops." Reset restores the globe (the glass reassembles in reverse).

## Goal and milestones

* **Cozy** meter (0–100%): every window lit, the bonfire lit, the tree lit, 3 snowmen, the skaters gathered, the train running, the music box played once.
* At 100%: the church bell rings, everyone gathers in the square, fireworks pop softly above the village (inside the globe), and the snow falls slower and sparkles.

Milestones (toasts, once each): "First shake", "Snow on the roofs", "All aboard", "First snowman", "Lights on", "Music box", "Blizzard!", "Oops", "Cozy village".

## Easter egg

At night, if the cozy meter is 100%, a tiny **reindeer sleigh silhouette** crosses in front of the moon with a jingle. Never hint at it in the UI.

## Interface

A light, playful UI that never covers the world. On phones the card becomes a compact bottom sheet.

* Top left:
   * small caps "POKEABLE · WORLD";
   * a big chunky rounded heading on two lines, "Snow" / "Globe", in Fredoka from Google Fonts, light on the dark backdrop, with a tiny snowflake drifting down from the "o";
   * caption "Shake it gently. Or don't.".
* Top right: a live status dot with "WEBGPU · LIVE" (or "WEBGL2 · LIVE"), a speaker pill button (ON / MUTED), and "PAUSED" when paused.
* Right card "Village": about 240 px wide, off-white, 20 px corners, soft shadow, no hairlines, warm red (#e05a4f) accent, collapsible to a small pill. Contents:
   * a big animated "Cozy" % with a bar, and small icons for windows, bonfire, tree, snowmen, train, music box
   * tool picker: Shake, Tap, Build (snowman), each with a drawn icon and its key number
   * event buttons: Big shake, Music box, Train
   * sliders with monospace value chips: Time of day, Snow amount, Shake strength, Sound (master volume)
   * switches: Village life (on), Glass reflections (on), Slow motion (¼ speed), Cinema
   * buttons Reset and New (random seed), a dark full-width Pause/Resume pill, and the world's number ("No. 0001").
* Bottom left: a one-line hint that changes with the tool:
   * Shake: "Drag to shake the globe. Gently."
   * Tap: "Tap houses, the train, the church, the bonfire."
   * Build: "Tap the ground three times for a snowman."
* Bottom right: a collapsible "How it works" panel, 5–6 plain lines on the snow particles in water, how snow piles up on surfaces, the rocking globe spring, the music box, the camera controls, and synthesized sound.
* Toasts at the top centre for milestones and events.
* Keys: 1–3 tools, B big shake, W wind the music box, T train, Space pause, R reset, N new, M mute, S slow motion, C cinema, 0 reset view, Esc stop follow / exit cinema.

## Camera

* OrbitControls with damping and zoom to cursor, within sensible limits.
* Double-click the train or a skater to follow it; Esc or 0 stops.
* Camera bar (floating pill, bottom right of the scene area): zoom −, a zoom % readout, zoom +, rotate left, rotate right, reset; button moves tween smoothly.
* The default framing fits the whole world into the free area, accounting for the card and title.
* **Cinema (`C`):** hides all UI and slowly orbits the camera.

## Sound

* WebAudio only. Create the AudioContext on the first gesture and never before.
* Master gain feeds a compressor, so rapid actions never clip. Limit voices (about 16) and wrap every call in try/catch so a failing audio call never breaks the world.
* Loops: soft muffled ambience inside the glass, the train's gentle chug when running, a crackling bonfire, wind at heavy shakes.
* One-shots: a glassy water slosh on each shake (scaled by strength), tiny bells on the train toot, a church bell, a soft click for lights, a crunchy snowman roll, a sharp crack and spill for the broken glass, a jingle for the sleigh.
* The **music box**: a synthesized carol on a plucked comb timbre (short decaying sines with metallic overtones), tempo slowing as the spring unwinds.

## Demo mode (required)

If the URL has `?demo=1` (or `#demo`), auto-play a deterministic 4.0 s loop:

* Rules:
   * Hide all UI and the cursor; never create an AudioContext.
   * Fixed quality, default seed, night, the village lit, snow mostly settled, default camera, no OrbitControls.
   * Drive the simulation from real elapsed time with the fixed timestep, and restart from the identical state every 4.0 s.
   * Start moving within 1 s of load, and stay readable at 15 fps.
* Timeline:
   * 0.0–0.5 s: the globe sits still, windows glow, a few flakes drift.
   * 0.5–1.0 s: an invisible flick shakes the globe: it rocks on its base and the snow bursts up in a swirl.
   * 1.0–3.0 s: the snow swirls around the village and slowly sinks, catching the warm light.
   * 3.0–4.0 s: flakes settle on the roofs as the globe stops rocking.

## Before you finish, check

* Gentle and hard shakes, flicks in every direction; the globe rocks and settles; snow swirls, sinks and piles up on roofs, trees and snowmen, and never leaks through the glass.
* Every tappable thing, the snowmen, the train, the music box and the turntable.
* Day/night lighting, the shooting star, the cozy meter and celebration.
* The cracked-glass event and the reverse reset.
* Every tool, slider, switch, button and key; follow mode; Cinema; pause and resume; resizing to phone width.
* Sound behaviour.
* It works inside `<iframe sandbox="allow-scripts allow-pointer-lock">` with no errors (storage blocked).
* `?demo=1` matches the timeline.
* No console or WebGPU validation errors, and it stays smooth on a mid-range laptop.

Put the swirl and the slow settling snow on glowing roofs first. It should feel exactly like holding a real snow globe.

More worlds

All worlds →