Prank website that uses your microphone to detect physical smacks on the laptop, then plays moaning sounds with animated robot face reactions.
Live at moantop.xyz
- React 19 + TanStack Start (SSR via Nitro)
- TanStack Router (file-based)
- Tailwind CSS 4 + HeroUI v3
- GSAP (robot face animations)
- Web Audio API (mic input, sound playback)
- Vite 7, TypeScript, Bun
- User grants microphone access
- FFT analyser monitors low-frequency energy spikes (physical impacts vs voice)
- On detected smack: plays randomized moan/speech audio, triggers GSAP animation on the robot face
- Gender toggle switches between male/female sound banks
- Streak system alternates between moans and speeches to keep it varied
src/
components/
MoanMac.tsx # Core app: mic detection, audio playback, UI
RobotFace.tsx # SVG robot face with GSAP hit animations
ErrorPage.tsx # Error boundary UI
NotFoundPage.tsx # 404 page
routes/
__root.tsx # Root layout, meta tags, structured data
index.tsx # Home page with SEO/OG tags
providers/ # Theme, Lenis smooth scroll
env.ts # Type-safe env vars (t3-env)
config.ts # App config, social links
public/
assets/sounds/ # Audio files (male/, female/)
og.png # Open Graph image for social sharing
manifest.json # PWA manifest
cp .env.example .env
bun install
bun devDev server runs on port 3200.
| Variable | Required | Description |
|---|---|---|
VITE_APP_NAME |
No | App display name |
VITE_APP_URL |
No | App base URL |
VITE_DEBUG |
No | Set "true" to show debug overlay (mic levels, hit logs) |
VITE_API_URL |
No | Backend API URL (unused currently) |
VITE_API_KEY |
No | API key (unused currently) |
All env vars are optional. The app runs with zero config.
bun dev # Dev server (port 3200)
bun build # Production build
bun preview # Preview production build
bun lint # ESLint
bun check # Prettier + ESLint fix
bun test # VitestPush to main. Nitro auto-detects the Vercel environment and outputs the correct format. No vercel.json needed.
Build output goes to .output/.
Sound banks live in public/assets/sounds/{female,male}/. Each gender has:
moan-1.mp3throughmoan-3.mp3speech-1.mp3throughspeech-N.mp3
To add sounds, drop mp3 files in the right folder and update the SOUND_BANK constant in MoanMac.tsx.
Key constants in MoanMac.tsx:
SPIKE_FACTOR(2): how many times above running average triggers a hitMIN_THRESHOLD(30): absolute floor so silence doesn't false-triggerVOICE_RATIO(1.2): mid-freq to low-freq ratio to filter out voiceSMACK_COOLDOWN(350ms): minimum gap between triggers