import React, { useEffect, useRef } from 'react'; import { useDesktopStore } from '@/stores/desktopStore'; import { NebulaBackground } from '@/components/nebula/NebulaBackground'; import { VaultDoor } from '@/sections/VaultDoor'; import { ProjectNexus } from '@/sections/ProjectNexus'; import { Dock } from '@/components/dock/Dock'; import { ProductionHub } from '@/components/apps/ProductionHub'; import { AssetVault } from '@/components/apps/AssetVault'; import { EngineRoom } from '@/components/apps/EngineRoom'; import { UserControl } from '@/components/user/UserControl'; import { SystemPreferencesWindow } from '@/components/settings/SystemPreferencesWindow'; import { useSettingsStore } from '@/stores/settingsStore'; function App() { const { currentStage } = useDesktopStore(); const initializeSettings = useSettingsStore((state) => state.initializeSettings); const appRef = useRef(null); useEffect(() => { const root = appRef.current; if (!root) return; const maxShift = 16; let targetX = 0; let targetY = 0; let currentX = 0; let currentY = 0; let rafId = 0; const onMouseMove = (e: MouseEvent) => { const nx = e.clientX / window.innerWidth - 0.5; const ny = e.clientY / window.innerHeight - 0.5; targetX = nx * maxShift; targetY = ny * maxShift; }; const onMouseLeave = () => { targetX = 0; targetY = 0; }; const tick = () => { currentX += (targetX - currentX) * 0.08; currentY += (targetY - currentY) * 0.08; root.style.setProperty('--parallax-x', `${currentX.toFixed(2)}px`); root.style.setProperty('--parallax-y', `${currentY.toFixed(2)}px`); rafId = requestAnimationFrame(tick); }; window.addEventListener('mousemove', onMouseMove); window.addEventListener('mouseleave', onMouseLeave); rafId = requestAnimationFrame(tick); return () => { window.removeEventListener('mousemove', onMouseMove); window.removeEventListener('mouseleave', onMouseLeave); cancelAnimationFrame(rafId); }; }, []); useEffect(() => { initializeSettings(); }, [initializeSettings]); return (
{/* Nebula Background - Always visible */} {/* Noise Overlay */}
{/* Stage 1: Vault Door */} {currentStage === 'vault' && } {/* Stage 2: Project Nexus */} {currentStage === 'nexus' && } {/* Stage 3: Astral Workspace */} {currentStage === 'workspace' && } {/* Global Settings Modal */}
); } // Workspace Component (Stage 3) const Workspace: React.FC = () => { return (
{/* Status Bar */} {/* App Windows */} {/* The Dock */}
); }; // Status Bar Component const StatusBar: React.FC = () => { const { selectedProject, setStage } = useDesktopStore(); return (
{/* Left - Project Name */}
{selectedProject && ( <> / {selectedProject.name} )}
{/* Right - User Control */}
); }; export default App;