From eed52135e7d6ffbbbd64070cf567bcf08653c7d5 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Wed, 14 Jan 2026 18:15:31 +0800 Subject: feat: Enhance UI components and add visual effects - Updated Sidebar component styles for improved aesthetics and usability. - Refactored VersionsView component with a new layout and enhanced version filtering. - Improved DownloadMonitor and GameConsole components for better performance and visual consistency. - Added new settings for GPU acceleration and visual effects in settings store. - Introduced ParticleBackground component with customizable effects (Constellation and Saturn). - Implemented ConstellationEffect and SaturnEffect classes for dynamic background animations. --- src-tauri/src/core/config.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src-tauri/src/core/config.rs') diff --git a/src-tauri/src/core/config.rs b/src-tauri/src/core/config.rs index d6d594f..27e0011 100644 --- a/src-tauri/src/core/config.rs +++ b/src-tauri/src/core/config.rs @@ -13,6 +13,10 @@ pub struct LauncherConfig { pub width: u32, pub height: u32, pub download_threads: u32, // concurrent download threads (1-128) + pub custom_background_path: Option, + pub enable_gpu_acceleration: bool, + pub enable_visual_effects: bool, + pub active_effect: String, } impl Default for LauncherConfig { @@ -24,6 +28,10 @@ impl Default for LauncherConfig { width: 854, height: 480, download_threads: 32, + custom_background_path: None, + enable_gpu_acceleration: false, + enable_visual_effects: true, + active_effect: "constellation".to_string(), } } } -- cgit v1.2.3-70-g09d2 From 74849ad2d18586736d9677dfd10af4875f4ef2ca Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Wed, 14 Jan 2026 18:40:01 +0800 Subject: feat: enhance dark mode support across UI components - Updated BottomBar, HomeView, LoginModal, ModLoaderSelector, SettingsView, Sidebar, StatusToast, and VersionsView components for improved dark mode styling. - Adjusted color schemes for various elements to ensure better visibility and aesthetics in dark mode. - Added a theme property to settings to enforce dark mode as the default. - Refactored version badges in VersionsView for better color differentiation. - Enhanced button and input styles for consistency in both light and dark themes. --- assets/image.jpg | Bin 172906 -> 161028 bytes src-tauri/src/core/config.rs | 2 + src-tauri/src/main.rs | 4 -- src-tauri/tauri.conf.json | 4 +- ui/src/App.svelte | 39 +++++++++++++------ ui/src/components/BottomBar.svelte | 20 +++++----- ui/src/components/HomeView.svelte | 10 ++--- ui/src/components/LoginModal.svelte | 30 +++++++-------- ui/src/components/ModLoaderSelector.svelte | 40 +++++++++---------- ui/src/components/SettingsView.svelte | 60 ++++++++++++++++++++--------- ui/src/components/Sidebar.svelte | 8 ++-- ui/src/components/StatusToast.svelte | 10 ++--- ui/src/components/VersionsView.svelte | 48 +++++++++++------------ ui/src/stores/settings.svelte.ts | 6 +++ ui/src/types/index.ts | 1 + 15 files changed, 163 insertions(+), 119 deletions(-) (limited to 'src-tauri/src/core/config.rs') diff --git a/assets/image.jpg b/assets/image.jpg index 28cffe1..ddda96f 100644 Binary files a/assets/image.jpg and b/assets/image.jpg differ diff --git a/src-tauri/src/core/config.rs b/src-tauri/src/core/config.rs index 27e0011..510b126 100644 --- a/src-tauri/src/core/config.rs +++ b/src-tauri/src/core/config.rs @@ -17,6 +17,7 @@ pub struct LauncherConfig { pub enable_gpu_acceleration: bool, pub enable_visual_effects: bool, pub active_effect: String, + pub theme: String, } impl Default for LauncherConfig { @@ -32,6 +33,7 @@ impl Default for LauncherConfig { enable_gpu_acceleration: false, enable_visual_effects: true, active_effect: "constellation".to_string(), + theme: "dark".to_string(), } } } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f7a391a..8a955a5 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -854,8 +854,6 @@ async fn get_recommended_java( Ok(core::java::get_recommended_java(required_major_version)) } -// ==================== Fabric Loader Commands ==================== - /// Get Minecraft versions supported by Fabric #[tauri::command] async fn get_fabric_game_versions() -> Result, String> { @@ -949,8 +947,6 @@ async fn is_fabric_installed( )) } -// ==================== Forge Loader Commands ==================== - /// Get Minecraft versions supported by Forge #[tauri::command] async fn get_forge_game_versions() -> Result, String> { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 9145e1b..682acb0 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -14,8 +14,8 @@ "title": "Minecraft DropOut Launcher", "width": 1024, "height": 768, - "minWidth": 800, - "minHeight": 600, + "minWidth": 905, + "minHeight": 575, "resizable": true } ], diff --git a/ui/src/App.svelte b/ui/src/App.svelte index d93374e..2160b85 100644 --- a/ui/src/App.svelte +++ b/ui/src/App.svelte @@ -31,12 +31,22 @@ onMount(async () => { authState.checkAccount(); - settingsState.loadSettings(); + await settingsState.loadSettings(); gameState.loadVersions(); getVersion().then((v) => (uiState.appVersion = v)); window.addEventListener("mousemove", handleMouseMove); }); + $effect(() => { + if (settingsState.settings.theme === 'light') { + document.documentElement.classList.remove('dark'); + document.documentElement.setAttribute('data-theme', 'light'); + } else { + document.documentElement.classList.add('dark'); + document.documentElement.setAttribute('data-theme', 'dark'); + } + }); + onDestroy(() => { if (typeof window !== 'undefined') window.removeEventListener("mousemove", handleMouseMove); @@ -44,10 +54,10 @@
-
+
{#if settingsState.settings.custom_background_path}
{:else if settingsState.settings.enable_visual_effects} - -
+ + {#if settingsState.settings.theme === 'dark'} +
+ {:else} + +
+ {/if} {#if uiState.currentView === "home"} {/if}
{/if} -
+
-
+
diff --git a/ui/src/components/BottomBar.svelte b/ui/src/components/BottomBar.svelte index dd218f3..0178111 100644 --- a/ui/src/components/BottomBar.svelte +++ b/ui/src/components/BottomBar.svelte @@ -5,7 +5,7 @@
@@ -17,7 +17,7 @@ onkeydown={(e) => e.key === "Enter" && authState.openLoginModal()} >
{#if authState.currentAccount}
-
+
{authState.currentAccount ? authState.currentAccount.username : "Login"}
-
+
{authState.currentAccount ? "Ready to play" : "Guest Mode"}
-
+
@@ -28,7 +28,7 @@
@@ -61,12 +61,12 @@ type="text" bind:value={authState.offlineUsername} placeholder="Offline Username" - class="w-full bg-zinc-950 border border-zinc-700 rounded p-3 text-white focus:border-indigo-500 outline-none" + class="w-full bg-gray-50 border-zinc-200 dark:bg-zinc-950 dark:border-zinc-700 rounded p-3 text-gray-900 dark:text-white focus:border-indigo-500 outline-none" onkeydown={(e) => e.key === "Enter" && authState.performOfflineLogin()} /> @@ -80,18 +80,18 @@
{:else if authState.deviceCodeData}
-

1. Go to this URL:

+

1. Go to this URL:

-

2. Enter this code:

+

2. Enter this code:

e.key === 'Enter' && navigator.clipboard.writeText(authState.deviceCodeData?.user_code || "")} @@ -106,8 +106,8 @@
-
- {authState.msLoginStatus} +
+ {authState.msLoginStatus}

This window will update automatically.

diff --git a/ui/src/components/ModLoaderSelector.svelte b/ui/src/components/ModLoaderSelector.svelte index 4a59916..fd26382 100644 --- a/ui/src/components/ModLoaderSelector.svelte +++ b/ui/src/components/ModLoaderSelector.svelte @@ -114,16 +114,16 @@
-

Select Mod Loader

+

Select Mod Loader

-
+
@@ -81,39 +81,39 @@ {/if}
-

+

Select an image from your computer to replace the default gradient background. Supported formats: PNG, JPG, WEBP, GIF.

-
+
-

Visual Effects

-

Enable particle effects and animated gradients. (Default: On)

+

Visual Effects

+

Enable particle effects and animated gradients. (Default: On)

{#if settingsState.settings.enable_visual_effects} -
+
-

Theme Effect

-

Select the active visual theme.

+

Theme Effect

+

Select the active visual theme.

-
+
{#each ['all', 'release', 'snapshot', 'modded'] as filter}