I'll build an immersive funhouse mirror experience — WebGL-powered real-time distortion shaders (stretch, squeeze, wave, bulge, twist, pixelate), smooth param morphing between modes, ornate SVG mirror frames, and a full carnival stage backdrop. Let me first inspect the project setup.
Tailwind v4 with the Vite plugin. Let me check the current CSS and HTML entry, then install icons.
Now I'll build the app. Starting with the design foundation — fonts, theme tokens, and custom animations in the CSS:
UI foundation done. Now the heart of the app — the WebGL distortion engine with all the shaders, plus the animated demo-face source used when the camera is off:
Minor fix — removing the unused variable:
Now the ornate mirror frames — four SVG frame styles (Gilded, Marquee, Neon, Deco) that adapt to arch or oval glass shapes:
Now the mirror stage component — canvas, render loop with smoothed parameter morphing, cursor lens tracking, and glass overlays:
Now the carnival backdrop — curtains, swaying spotlight beams, floating dust, and giant outlined typography:
Now the control panels — distortion mode toggles, sliders, photo strip, frame atelier, trick levers:
Now the main App — state orchestration, auto-morph engine, camera handling, keyboard shortcuts, header/footer, and toasts:
Updating the HTML title/meta, then building:
Build passed. Let me fix two refinements: the footer marquee needs a single animated wrapper for a seamless loop, the toast close should use a Lucide icon, and I'll add a roundRect polyfill for older browsers:
Rebuilding to confirm everything compiles after the fixes:
The Funhouse Mirror Parlor is complete and builds cleanly. Here's what's inside:
The Mirror (WebGL engine — src/lib/mirror.ts)
- 6 real-time distortion shaders: Stretch (tall/thin carnival warp), Squeeze, Wave (jelly glass with energy-driven speed), Bulge (fisheye), Twist (swirl), and Pixelate — all running on the GPU at 60fps
- Buttery morphing: every parameter eases toward its target with exponential damping each frame, so switching or blending modes never snaps
- Stackable modes: presets blend together, breeding hybrid freaks; plus chromatic aberration, vignette, film grain, and silver-mirror color grading baked into the shader
- Cursor lens: hovering the glass pushes a magnifying fingertip bulge that follows your pointer
- Demo dummy: with no camera, an animated clown face (blinking eyes that track your cursor, bobbing grin, juggling balls) stands in — fully private by default; webcam is opt-in via "Step Into the Glass"
The Frames (src/components/Frames.tsx)
Four hand-built SVG frames in arch or oval shape: Gilded baroque with pearl beading and crown ornament, Marquee with CSS-chased light bulbs, Neon with flickering pink/cyan tubes, and Deco with emerald beads and a sunburst fan — each animates in on swap.
The Experience
- Auto-Morph autopilot: the mirror shapeshifts on its own every ~3 seconds (with occasional "breather" beats)
- SNAP IT! photo booth: flash effect, PNG download, and a 4-shot photo strip that remembers your best mugs
- Carnival stage backdrop: swaying spotlight beams, velvet curtains, floating dust, giant outlined "STEP RIGHT UP" typography, animated film grain
- Cabinet-style control panels with screws, gold sliders (Intensity/Energy), frame swatches, a scrolling marquee ticker, toast notifications, and full keyboard control (1–6 modes, M auto-morph, R chaos toss, S snap, C camera, F frames, O shape)
Files built: src/index.css, src/lib/mirror.ts, src/components/Frames.tsx, src/components/FunhouseMirror.tsx, src/components/Backdrop.tsx, src/components/Controls.tsx, src/App.tsx, index.html