diff --git a/bun.lock b/bun.lock index 8a4b1f0..4402bd4 100644 --- a/bun.lock +++ b/bun.lock @@ -21,6 +21,7 @@ "osu-classes": "3.1.0", "osu-parsers": "4.1.7", "radix-icons-svelte": "1.2.1", + "svelte-confetti": "^2.0.0", }, "devDependencies": { "@lucide/svelte": "^0.482.0", @@ -557,6 +558,8 @@ "svelte-check": ["svelte-check@4.2.2", "", { "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "chokidar": "^4.0.1", "fdir": "^6.2.0", "picocolors": "^1.0.0", "sade": "^1.7.4" }, "peerDependencies": { "svelte": "^4.0.0 || ^5.0.0-next.0", "typescript": ">=5.0.0" }, "bin": { "svelte-check": "bin/svelte-check" } }, "sha512-1+31EOYZ7NKN0YDMKusav2hhEoA51GD9Ws6o//0SphMT0ve9mBTsTUEX7OmDMadUP3KjNHsSKtJrqdSaD8CrGQ=="], + "svelte-confetti": ["svelte-confetti@2.3.1", "", { "peerDependencies": { "svelte": ">=5.0.0" } }, "sha512-bKd8etTOeBQyeS9LDPuSd7Oqy5msf0xvxItzsHPajKaarr/LWFzqPq7rp6QQO5rGTzLgM0fmjovOvLkRbrd2gg=="], + "svelte-toolbelt": ["svelte-toolbelt@0.7.1", "", { "dependencies": { "clsx": "^2.1.1", "runed": "^0.23.2", "style-to-object": "^1.0.8" }, "peerDependencies": { "svelte": "^5.0.0" } }, "sha512-HcBOcR17Vx9bjaOceUvxkY3nGmbBmCBBbuWLLEWO6jtmWH8f/QoWmbyUfQZrpDINH39en1b8mptfPQT9VKQ1xQ=="], "sync-child-process": ["sync-child-process@1.0.2", "", { "dependencies": { "sync-message-port": "^1.0.0" } }, "sha512-8lD+t2KrrScJ/7KXCSyfhT3/hRq78rC0wBFqNJXv3mZyn6hW2ypM05JmlSvtqRbeq6jqA94oHbxAr2vYsJ8vDA=="], diff --git a/package.json b/package.json index a7b172e..db4c054 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "lucide-svelte": "0.523.0", "osu-classes": "3.1.0", "osu-parsers": "4.1.7", - "radix-icons-svelte": "1.2.1" + "radix-icons-svelte": "1.2.1", + "svelte-confetti": "^2.0.0" }, "devDependencies": { "@lucide/svelte": "^0.482.0", diff --git a/src/lib/displayUtils.ts b/src/lib/displayUtils.ts new file mode 100644 index 0000000..4e84ed7 --- /dev/null +++ b/src/lib/displayUtils.ts @@ -0,0 +1,20 @@ +export function estimateRefreshRate(): Promise { + return new Promise((resolve) => { + let last = performance.now(); + let frames = 0; + + function loop() { + const now = performance.now(); + frames++; + + if (now - last >= 1000) { + console.log(`Estimated Refresh Rate: ${frames} FPS`); + resolve(frames); // estimated Hz + } else { + requestAnimationFrame(loop); + } + } + + requestAnimationFrame(loop); + }); +} diff --git a/src/lib/global.ts b/src/lib/global.ts index bdec845..5fc36ba 100644 --- a/src/lib/global.ts +++ b/src/lib/global.ts @@ -4,6 +4,7 @@ import type { Component } from 'svelte'; import Loading from '../pages/Loading.svelte'; export const current_view = writable(Loading); +export const first_startup = writable(false); export const server_ping = writable(undefined); export const server_connection_fails = writable(0); diff --git a/src/lib/userSettings.ts b/src/lib/userSettings.ts index 6ebbcf3..aad5757 100644 --- a/src/lib/userSettings.ts +++ b/src/lib/userSettings.ts @@ -1,8 +1,11 @@ import { writable } from 'svelte/store'; import { Config } from './config'; -export const userSettings = writable(new Config()); +export const userSettings = writable(new Config(false)); export const customCursor = writable(true); export const cursorSmoothening = writable(true); +export const cursorSmoothness = writable(180); export const reduceAnimations = writable(false); + +export const osuInstallationPath = writable(''); diff --git a/src/pages/Launch.svelte b/src/pages/Launch.svelte index 963d691..0917eb3 100644 --- a/src/pages/Launch.svelte +++ b/src/pages/Launch.svelte @@ -27,7 +27,7 @@ import Label from '@/components/ui/label/label.svelte'; import { cursorSmoothening, customCursor, reduceAnimations, userSettings } from '@/userSettings'; - let selectedTab = $state('settings'); + let selectedTab = $state('home'); let launching = $state(false); @@ -264,7 +264,11 @@
@@ -336,6 +340,76 @@ 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" + > +
+
+
+
+ EZPPLauncher Settings +
+
+
+ +
+ Enable a custom cursor in the Launcher like in the lazer build of osu! +
+
+ { + if (!e) { + cursorSmoothening.set(false); + } + customCursor.set(e); + + $userSettings.save(); + }} + class="flex items-center justify-center w-5 h-5" + > + +
+ +
+ Makes the custom cursor movement smoother. +
+
+ { + if (!$customCursor) return; + cursorSmoothening.set(e); + $userSettings.save(); + }} + disabled={!$customCursor} + class="flex items-center justify-center w-5 h-5" + > +
diff --git a/src/pages/Loading.svelte b/src/pages/Loading.svelte index bc57ab2..106a12d 100644 --- a/src/pages/Loading.svelte +++ b/src/pages/Loading.svelte @@ -1,7 +1,12 @@ diff --git a/src/pages/SetupWizard.svelte b/src/pages/SetupWizard.svelte index c69f24d..a046214 100644 --- a/src/pages/SetupWizard.svelte +++ b/src/pages/SetupWizard.svelte @@ -4,10 +4,16 @@ import Input from '@/components/ui/input/input.svelte'; import { animate } from 'animejs'; import { onMount } from 'svelte'; - import { fade } from 'svelte/transition'; + import { fade, scale } from 'svelte/transition'; import { invoke } from '@tauri-apps/api/core'; - import { Check, CheckCircle, CircleOff } from 'lucide-svelte'; + import { Check, CheckCircle, CircleOff, Settings2 } from 'lucide-svelte'; import { open } from '@tauri-apps/plugin-dialog'; + import Checkbox from '@/components/ui/checkbox/checkbox.svelte'; + import { cursorSmoothening, customCursor, reduceAnimations, userSettings } from '@/userSettings'; + import Label from '@/components/ui/label/label.svelte'; + import { current_view } from '@/global'; + import Launch from './Launch.svelte'; + import Confetti from 'svelte-confetti'; let selectedStep = $state(1); const steps = ['Welcome', 'Locate your osu! Installation', 'Appearance Settings']; @@ -16,6 +22,7 @@ let manualSelect = $state(false); let manualSelectValid = $state(false); let autoDetectedOsuPath = $state(false); + let wizardFinished = $state(false); let ezppLogo: HTMLImageElement | undefined = $state(undefined); @@ -57,6 +64,7 @@ osuInstallationPath = selectedPath; autoDetectedOsuPath = false; manualSelectValid = true; + $userSettings.value('osu_installation_path').set(osuInstallationPath); } }; @@ -66,131 +74,223 @@ if (osuInstallPath) { osuInstallationPath = osuInstallPath; autoDetectedOsuPath = true; + $userSettings.value('osu_installation_path').set(osuInstallationPath); } }); -
-
- {#each steps as step, i (step)} -
-
- {#if selectedStep > i + 1} - - {:else} - {i + 1} - {/if} -
- {step} -
- {/each} +{#if wizardFinished} +
+
+ +
+

EZPPLauncher Setup completed!

+

You are now ready to farm some maps!

+
-
- {#if selectedStep === 1} -
- EZPPLauncher Logo -

Welcome to EZPPLauncher!

-

- This setup wizard will guide you through the initial setup of EZPPLauncher. -

-
- Please make sure you have osu! installed on your system before proceeding. -
-
- {:else if selectedStep === 2} -
-

Locate your osu! Installation

-

- Please select the folder where your osu! installation is located. -

-
- - +
+ {#each steps as step, i (step)} +
+
+ {#if selectedStep > i + 1} + + {:else} + {i + 1} + {/if} +
+ {step}
- {#if !manualSelect} - {#if autoDetectedOsuPath} + {/each} +
+
+ {#if selectedStep === 1} +
+ EZPPLauncher Logo +

Welcome to EZPPLauncher!

+

+ This setup wizard will guide you through the initial setup of EZPPLauncher. +

+
+ Please make sure you have osu! installed on your system before proceeding. +
+
+ {:else if selectedStep === 2} +
+

Locate your osu! Installation

+

+ Please select the folder where your osu! installation is located. +

+
+ + +
+ {#if !manualSelect} + {#if autoDetectedOsuPath} +
+ + Auto-detected osu! installation path! Please check if its correct! +
+ {:else} +
+ + Could not auto-detect osu! installation path. Please select it manually. +
+ {/if} + {:else if manualSelectValid}
- Auto-detected osu! installation path! Please check if its correct! + Selected osu! installation path is valid!
{:else}
- Could not auto-detect osu! installation path. Please select it manually. + Selected osu! installation path is invalid! Please select a valid osu! + installation.
{/if} - {:else if manualSelectValid} -
- - Selected osu! installation path is valid! +
+ {:else if selectedStep === 3} +
+
+ EZPPLauncher Settings
- {:else}
- - Selected osu! installation path is invalid! Please select a valid osu! installation. -
- {/if} -
- {/if} +
+ +
+ Enable a custom cursor in the Launcher like in the lazer build of osu! +
+
+ { + if (!e) { + cursorSmoothening.set(false); + } + customCursor.set(e); + }} + class="flex items-center justify-center w-5 h-5" + > -
- - +
+ +
+ Makes the custom cursor movement smoother. +
+
+ { + if (!$customCursor) return; + cursorSmoothening.set(e); + }} + 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); + }} + disabled={!$customCursor} + class="flex items-center justify-center w-5 h-5" + > +
+
+ {/if} + +
+ + +
-
+{/if} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index b69884b..5c4f034 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,7 +1,7 @@ diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index bfd7bb8..441ced2 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,7 +1,12 @@ - +{#key View} +
+ +
+{/key}