WRAPCODERS

AI Motion Visual Orb

AI chats

About

Parametric 3D canvas orb that renders harmonic ribbon waves and audio-reactive motion for AI assistant interfaces.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds AI Motion Visual Orb to your project and fits it to your theme.

Code

How AI Motion Visual Orb is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { useState, useEffect } from "react";
import {
  AIMotionVisual,
  type AIMotionState,
  type AIMotionColorPreset,
} from "@/components/ui/ai-motion-visual";
import { Mic, MicOff, Sparkles, RotateCcw, Activity } from "lucide-react";

export default function AIMotionVisualDemo() {
  const [state, setState] = useState<AIMotionState>("idle");
  const [colorPreset, setColorPreset] = useState<AIMotionColorPreset>("cosmic");
  const [speed, setSpeed] = useState<number>(1.0);
  const [intensity, setIntensity] = useState<number>(1.0);
  const [isMicActive, setIsMicActive] = useState<boolean>(false);
  const [audioLevel, setAudioLevel] = useState<number>(0);

  useEffect(() => {
    let animId: number;
    if (isMicActive || state === "speaking" || state === "listening") {
      let t = 0;
      const tick = () => {
        t += 0.08;
        const simulated = Math.max(
          0,
          Math.sin(t * 1.8) * 0.44 + Math.sin(t * 3.6) * 0.34 + (Math.random() - 0.5) * 0.16
        );
        setAudioLevel(simulated);
        animId = requestAnimationFrame(tick);
      };
      animId = requestAnimationFrame(tick);
    } else {
      setAudioLevel(0);
    }
    return () => cancelAnimationFrame(animId);
  }, [isMicActive, state]);

  const presets: { id: AIMotionColorPreset; label: string }[] = [
    { id: "cosmic", label: "Cosmic" },
    { id: "aurora", label: "Aurora" },
    { id: "solaris", label: "Solaris" },
    { id: "electric", label: "Electric" },
    { id: "monochrome", label: "Mono" },
  ];

  const states: { id: AIMotionState; label: string }[] = [
    { id: "idle", label: "Idle" },
    { id: "listening", label: "Listening" },
    { id: "thinking", label: "Thinking" },
    { id: "speaking", label: "Speaking" },
  ];

  return (
    <div className="flex min-h-screen w-full items-center justify-center p-4 sm:p-6 lg:p-8 bg-background text-foreground selection:bg-neutral-900 selection:text-white dark:selection:bg-white dark:selection:text-black">
      <div className="w-full max-w-2xl rounded-2xl border border-border bg-card p-6 shadow-2xl shadow-black/5 dark:shadow-black/50">
        {/* Header */}
        <div className="flex items-center justify-between pb-4 border-b border-border">
          <div className="flex items-center gap-3">
            <div className="flex h-8 w-8 items-center justify-center rounded-xl bg-primary/10 text-primary border border-primary/20">
              <Sparkles className="h-4 w-4" />
            </div>
            <div>
              <h2 className="text-sm font-semibold tracking-tight text-card-foreground">
                AI Motion Visual Orb
              </h2>
              <p className="text-xs text-muted-foreground">
                Parametric 3D harmonic ribbon visualizer
              </p>
            </div>
          </div>

          <div className="flex items-center gap-2">
            <span
              className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium border ${
                state === "speaking"
                  ? "border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"
                  : state === "listening"
                  ? "border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400"
                  : state === "thinking"
                  ? "border-indigo-500/30 bg-indigo-500/10 text-indigo-600 dark:text-indigo-400"
                  : "border-border bg-muted text-muted-foreground"
              }`}
            >
              <span
                className={`h-1.5 w-1.5 rounded-full ${
                  state === "speaking"
                    ? "bg-emerald-500 animate-pulse"
                    : state === "listening"
                    ? "bg-amber-500 animate-pulse"
                    : state === "thinking"
                    ? "bg-indigo-500 animate-ping"
                    : "bg-muted-foreground"
                }`}
              />
              <span className="capitalize">{state}</span>
            </span>
          </div>
        </div>

        {/* Central Orb Stage */}
        <div className="relative my-4 flex items-center justify-center rounded-xl border border-neutral-800/80 bg-neutral-950 p-4 sm:p-6 overflow-hidden">
          <AIMotionVisual
            state={state}
            colorPreset={colorPreset}
            speed={speed}
            intensity={intensity}
            audioLevel={audioLevel}
            size={400}
            interactive={true}
            glow={true}
            showGlassSphere={true}
          />

          {/* Activity Tag */}
          <div className="absolute bottom-3 left-4 flex items-center gap-2 text-xs font-mono text-neutral-500">
            <Activity className="h-3.5 w-3.5 text-indigo-400" />
            <span>60 FPS</span>
            <span>|</span>
            <span>Parametric Mesh</span>
          </div>
        </div>

        {/* Controls Deck */}
        <div className="space-y-4">
          {/* State Mode Selection */}
          <div className="space-y-1.5">
            <label className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
              Operational State
            </label>
            <div className="grid grid-cols-4 gap-1.5 rounded-xl border border-border bg-muted/50 p-1">
              {states.map((s) => (
                <button
                  key={s.id}
                  onClick={() => {
                    setState(s.id);
                    if (s.id === "listening" || s.id === "speaking") {
                      setIsMicActive(true);
                    } else {
                      setIsMicActive(false);
                    }
                  }}
                  className={`rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors ${
                    state === s.id
                      ? "bg-card text-foreground shadow-sm"
                      : "text-muted-foreground hover:text-foreground"
                  }`}
                >
                  {s.label}
                </button>
              ))}
            </div>
          </div>

          {/* Palette Selector */}
          <div className="space-y-1.5">
            <label className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
              Color Palette
            </label>
            <div className="flex flex-wrap gap-1.5">
              {presets.map((p) => (
                <button
                  key={p.id}
                  onClick={() => setColorPreset(p.id)}
                  className={`rounded-lg px-3 py-1 text-xs font-medium border transition-colors ${
                    colorPreset === p.id
                      ? "border-primary bg-primary/10 text-primary"
                      : "border-border bg-card text-muted-foreground hover:text-foreground hover:bg-muted/50"
                  }`}
                >
                  {p.label}
                </button>
              ))}
            </div>
          </div>

          {/* Sliders */}
          <div className="grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1">
            <div className="space-y-1.5 rounded-xl border border-border bg-card/60 p-3">
              <div className="flex items-center justify-between text-xs font-medium">
                <span className="text-muted-foreground">Speed multiplier</span>
                <span className="text-foreground tabular-nums font-mono">
                  {speed.toFixed(1)}x
                </span>
              </div>
              <input
                type="range"
                min="0.2"
                max="2.5"
                step="0.1"
                value={speed}
                onChange={(e) => setSpeed(parseFloat(e.target.value))}
                className="w-full accent-primary h-1.5 bg-muted rounded-lg cursor-pointer"
              />
            </div>

            <div className="space-y-1.5 rounded-xl border border-border bg-card/60 p-3">
              <div className="flex items-center justify-between text-xs font-medium">
                <span className="text-muted-foreground">Wave amplitude</span>
                <span className="text-foreground tabular-nums font-mono">
                  {intensity.toFixed(1)}x
                </span>
              </div>
              <input
                type="range"
                min="0.4"
                max="2.0"
                step="0.1"
                value={intensity}
                onChange={(e) => setIntensity(parseFloat(e.target.value))}
                className="w-full accent-primary h-1.5 bg-muted rounded-lg cursor-pointer"
              />
            </div>
          </div>

          {/* Action Footer */}
          <div className="flex items-center justify-between pt-2">
            <button
              onClick={() => {
                setIsMicActive(!isMicActive);
                if (!isMicActive) {
                  setState("listening");
                } else {
                  setState("idle");
                }
              }}
              className={`inline-flex items-center gap-2 rounded-xl border px-3.5 py-2 text-xs font-medium transition-colors ${
                isMicActive
                  ? "border-primary bg-primary text-primary-foreground shadow-sm"
                  : "border-border bg-card text-foreground hover:bg-muted"
              }`}
            >
              {isMicActive ? (
                <>
                  <Mic className="h-3.5 w-3.5" />
                  <span>Microphone Active</span>
                </>
              ) : (
                <>
                  <MicOff className="h-3.5 w-3.5 text-muted-foreground" />
                  <span>Simulate Voice Pulse</span>
                </>
              )}
            </button>

            <button
              onClick={() => {
                setSpeed(1.0);
                setIntensity(1.0);
                setState("idle");
                setColorPreset("cosmic");
                setIsMicActive(false);
              }}
              className="inline-flex items-center gap-1.5 rounded-xl border border-border bg-card px-3 py-2 text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"
            >
              <RotateCcw className="h-3.5 w-3.5" />
              <span>Reset</span>
            </button>
          </div>
        </div>
      </div>
    </div>
  );
}

Dependencies

More by WRAPCODERS

View all
  • Metric Trend Chart

    Metric Trend Chart

    31
  • Real Estate 3D Hero

    Real Estate 3D Hero

    29
  • Product Hover Showcase

    Product Hover Showcase

    6
  • Portfolio Projects Showcase

    Portfolio Projects Showcase

    5
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    3
  • Executive Pricing Plan

    Executive Pricing Plan

    2
  • Minimal Pricing Plan

    Minimal Pricing Plan

    2
  • Interactive 3D Hero Header

    Interactive 3D Hero Header

    2

More in AI chats

View all
  • AI Actions

    AI Actions

    353
  • AI Artifact

    AI Artifact

    13
  • Aquarium Prompt

    Aquarium Prompt

    117
  • AI Suggestions

    AI Suggestions

    21
  • Agent Chat

    Agent Chat

    21
  • Research Report

    Research Report

    7
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    62
  • Tool Web Fetch

    Tool Web Fetch

    5

Explore more

Part of Components — browse the full library on 21st.dev.