import { useState, useEffect, useCallback } from 'react'; import { Loader2, Sliders, RefreshCw, Download, Plus, Preset, Save, Trash2, Edit2 } from 'lucide-react'; export default function HolographicShapes() { const [shapes, setShapes] = useState([]); const [isLoading, setIsLoading] = useState(false); const [complexity, setComplexity] = useState(5); const [animationSpeed, setAnimationSpeed] = useState(1); const [showCustomModal, setShowCustomModal] = useState(false); const [customShape, setCustomShape] = useState({ type: 'circle', size: 30, color: '#00ff00', position: { x: 50, y: 50 }, rotation: 0 }); const [savedPresets, setSavedPresets] = useState([]); const [activePreset, setActivePreset] = useState(null); const [blurEffect, setBlurEffect] = useState(5); const [audioEnabled, setAudioEnabled] = useState(false); const [audio] = useState(new Audio('https://cdn.sitebrew.ai/sounds/ambient.mp3')); // Replace with actual ambient sound URL const presetEffects = { cyberpunk: { colors: ['#ff00ff', '#00ffff', '#ff0000'], blur: 8, speed: 1.5 }, ethereal: { colors: ['#4facfe', '#00f2fe', '#a8edea'], blur: 3, speed: 0.8 }, neon: { colors: ['#ff0000', '#00ff00', '#0000ff'], blur: 6, speed: 1.2 } }; const generateShapes = useCallback(async () => { setIsLoading(true); try { const response = await fetch('https://www.sitebrew.ai/api/genai', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ messages: [ { role: "system", content: "Generate holographic shapes with advanced properties including glow effects and movement patterns" }, { role: "user", content: `Generate ${complexity} shapes with ${activePreset || 'default'} style` } ] }) }); const data = await response.json(); const newShapes = JSON.parse(data.message.content); setShapes(newShapes); } catch (error) { console.error('Error:', error); } finally { setIsLoading(false); } }, [complexity, activePreset]); const savePreset = async () => { try { await fetch(`https://www.sitebrew.ai/api/dpfdMW/presets`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ document: { shapes, complexity, animationSpeed, blurEffect } }) }); loadPresets(); } catch (error) { console.error('Error saving preset:', error); } }; const loadPresets = async () => { try { const response = await fetch(`https://www.sitebrew.ai/api/dpfdMW/presets`); const data = await response.json(); setSavedPresets(data.document || []); } catch (error) { console.error('Error loading presets:', error); } }; const addCustomShape = () => { setShapes([...shapes, customShape]); setShowCustomModal(false); }; const toggleAudio = () => { if (audioEnabled) { audio.pause(); } else { audio.loop = true; audio.play(); } setAudioEnabled(!audioEnabled); }; useEffect(() => { generateShapes(); loadPresets(); return () => audio.pause(); }, [generateShapes]); return (

Holographic Shape Generator

Create mesmerizing holographic animations with AI

{/* Control Panel */}
{/* Main Controls */}
setComplexity(parseInt(e.target.value))} className="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer" />
{complexity}
setAnimationSpeed(parseFloat(e.target.value))} className="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer" />
{animationSpeed}x
setBlurEffect(parseInt(e.target.value))} className="w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer" />
{blurEffect}px
{/* Preset Controls */}

Preset Effects

{Object.keys(presetEffects).map((preset) => ( ))}
{/* Action Buttons */}
{/* Main Display */}
{shapes.map((shape, index) => (
))}
{/* Custom Shape Modal */} {showCustomModal && (

Create Custom Shape

setCustomShape({...customShape, size: parseInt(e.target.value)})} className="w-full" />
setCustomShape({...customShape, color: e.target.value})} className="w-full h-10 rounded-lg" />
)}
); }