diff --git a/src/src/App.tsx b/src/src/App.tsx deleted file mode 100644 index 9e5aa24..0000000 --- a/src/src/App.tsx +++ /dev/null @@ -1,151 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { Play, Puzzle, Settings, ChevronDown, User, LogOut, Check } from 'lucide-react' -import { launcherService, type GameVersion } from './services/LauncherService' -import { clsx, type ClassValue } from 'clsx' -import { twMerge } from 'tailwind-merge' - -// Utility for merging tailwind classes -function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} - -// Components -import PlaySection from './components/PlaySection' -import ModsSection from './components/ModsSection' -import SettingsSection from './components/SettingsSection' - -type Section = 'play' | 'mods' | 'settings' - -const App: React.FC = () => { - const [activeSection, setActiveSection] = useState
('play') - const [versions, setVersions] = useState([]) - const [selectedVersion, setSelectedVersion] = useState(null) - const [isVersionDropdownOpen, setIsVersionDropdownOpen] = useState(false) - const [isAccountDropdownOpen, setIsAccountDropdownOpen] = useState(false) - - useEffect(() => { - const fetchVersions = async () => { - const v = await launcherService.getVersions() - setVersions(v) - if (v.length > 0) setSelectedVersion(v[0]) - } - fetchVersions() - }, []) - - return ( -
- {/* Sidebar */} - - - {/* Main Content Area */} -
- {/* Top Bar */} -
- {/* Version Selector */} -
- - - {isVersionDropdownOpen && ( -
- {versions.map(v => ( - - ))} -
- )} -
- - {/* Account Display */} -
- - - {isAccountDropdownOpen && ( -
-
-

SaturnDev

-

dev@saturnclient.com

-
- - -
- )} -
-
- - {/* Content Sections */} -
- {activeSection === 'play' && selectedVersion && } - {activeSection === 'mods' && selectedVersion && } - {activeSection === 'settings' && } -
-
-
- ) -} - -export default App diff --git a/src/src/components/ModsSection.tsx b/src/src/components/ModsSection.tsx deleted file mode 100644 index 4404353..0000000 --- a/src/src/components/ModsSection.tsx +++ /dev/null @@ -1,236 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { Search, Download, Trash2, ExternalLink, Package, Filter, CheckCircle2, XCircle, ChevronRight, X } from 'lucide-react' -import { launcherService, type Mod, type GameVersion } from '../services/LauncherService' -import { clsx, type ClassValue } from 'clsx' -import { twMerge } from 'tailwind-merge' -import { motion, AnimatePresence } from 'framer-motion' - -function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) -} - -interface ModsSectionProps { - version: GameVersion -} - -const ModsSection: React.FC = ({ version }) => { - const [activeTab, setActiveTab] = useState<'installed' | 'discover'>('installed') - const [searchQuery, setSearchQuery] = useState('') - const [mods, setMods] = useState([]) - const [isInstallDialogOpen, setIsInstallDialogOpen] = useState(false) - const [selectedModForInstall, setSelectedModForInstall] = useState(null) - const [selectedVersionsForInstall, setSelectedVersionsForInstall] = useState([]) - const [allVersions, setAllVersions] = useState([]) - - useEffect(() => { - const loadMods = async () => { - if (activeTab === 'installed') { - const m = await launcherService.getInstalledMods(version.id) - setMods(m) - } else { - const m = await launcherService.discoverMods(searchQuery) - setMods(m) - } - } - loadMods() - }, [activeTab, version.id, searchQuery]) - - useEffect(() => { - const loadAllVersions = async () => { - const v = await launcherService.getVersions() - setAllVersions(v) - } - loadAllVersions() - }, []) - - const handleToggleMod = async (modId: string) => { - await launcherService.toggleMod(modId) - const m = await launcherService.getInstalledMods(version.id) - setMods(m) - } - - const openInstallDialog = (mod: Mod) => { - setSelectedModForInstall(mod) - setSelectedVersionsForInstall([version.id]) - setIsInstallDialogOpen(true) - } - - const handleInstall = async () => { - if (selectedModForInstall && selectedVersionsForInstall.length > 0) { - await launcherService.installMod(selectedModForInstall, selectedVersionsForInstall) - setIsInstallDialogOpen(false) - if (activeTab === 'installed') { - const m = await launcherService.getInstalledMods(version.id) - setMods(m) - } - } - } - - const toggleVersionSelection = (versionId: string) => { - setSelectedVersionsForInstall(prev => - prev.includes(versionId) - ? prev.filter(v => v !== versionId) - : [...prev, versionId] - ) - } - - return ( -
-
-
- - -
- -
- - setSearchQuery(e.target.value)} - className="bg-saturn-panel border border-saturn-border rounded-lg pl-10 pr-4 py-2 text-sm w-64 focus:outline-none focus:border-saturn-accent/50 focus:ring-1 focus:ring-saturn-accent/50 transition-all" - /> -
-
- -
-
- {mods.map(mod => ( - -
- -
- -
-
-

{mod.name}

- v{mod.version} - by {mod.author} -
-

{mod.description}

-
- -
- {activeTab === 'installed' ? ( - <> - - - - ) : ( - - )} -
-
- ))} - - {mods.length === 0 && ( -
- -

No mods found.

-
- )} -
-
- - {/* Install Dialog */} - - {isInstallDialogOpen && selectedModForInstall && ( -
- -
-
-

Install {selectedModForInstall.name}

-

Select versions to install this mod to.

-
- -
- -
- {allVersions.map(v => { - const isSupported = selectedModForInstall.supportedVersions.includes(v.id) - const isSelected = selectedVersionsForInstall.includes(v.id) - - return ( -
isSupported && toggleVersionSelection(v.id)} - className={cn( - "flex items-center justify-between p-3 rounded-lg border transition-all cursor-pointer", - isSelected ? "bg-saturn-accent/10 border-saturn-accent/50" : "bg-white/5 border-transparent hover:border-white/10", - !isSupported && "opacity-40 cursor-not-allowed grayscale" - )} - > -
-
- {isSelected && } -
- {v.name} -
- {!isSupported && Unsupported} -
- ) - })} -
- -
- - -
-
-
- )} -
-
- ) -} - -export default ModsSection diff --git a/src/src/components/PlaySection.tsx b/src/src/components/PlaySection.tsx deleted file mode 100644 index b0109fe..0000000 --- a/src/src/components/PlaySection.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import React, { useState } from 'react' -import { Play, Loader2, Info, ExternalLink } from 'lucide-react' -import { launcherService, type GameVersion } from '../services/LauncherService' -import { motion } from 'framer-motion' - -interface PlaySectionProps { - version: GameVersion -} - -const PlaySection: React.FC = ({ version }) => { - const [isLaunching, setIsLaunching] = useState(false) - const [launchStatus, setLaunchStatus] = useState('') - - const handleLaunch = async () => { - setIsLaunching(true) - setLaunchStatus('Preparing...') - - // Simulate launch steps - setTimeout(() => setLaunchStatus('Verifying assets...'), 500) - setTimeout(() => setLaunchStatus('Applying Saturn optimizations...'), 1200) - - const result = await launcherService.launchGame(version.id) - - if (result.success) { - setLaunchStatus('Game running') - // In a real app, we might minimize or close the launcher here - } - - setTimeout(() => { - setIsLaunching(false) - setLaunchStatus('') - }, 3000) - } - - return ( -
- -

- SATURN -

-

- Fabric-Only Optimization Client -

-
- -
-
-
- -
-
-

Instance

-

Saturn Default

-
-
- -
-
- -
-
-

Current Version

-

{version.name}

-
-
- -
-
- -
-
-

Modloader

-

Fabric Loader

-
-
-
- -
-
- -
- -
-

Saturn Client is not affiliated with Mojang AB. Use at your own risk. Performance may vary based on hardware.

-
-
- ) -} - -export default PlaySection diff --git a/src/src/components/SettingsSection.tsx b/src/src/components/SettingsSection.tsx deleted file mode 100644 index 7cb865c..0000000 --- a/src/src/components/SettingsSection.tsx +++ /dev/null @@ -1,156 +0,0 @@ -import React, { useState, useEffect } from 'react' -import { Cpu, MemoryStick, Save, RefreshCcw, Info, AlertTriangle } from 'lucide-react' -import { launcherService, type LauncherSettings } from '../services/LauncherService' -import { motion } from 'framer-motion' - -const SettingsSection: React.FC = () => { - const [settings, setSettings] = useState(null) - const [isSaving, setIsSaving] = useState(false) - const [saveStatus, setSaveStatus] = useState('') - - useEffect(() => { - const loadSettings = async () => { - const s = await launcherService.getSettings() - setSettings(s) - } - loadSettings() - }, []) - - const handleSave = async () => { - if (!settings) return - setIsSaving(true) - setSaveStatus('Saving...') - - await launcherService.updateSettings(settings) - - setTimeout(() => { - setIsSaving(false) - setSaveStatus('Settings saved') - setTimeout(() => setSaveStatus(''), 2000) - }, 1000) - } - - const handleReset = async () => { - // In a real app, this would reset to defaults in the service - const defaultSettings: LauncherSettings = { - jvmArguments: '-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200', - maxMemory: 4096, - } - setSettings(defaultSettings) - } - - if (!settings) return null - - return ( -
-
-
-

Performance Settings

-

Configure how Saturn Client interacts with your hardware.

-
-
- - -
-
- -
- {/* Memory Allocation */} - -
-
- -
-

Memory Allocation

-
- -
-
- Maximum Memory (RAM) - {(settings.maxMemory / 1024).toFixed(1)} GB -
- - setSettings({ ...settings, maxMemory: parseInt(e.target.value) })} - className="w-full h-2 bg-saturn-border rounded-lg appearance-none cursor-pointer accent-saturn-accent" - /> - -
- 1 GB - 4 GB - 8 GB - 12 GB - 16 GB -
- -
- -

- Allocating too much memory can cause system instability, while too little can lead to performance issues or crashes. 4GB - 8GB is recommended for most users. -

-
-
-
- - {/* JVM Arguments */} - -
-
- -
-

Custom JVM Arguments

-
- -
-

- Advanced flags for the Java Virtual Machine. Saturn Client includes optimized defaults, but you can override them here. -

- -