swarm-page-builder

JavaScriptTypeScriptNext.jsShadow DOMSVGWeb Audio APIClaude Code Skillmodels.dev API
swarm-page-builder preview

overview.

Adapted from Joel Califa's Swarm motion design and Dhvanil Patel's swarm-cursors snapshot architecture, packaged for Next.js (App Router and Pages), Astro, Vite, and plain HTML sites. Before first paint, a CSS cover hides the raw page while keeping real DOM nodes at opacity 1 so captureModel() can read exact computed styles. The engine walks the DOM and compiles visible nodes into five layer types inside an isolated Shadow root: rects (fills, radii, shadows, backdrop blur), text layers (cloned with computed typography), pen-tool lines (dashed dividers and single-side borders), media crops, and repeated sibling groups (master plus Alt-dragged duplicates with red spacing badges).

Each cursor pulls its model badge and brand color from models.dev via a 24-hour cached route handler (Claude Opus 5.5, GPT-6.1 Terra, Gemini 4 Argon, DeepSeek V4 Pro, Grok 4.7, Qwen3.8 Max) and runs a generator script per task: crosshair-dragging boxes with live W x H readouts, typing text character-by-character with an I-beam caret as headings step up from 18px, snapping text onto Figma ruler guides, and playing synthesized Web Audio mechanical keystrokes and E-major pentatonic glass-piano notes panned to each cursor's X coordinate. Auto-tour scrolls down with the active frontier, pauses Lenis and halts the tour when the user scrolls up, resumes on scroll-down, and dissolves into the live interactive page once built.

key features.

  • One-command Claude Code skill (npx skills add TejasLamba2006/swarm-page-builder) with drop-in templates for Next.js, Astro, Vite, and vanilla HTML
  • Compiles live DOM trees into 500+ blueprint layers: crosshair rects, I-beam typed text, pen-tool borders, Figma ruler guides, and Alt-dragged sibling duplicates
  • Live LLM cursor roster from models.dev with synthesized Web Audio mechanical keystrokes and E-major pentatonic notes
  • Zero-flash first-paint CSS cover, auto-tour with scroll-up pause and scroll-down resume, Lenis smooth-scroll handoff, and per-route sessionStorage memory