'use client'; import { useRef, useMemo } from 'react'; import { Canvas, useFrame, useThree } from '@react-three/fiber'; import { Float } from '@react-three/drei'; import * as THREE from 'three'; function usePointerParallax(intensity = 0.35) { const { camera } = useThree(); const target = useRef({ x: 0, y: 0 }); useFrame((state) => { const px = state.pointer.x * intensity; const py = state.pointer.y * intensity * 0.6; target.current.x += (px - target.current.x) * 0.06; target.current.y += (py - target.current.y) * 0.06; camera.position.x = target.current.x; camera.position.y = target.current.y; camera.lookAt(0, 0, 0); }); } function IntelligenceCore() { const coreRef = useRef(null); const ringRef = useRef(null); useFrame((state) => { const t = state.clock.elapsedTime; if (coreRef.current) coreRef.current.rotation.y = t * 0.18; if (ringRef.current) { ringRef.current.rotation.x = Math.PI / 2.4; ringRef.current.rotation.z = t * 0.12; } }); return ( ); } function NeuralParticles() { const ref = useRef(null); const positions = useMemo(() => { const count = 48; const pts = new Float32Array(count * 3); for (let i = 0; i < count; i += 1) { const radius = 1.8 + Math.random() * 1.4; const theta = Math.random() * Math.PI * 2; const phi = Math.acos(2 * Math.random() - 1); pts[i * 3] = radius * Math.sin(phi) * Math.cos(theta); pts[i * 3 + 1] = radius * Math.sin(phi) * Math.sin(theta); pts[i * 3 + 2] = radius * Math.cos(phi); } return pts; }, []); useFrame((state) => { if (!ref.current) return; ref.current.rotation.y = state.clock.elapsedTime * 0.04; ref.current.rotation.x = Math.sin(state.clock.elapsedTime * 0.2) * 0.08; }); return ( ); } function WaveformRing() { const lineRef = useRef(null); const positions = useMemo(() => { const segments = 64; const arr = new Float32Array((segments + 1) * 3); for (let i = 0; i <= segments; i += 1) { const angle = (i / segments) * Math.PI * 2; arr[i * 3] = Math.cos(angle) * 2.1; arr[i * 3 + 1] = Math.sin(angle) * 2.1; arr[i * 3 + 2] = 0; } return arr; }, []); useFrame((state) => { if (!lineRef.current) return; const pos = lineRef.current.geometry.attributes.position; const t = state.clock.elapsedTime; for (let i = 0; i < pos.count; i += 1) { const angle = (i / pos.count) * Math.PI * 2; const wave = Math.sin(angle * 8 + t * 2.2) * 0.08; const r = 2.1 + wave; pos.setXYZ(i, Math.cos(angle) * r, Math.sin(angle) * r, Math.sin(angle * 4 + t) * 0.06); } pos.needsUpdate = true; lineRef.current.rotation.z = t * 0.05; }); return ( ); } function Scene() { usePointerParallax(0.4); return ( <> ); } export function AudioIntelligenceScene() { return ( ); }