diff --git a/src/lib/userSettings.ts b/src/lib/userSettings.ts index ed9dd88..6ebbcf3 100644 --- a/src/lib/userSettings.ts +++ b/src/lib/userSettings.ts @@ -5,3 +5,4 @@ export const userSettings = writable(new Config()); export const customCursor = writable(true); export const cursorSmoothening = writable(true); +export const reduceAnimations = writable(false); diff --git a/src/pages/Launch.svelte b/src/pages/Launch.svelte index f27ea48..963d691 100644 --- a/src/pages/Launch.svelte +++ b/src/pages/Launch.svelte @@ -25,7 +25,7 @@ import { fade, fly, scale } from 'svelte/transition'; import { Checkbox } from '@/components/ui/checkbox'; import Label from '@/components/ui/label/label.svelte'; - import { cursorSmoothening, customCursor, userSettings } from '@/userSettings'; + import { cursorSmoothening, customCursor, reduceAnimations, userSettings } from '@/userSettings'; let selectedTab = $state('settings'); let launching = $state(false); @@ -139,7 +139,7 @@ {#if selectedTab === 'home'}
- + {#if $reduceAnimations} + {numberHumanReadable($beatmap_sets ?? 0)} + {:else} + + {/if}
Beatmap Sets imported
@@ -235,7 +239,11 @@ ? 'opacity-0' : 'opacity-100'} transition-opacity duration-1000" > - + {#if $reduceAnimations} + {$server_ping}ms + {:else} + + {/if}
Ping to Server
@@ -256,7 +264,7 @@
@@ -282,7 +290,7 @@ {:else if selectedTab === 'settings'}
EZPPLauncher Settings @@ -327,6 +335,23 @@ disabled={!$customCursor} class="flex items-center justify-center w-5 h-5" > + +
+ +
+ Disables some animations in the Launcher to improve performance on low-end devices. +
+
+ { + reduceAnimations.set(e); + $userSettings.save(); + }} + disabled={!$customCursor} + class="flex items-center justify-center w-5 h-5" + >
{/if} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 6cd7169..d3a97b3 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,7 +4,7 @@ import { setupValues } from '@/global'; import { onMount } from 'svelte'; import OsuCursor from '@/components/ui/osu-cursor/OsuCursor.svelte'; - import { cursorSmoothening, customCursor, userSettings } from '@/userSettings'; + import { cursorSmoothening, customCursor, reduceAnimations, userSettings } from '@/userSettings'; import { Buffer } from 'buffer'; let { children } = $props(); @@ -15,14 +15,15 @@ const config_custom_cursor = $userSettings.value('custom_cursor'); const config_cursor_smoothening = $userSettings.value('cursor_smoothening'); - - console.log("yes", config_cursor_smoothening.get(true)) + const config_reduce_animations = $userSettings.value('reduce_animations'); customCursor.set(config_custom_cursor.get(true)); cursorSmoothening.set(config_cursor_smoothening.get(true)); + reduceAnimations.set(config_reduce_animations.get(false)); customCursor.subscribe((val) => config_custom_cursor.set(val)); cursorSmoothening.subscribe((val) => config_cursor_smoothening.set(val)); + reduceAnimations.subscribe((val) => config_reduce_animations.set(val)); });