chore: format

This commit is contained in:
HorizonCode 2025-07-04 22:24:20 +02:00
parent b0d3651888
commit 5b600017d5
68 changed files with 822 additions and 837 deletions

View File

@ -9,7 +9,6 @@
"tabWidth": 2, "tabWidth": 2,
"useTabs": false, "useTabs": false,
"bracketSpacing": true, "bracketSpacing": true,
"svelteBracketNewLine": true,
"plugins": ["prettier-plugin-svelte"], "plugins": ["prettier-plugin-svelte"],
"overrides": [ "overrides": [
{ {

View File

@ -1,6 +1,6 @@
export default { export default {
plugins: { plugins: {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {} autoprefixer: {},
} },
}; };

View File

@ -2,9 +2,7 @@
"$schema": "../gen/schemas/desktop-schema.json", "$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default", "identifier": "default",
"description": "Capability for the main window", "description": "Capability for the main window",
"windows": [ "windows": ["main"],
"main"
],
"permissions": [ "permissions": [
"core:default", "core:default",
"shell:allow-open", "shell:allow-open",

View File

@ -1,6 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en" class="dark"> <html lang="en" class="dark">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
@ -11,5 +10,4 @@
<body class="bg-theme-950" data-sveltekit-preload-data="hover"> <body class="bg-theme-950" data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div> <div style="display: contents">%sveltekit.body%</div>
</body> </body>
</html> </html>

View File

@ -1,4 +1,4 @@
const API_ENDPOINT = "https://osu.direct/api/"; const API_ENDPOINT = 'https://osu.direct/api/';
export const osudirect = { export const osudirect = {
osu: async (mapId: number): Promise<string | undefined> => { osu: async (mapId: number): Promise<string | undefined> => {

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
import { buttonVariants } from "$lib/components/ui/button/index.js"; import { buttonVariants } from '$lib/components/ui/button/index.js';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
import { buttonVariants } from "$lib/components/ui/button/index.js"; import { buttonVariants } from '$lib/components/ui/button/index.js';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,6 +12,6 @@
<AlertDialogPrimitive.Cancel <AlertDialogPrimitive.Cancel
bind:ref bind:ref
class={cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className)} class={cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive, type WithoutChild } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive, type WithoutChild } from 'bits-ui';
import AlertDialogOverlay from "./alert-dialog-overlay.svelte"; import AlertDialogOverlay from './alert-dialog-overlay.svelte';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -18,7 +18,7 @@
<AlertDialogPrimitive.Content <AlertDialogPrimitive.Content
bind:ref bind:ref
class={cn( class={cn(
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg", 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -11,6 +11,6 @@
<AlertDialogPrimitive.Description <AlertDialogPrimitive.Description
bind:ref bind:ref
class={cn("text-muted-foreground text-sm", className)} class={cn('text-muted-foreground text-sm', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { WithElementRef } from "bits-ui"; import type { WithElementRef } from 'bits-ui';
import type { HTMLAttributes } from "svelte/elements"; import type { HTMLAttributes } from 'svelte/elements';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -13,7 +13,7 @@
<div <div
bind:this={ref} bind:this={ref}
class={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)} class={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
{...restProps} {...restProps}
> >
{@render children?.()} {@render children?.()}

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { WithElementRef } from "bits-ui"; import type { WithElementRef } from 'bits-ui';
import type { HTMLAttributes } from "svelte/elements"; import type { HTMLAttributes } from 'svelte/elements';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -13,7 +13,7 @@
<div <div
bind:this={ref} bind:this={ref}
class={cn("flex flex-col space-y-2 text-center sm:text-left", className)} class={cn('flex flex-col space-y-2 text-center sm:text-left', className)}
{...restProps} {...restProps}
> >
{@render children?.()} {@render children?.()}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,7 +12,7 @@
<AlertDialogPrimitive.Overlay <AlertDialogPrimitive.Overlay
bind:ref bind:ref
class={cn( class={cn(
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80", 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,7 +12,7 @@
<AlertDialogPrimitive.Title <AlertDialogPrimitive.Title
bind:ref bind:ref
class={cn("text-lg font-semibold", className)} class={cn('text-lg font-semibold', className)}
{level} {level}
{...restProps} {...restProps}
/> />

View File

@ -1,12 +1,12 @@
import { AlertDialog as AlertDialogPrimitive } from "bits-ui"; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
import Title from "./alert-dialog-title.svelte"; import Title from './alert-dialog-title.svelte';
import Action from "./alert-dialog-action.svelte"; import Action from './alert-dialog-action.svelte';
import Cancel from "./alert-dialog-cancel.svelte"; import Cancel from './alert-dialog-cancel.svelte';
import Footer from "./alert-dialog-footer.svelte"; import Footer from './alert-dialog-footer.svelte';
import Header from "./alert-dialog-header.svelte"; import Header from './alert-dialog-header.svelte';
import Overlay from "./alert-dialog-overlay.svelte"; import Overlay from './alert-dialog-overlay.svelte';
import Content from "./alert-dialog-content.svelte"; import Content from './alert-dialog-content.svelte';
import Description from "./alert-dialog-description.svelte"; import Description from './alert-dialog-description.svelte';
const Root = AlertDialogPrimitive.Root; const Root = AlertDialogPrimitive.Root;
const Trigger = AlertDialogPrimitive.Trigger; const Trigger = AlertDialogPrimitive.Trigger;

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Avatar as AvatarPrimitive } from "bits-ui"; import { Avatar as AvatarPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -11,6 +11,6 @@
<AvatarPrimitive.Fallback <AvatarPrimitive.Fallback
bind:ref bind:ref
class={cn("bg-muted flex h-full w-full items-center justify-center rounded-full", className)} class={cn('bg-muted flex h-full w-full items-center justify-center rounded-full', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Avatar as AvatarPrimitive } from "bits-ui"; import { Avatar as AvatarPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -11,6 +11,6 @@
<AvatarPrimitive.Image <AvatarPrimitive.Image
bind:ref bind:ref
class={cn("aspect-square h-full w-full", className)} class={cn('aspect-square h-full w-full', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Avatar as AvatarPrimitive } from "bits-ui"; import { Avatar as AvatarPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -11,6 +11,6 @@
<AvatarPrimitive.Root <AvatarPrimitive.Root
bind:ref bind:ref
class={cn("relative flex size-10 shrink-0 overflow-hidden rounded-full", className)} class={cn('relative flex size-10 shrink-0 overflow-hidden rounded-full', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,6 +1,6 @@
import Root from "./avatar.svelte"; import Root from './avatar.svelte';
import Image from "./avatar-image.svelte"; import Image from './avatar-image.svelte';
import Fallback from "./avatar-fallback.svelte"; import Fallback from './avatar-fallback.svelte';
export { export {
Root, Root,

View File

@ -2,9 +2,7 @@
const prop: { beatmapId: number } = $props(); const prop: { beatmapId: number } = $props();
</script> </script>
<div <div class="absolute w-screen h-screen overflow-hidden pointer-events-none rounded">
class="absolute w-screen h-screen overflow-hidden pointer-events-none rounded"
>
<div <div
style="background: url(https://osu.direct/api/media/background/{prop.beatmapId})" style="background: url(https://osu.direct/api/media/background/{prop.beatmapId})"
class="absolute top-0 left-0 w-full h-full !bg-cover -z-10 pointer-events-none blur opacity-10 rounded" class="absolute top-0 left-0 w-full h-full !bg-cover -z-10 pointer-events-none blur opacity-10 rounded"

View File

@ -1,37 +1,36 @@
<script lang="ts" module> <script lang="ts" module>
import { type VariantProps, tv } from "tailwind-variants"; import { type VariantProps, tv } from 'tailwind-variants';
export const badgeVariants = tv({ export const badgeVariants = tv({
base: "focus:ring-ring inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2", base: 'focus:ring-ring inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2',
variants: { variants: {
variant: { variant: {
default: default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent',
"bg-primary text-primary-foreground hover:bg-primary/80 border-transparent",
secondary: secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent", 'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent',
destructive: destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent", 'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent',
outline: "text-foreground", outline: 'text-foreground',
}, },
}, },
defaultVariants: { defaultVariants: {
variant: "default", variant: 'default',
}, },
}); });
export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"]; export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
</script> </script>
<script lang="ts"> <script lang="ts">
import type { WithElementRef } from "bits-ui"; import type { WithElementRef } from 'bits-ui';
import type { HTMLAnchorAttributes } from "svelte/elements"; import type { HTMLAnchorAttributes } from 'svelte/elements';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
href, href,
class: className, class: className,
variant = "default", variant = 'default',
children, children,
...restProps ...restProps
}: WithElementRef<HTMLAnchorAttributes> & { }: WithElementRef<HTMLAnchorAttributes> & {
@ -40,7 +39,7 @@
</script> </script>
<svelte:element <svelte:element
this={href ? "a" : "span"} this={href ? 'a' : 'span'}
bind:this={ref} bind:this={ref}
{href} {href}
class={cn(badgeVariants({ variant, className }))} class={cn(badgeVariants({ variant, className }))}

View File

@ -1,2 +1,2 @@
export { default as Badge } from "./badge.svelte"; export { default as Badge } from './badge.svelte';
export { badgeVariants, type BadgeVariant } from "./badge.svelte"; export { badgeVariants, type BadgeVariant } from './badge.svelte';

View File

@ -1,35 +1,34 @@
<script lang="ts" module> <script lang="ts" module>
import type { WithElementRef } from "bits-ui"; import type { WithElementRef } from 'bits-ui';
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements"; import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
import { type VariantProps, tv } from "tailwind-variants"; import { type VariantProps, tv } from 'tailwind-variants';
export const buttonVariants = tv({ export const buttonVariants = tv({
base: "ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", base: 'ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
variants: { variants: {
variant: { variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90", default: 'bg-primary text-primary-foreground hover:bg-primary/90',
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
outline: outline: 'border-input bg-background hover:bg-accent hover:text-accent-foreground border',
"border-input bg-background hover:bg-accent hover:text-accent-foreground border", secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: 'hover:bg-accent hover:text-accent-foreground',
ghost: "hover:bg-accent hover:text-accent-foreground", link: 'text-primary underline-offset-4 hover:underline',
link: "text-primary underline-offset-4 hover:underline",
}, },
size: { size: {
default: "h-10 px-4 py-2", default: 'h-10 px-4 py-2',
sm: "h-9 rounded-md px-3", sm: 'h-9 rounded-md px-3',
lg: "h-11 rounded-md px-8", lg: 'h-11 rounded-md px-8',
icon: "h-10 w-10", icon: 'h-10 w-10',
}, },
}, },
defaultVariants: { defaultVariants: {
variant: "default", variant: 'default',
size: "default", size: 'default',
}, },
}); });
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"]; export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
export type ButtonSize = VariantProps<typeof buttonVariants>["size"]; export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
WithElementRef<HTMLAnchorAttributes> & { WithElementRef<HTMLAnchorAttributes> & {
@ -39,27 +38,22 @@
</script> </script>
<script lang="ts"> <script lang="ts">
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
class: className, class: className,
variant = "default", variant = 'default',
size = "default", size = 'default',
ref = $bindable(null), ref = $bindable(null),
href = undefined, href = undefined,
type = "button", type = 'button',
children, children,
...restProps ...restProps
}: ButtonProps = $props(); }: ButtonProps = $props();
</script> </script>
{#if href} {#if href}
<a <a bind:this={ref} class={cn(buttonVariants({ variant, size, className }))} {href} {...restProps}>
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
{href}
{...restProps}
>
{@render children?.()} {@render children?.()}
</a> </a>
{:else} {:else}

View File

@ -3,7 +3,7 @@ import Root, {
type ButtonSize, type ButtonSize,
type ButtonVariant, type ButtonVariant,
buttonVariants, buttonVariants,
} from "./button.svelte"; } from './button.svelte';
export { export {
Root, Root,

View File

@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import { Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild } from "bits-ui"; import { Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import Check from "@lucide/svelte/icons/check"; import Check from '@lucide/svelte/icons/check';
import Minus from "@lucide/svelte/icons/minus"; import Minus from '@lucide/svelte/icons/minus';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -16,7 +16,7 @@
<CheckboxPrimitive.Root <CheckboxPrimitive.Root
bind:ref bind:ref
class={cn( class={cn(
"border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer box-content size-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50", 'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer box-content size-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',
className className
)} )}
bind:checked bind:checked
@ -28,7 +28,7 @@
{#if indeterminate} {#if indeterminate}
<Minus class="size-3.5" /> <Minus class="size-3.5" />
{:else} {:else}
<Check class={cn("size-3.5", !checked && "text-transparent")} /> <Check class={cn('size-3.5', !checked && 'text-transparent')} />
{/if} {/if}
</div> </div>
{/snippet} {/snippet}

View File

@ -1,4 +1,4 @@
import Root from "./checkbox.svelte"; import Root from './checkbox.svelte';
export { export {
Root, Root,
// //

View File

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChildrenOrChild } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import Check from "lucide-svelte/icons/check"; import Check from 'lucide-svelte/icons/check';
import Minus from "lucide-svelte/icons/minus"; import Minus from 'lucide-svelte/icons/minus';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
import type { Snippet } from "svelte"; import type { Snippet } from 'svelte';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -22,7 +22,7 @@
bind:checked bind:checked
bind:indeterminate bind:indeterminate
class={cn( class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50", 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className className
)} )}
{...restProps} {...restProps}
@ -32,7 +32,7 @@
{#if indeterminate} {#if indeterminate}
<Minus class="size-4" /> <Minus class="size-4" />
{:else} {:else}
<Check class={cn("size-4", !checked && "text-transparent")} /> <Check class={cn('size-4', !checked && 'text-transparent')} />
{/if} {/if}
</span> </span>
{@render childrenProp?.()} {@render childrenProp?.()}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -18,7 +18,7 @@
bind:ref bind:ref
{sideOffset} {sideOffset}
class={cn( class={cn(
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md outline-none", 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md outline-none',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -14,6 +14,6 @@
<DropdownMenuPrimitive.GroupHeading <DropdownMenuPrimitive.GroupHeading
bind:ref bind:ref
class={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)} class={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -15,8 +15,8 @@
<DropdownMenuPrimitive.Item <DropdownMenuPrimitive.Item
bind:ref bind:ref
class={cn( class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
inset && "pl-8", inset && 'pl-8',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
import { type WithElementRef } from "bits-ui"; import { type WithElementRef } from 'bits-ui';
import type { HTMLAttributes } from "svelte/elements"; import type { HTMLAttributes } from 'svelte/elements';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -16,7 +16,7 @@
<div <div
bind:this={ref} bind:this={ref}
class={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)} class={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
{...restProps} {...restProps}
> >
{@render children?.()} {@render children?.()}

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive, type WithoutChild } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive, type WithoutChild } from 'bits-ui';
import Circle from "lucide-svelte/icons/circle"; import Circle from 'lucide-svelte/icons/circle';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -14,7 +14,7 @@
<DropdownMenuPrimitive.RadioItem <DropdownMenuPrimitive.RadioItem
bind:ref bind:ref
class={cn( class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50", 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -11,6 +11,6 @@
<DropdownMenuPrimitive.Separator <DropdownMenuPrimitive.Separator
bind:ref bind:ref
class={cn("bg-muted -mx-1 my-1 h-px", className)} class={cn('bg-muted -mx-1 my-1 h-px', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from "svelte/elements"; import type { HTMLAttributes } from 'svelte/elements';
import { type WithElementRef } from "bits-ui"; import { type WithElementRef } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -13,7 +13,7 @@
<span <span
bind:this={ref} bind:this={ref}
class={cn("ml-auto text-xs tracking-widest opacity-60", className)} class={cn('ml-auto text-xs tracking-widest opacity-60', className)}
{...restProps} {...restProps}
> >
{@render children?.()} {@render children?.()}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,7 +12,7 @@
<DropdownMenuPrimitive.SubContent <DropdownMenuPrimitive.SubContent
bind:ref bind:ref
class={cn( class={cn(
"bg-popover text-popover-foreground z-50 min-w-[8rem] rounded-md border p-1 shadow-lg focus:outline-none", 'bg-popover text-popover-foreground z-50 min-w-[8rem] rounded-md border p-1 shadow-lg focus:outline-none',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import ChevronRight from "lucide-svelte/icons/chevron-right"; import ChevronRight from 'lucide-svelte/icons/chevron-right';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -17,8 +17,8 @@
<DropdownMenuPrimitive.SubTrigger <DropdownMenuPrimitive.SubTrigger
bind:ref bind:ref
class={cn( class={cn(
"data-[highlighted]:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", 'data-[highlighted]:bg-accent data-[state=open]:bg-accent flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
inset && "pl-8", inset && 'pl-8',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,14 +1,14 @@
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui"; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import CheckboxItem from "./dropdown-menu-checkbox-item.svelte"; import CheckboxItem from './dropdown-menu-checkbox-item.svelte';
import Content from "./dropdown-menu-content.svelte"; import Content from './dropdown-menu-content.svelte';
import GroupHeading from "./dropdown-menu-group-heading.svelte"; import GroupHeading from './dropdown-menu-group-heading.svelte';
import Item from "./dropdown-menu-item.svelte"; import Item from './dropdown-menu-item.svelte';
import Label from "./dropdown-menu-label.svelte"; import Label from './dropdown-menu-label.svelte';
import RadioItem from "./dropdown-menu-radio-item.svelte"; import RadioItem from './dropdown-menu-radio-item.svelte';
import Separator from "./dropdown-menu-separator.svelte"; import Separator from './dropdown-menu-separator.svelte';
import Shortcut from "./dropdown-menu-shortcut.svelte"; import Shortcut from './dropdown-menu-shortcut.svelte';
import SubContent from "./dropdown-menu-sub-content.svelte"; import SubContent from './dropdown-menu-sub-content.svelte';
import SubTrigger from "./dropdown-menu-sub-trigger.svelte"; import SubTrigger from './dropdown-menu-sub-trigger.svelte';
const Sub = DropdownMenuPrimitive.Sub; const Sub = DropdownMenuPrimitive.Sub;
const Root = DropdownMenuPrimitive.Root; const Root = DropdownMenuPrimitive.Root;

View File

@ -1,4 +1,4 @@
import Root from "./input.svelte"; import Root from './input.svelte';
export { export {
Root, Root,

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { HTMLInputAttributes } from "svelte/elements"; import type { HTMLInputAttributes } from 'svelte/elements';
import type { WithElementRef } from "bits-ui"; import type { WithElementRef } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -14,7 +14,7 @@
<input <input
bind:this={ref} bind:this={ref}
class={cn( class={cn(
"border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", 'border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className className
)} )}
bind:value bind:value

View File

@ -1,4 +1,4 @@
import Root from "./label.svelte"; import Root from './label.svelte';
export { export {
Root, Root,

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Label as LabelPrimitive } from "bits-ui"; import { Label as LabelPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,7 +12,7 @@
<LabelPrimitive.Root <LabelPrimitive.Root
bind:ref bind:ref
class={cn( class={cn(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", 'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import ezppLogo from "../../../../assets/logo.png"; import ezppLogo from '../../../../assets/logo.png';
import { osudirect } from "@/api/osudirect"; import { osudirect } from '@/api/osudirect';
import { gameSounds, playAudio } from "@/utils"; import { gameSounds } from '@/utils';
import { BeatmapDecoder } from "osu-parsers"; import { BeatmapDecoder } from 'osu-parsers';
import { onMount } from "svelte"; import { onMount } from 'svelte';
type logoProps = { type logoProps = {
beatmapId: number; beatmapId: number;
@ -26,14 +26,12 @@
const beatmap = decoder.decodeFromString(beatmapData); const beatmap = decoder.decodeFromString(beatmapData);
console.log(beatmap); console.log(beatmap);
const audio = new Audio( const audio = new Audio(`https://osu.direct/api/media/audio/${beatmapId}`);
`https://osu.direct/api/media/audio/${beatmapId}`
);
audio.volume = 0.3; audio.volume = 0.3;
// Function to play the heartbeat sound // Function to play the heartbeat sound
const playHeartbeat = () => { const playHeartbeat = () => {
gameSounds.play("menuHeartbeat", { gameSounds.play('menuHeartbeat', {
volume: hovered ? 1 : 0.3, volume: hovered ? 1 : 0.3,
}); });
}; };
@ -60,8 +58,7 @@
window.clearInterval(lastTimeout); window.clearInterval(lastTimeout);
lastTimeout = undefined; lastTimeout = undefined;
} }
if (!lastTimeout) if (!lastTimeout) lastTimeout = window.setInterval(playHeartbeat, interval);
lastTimeout = window.setInterval(playHeartbeat, interval);
}, nextBeat); }, nextBeat);
} }
// Continue syncing // Continue syncing
@ -69,9 +66,9 @@
}; };
// Wait for audio to be ready before starting playback and syncing // Wait for audio to be ready before starting playback and syncing
audio.addEventListener("canplay", async () => { audio.addEventListener('canplay', async () => {
audio.addEventListener("play", syncHeartbeat); audio.addEventListener('play', syncHeartbeat);
audio.addEventListener("ended", async () => await audio.play()); audio.addEventListener('ended', async () => await audio.play());
await audio.play(); await audio.play();
syncHeartbeat(); syncHeartbeat();
}); });
@ -96,9 +93,9 @@
onmouseleave={() => (hovered = false)} onmouseleave={() => (hovered = false)}
onclick={() => { onclick={() => {
if (extended) { if (extended) {
gameSounds.play("menuBack"); gameSounds.play('menuBack');
} else { } else {
gameSounds.play("menuHit"); gameSounds.play('menuHit');
} }
onclick(); onclick();
}} }}

View File

@ -3,8 +3,6 @@
import cursor_additive from '$assets/cursor-additive.png'; import cursor_additive from '$assets/cursor-additive.png';
import { animate } from 'animejs'; import { animate } from 'animejs';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { currentMonitor } from '@tauri-apps/api/window';
import { estimateRefreshRate } from '@/displayUtils';
import { cursorSmoothness } from '@/userSettings'; import { cursorSmoothness } from '@/userSettings';
let { smoothCursor = true }: { smoothCursor?: boolean } = $props(); let { smoothCursor = true }: { smoothCursor?: boolean } = $props();

View File

@ -1,4 +1,4 @@
import Root from "./progress.svelte"; import Root from './progress.svelte';
export { export {
Root, Root,

View File

@ -20,7 +20,9 @@
{...restProps} {...restProps}
> >
<div <div
class="bg-primary h-full w-full flex-1 transition-all {indeterminate ? 'animate-slide' : ''} rounded-lg" class="bg-primary h-full w-full flex-1 transition-all {indeterminate
? 'animate-slide'
: ''} rounded-lg"
style={`transform: translateX(-${100 - (100 * ((indeterminate ? max : value) ?? 0)) / (max ?? 1)}%);`} style={`transform: translateX(-${100 - (100 * ((indeterminate ? max : value) ?? 0)) / (max ?? 1)}%);`}
></div> ></div>
</ProgressPrimitive.Root> </ProgressPrimitive.Root>

View File

@ -1,12 +1,12 @@
import { Select as SelectPrimitive } from "bits-ui"; import { Select as SelectPrimitive } from 'bits-ui';
import GroupHeading from "./select-group-heading.svelte"; import GroupHeading from './select-group-heading.svelte';
import Item from "./select-item.svelte"; import Item from './select-item.svelte';
import Content from "./select-content.svelte"; import Content from './select-content.svelte';
import Trigger from "./select-trigger.svelte"; import Trigger from './select-trigger.svelte';
import Separator from "./select-separator.svelte"; import Separator from './select-separator.svelte';
import ScrollDownButton from "./select-scroll-down-button.svelte"; import ScrollDownButton from './select-scroll-down-button.svelte';
import ScrollUpButton from "./select-scroll-up-button.svelte"; import ScrollUpButton from './select-scroll-up-button.svelte';
const Root = SelectPrimitive.Root; const Root = SelectPrimitive.Root;
const Group = SelectPrimitive.Group; const Group = SelectPrimitive.Group;

View File

@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import { Select as SelectPrimitive, type WithoutChild } from "bits-ui"; import { Select as SelectPrimitive, type WithoutChild } from 'bits-ui';
import SelectScrollUpButton from "./select-scroll-up-button.svelte"; import SelectScrollUpButton from './select-scroll-up-button.svelte';
import SelectScrollDownButton from "./select-scroll-down-button.svelte"; import SelectScrollDownButton from './select-scroll-down-button.svelte';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -21,7 +21,7 @@
bind:ref bind:ref
{sideOffset} {sideOffset}
class={cn( class={cn(
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
className className
)} )}
{...restProps} {...restProps}
@ -29,7 +29,7 @@
<SelectScrollUpButton /> <SelectScrollUpButton />
<SelectPrimitive.Viewport <SelectPrimitive.Viewport
class={cn( class={cn(
"h-[var(--bits-select-anchor-height)] w-full min-w-[var(--bits-select-anchor-width)] p-1" 'h-[var(--bits-select-anchor-height)] w-full min-w-[var(--bits-select-anchor-width)] p-1'
)} )}
> >
{@render children?.()} {@render children?.()}

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Select as SelectPrimitive } from "bits-ui"; import { Select as SelectPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -11,6 +11,6 @@
<SelectPrimitive.GroupHeading <SelectPrimitive.GroupHeading
bind:ref bind:ref
class={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)} class={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}
{...restProps} {...restProps}
/> />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import Check from "@lucide/svelte/icons/check"; import Check from '@lucide/svelte/icons/check';
import { Select as SelectPrimitive, type WithoutChild } from "bits-ui"; import { Select as SelectPrimitive, type WithoutChild } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -17,7 +17,7 @@
bind:ref bind:ref
{value} {value}
class={cn( class={cn(
"data-[highlighted]:bg-primary-800/30 data-[highlighted]:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50", 'data-[highlighted]:bg-primary-800/30 data-[highlighted]:text-accent-foreground relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import ChevronDown from "@lucide/svelte/icons/chevron-down"; import ChevronDown from '@lucide/svelte/icons/chevron-down';
import { Select as SelectPrimitive, type WithoutChildrenOrChild } from "bits-ui"; import { Select as SelectPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,7 +12,7 @@
<SelectPrimitive.ScrollDownButton <SelectPrimitive.ScrollDownButton
bind:ref bind:ref
class={cn("flex cursor-default items-center justify-center py-1", className)} class={cn('flex cursor-default items-center justify-center py-1', className)}
{...restProps} {...restProps}
> >
<ChevronDown class="size-4" /> <ChevronDown class="size-4" />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import ChevronUp from "@lucide/svelte/icons/chevron-up"; import ChevronUp from '@lucide/svelte/icons/chevron-up';
import { Select as SelectPrimitive, type WithoutChildrenOrChild } from "bits-ui"; import { Select as SelectPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -12,7 +12,7 @@
<SelectPrimitive.ScrollUpButton <SelectPrimitive.ScrollUpButton
bind:ref bind:ref
class={cn("flex cursor-default items-center justify-center py-1", className)} class={cn('flex cursor-default items-center justify-center py-1', className)}
{...restProps} {...restProps}
> >
<ChevronUp class="size-4" /> <ChevronUp class="size-4" />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import type { Separator as SeparatorPrimitive } from "bits-ui"; import type { Separator as SeparatorPrimitive } from 'bits-ui';
import { Separator } from "$lib/components/ui/separator/index.js"; import { Separator } from '$lib/components/ui/separator/index.js';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -10,4 +10,4 @@
}: SeparatorPrimitive.RootProps = $props(); }: SeparatorPrimitive.RootProps = $props();
</script> </script>
<Separator bind:ref class={cn("bg-muted -mx-1 my-1 h-px", className)} {...restProps} /> <Separator bind:ref class={cn('bg-muted -mx-1 my-1 h-px', className)} {...restProps} />

View File

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { Select as SelectPrimitive, type WithoutChild } from "bits-ui"; import { Select as SelectPrimitive, type WithoutChild } from 'bits-ui';
import ChevronDown from "@lucide/svelte/icons/chevron-down"; import ChevronDown from '@lucide/svelte/icons/chevron-down';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
@ -14,7 +14,7 @@
<SelectPrimitive.Trigger <SelectPrimitive.Trigger
bind:ref bind:ref
class={cn( class={cn(
"border-input bg-background ring-offset-background data-[placeholder]:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", 'border-input bg-background ring-offset-background data-[placeholder]:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',
className className
)} )}
{...restProps} {...restProps}

View File

@ -1,4 +1,4 @@
import Root from "./separator.svelte"; import Root from './separator.svelte';
export { export {
Root, Root,

View File

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { Separator as SeparatorPrimitive } from "bits-ui"; import { Separator as SeparatorPrimitive } from 'bits-ui';
import { cn } from "$lib/utils.js"; import { cn } from '$lib/utils.js';
let { let {
ref = $bindable(null), ref = $bindable(null),
class: className, class: className,
orientation = "horizontal", orientation = 'horizontal',
...restProps ...restProps
}: SeparatorPrimitive.RootProps = $props(); }: SeparatorPrimitive.RootProps = $props();
</script> </script>
@ -13,8 +13,8 @@
<SeparatorPrimitive.Root <SeparatorPrimitive.Root
bind:ref bind:ref
class={cn( class={cn(
"bg-border shrink-0", 'bg-border shrink-0',
orientation === "horizontal" ? "h-[1px] w-full" : "min-h-full w-[1px]", orientation === 'horizontal' ? 'h-[1px] w-full' : 'min-h-full w-[1px]',
className className
)} )}
{orientation} {orientation}

View File

@ -1 +1 @@
export { default as Toaster } from "./sonner.svelte"; export { default as Toaster } from './sonner.svelte';

View File

@ -45,6 +45,7 @@ export class Config {
) as Record<string, unknown>; ) as Record<string, unknown>;
this.config = decryptedJSON; this.config = decryptedJSON;
} catch (err) { } catch (err) {
console.log(err);
this.config = {}; this.config = {};
await this.save(); await this.save();
} }

View File

@ -1,6 +1,6 @@
export function estimateRefreshRate(): Promise<number> { export function estimateRefreshRate(): Promise<number> {
return new Promise((resolve) => { return new Promise((resolve) => {
let last = performance.now(); const last = performance.now();
let frames = 0; let frames = 0;
function loop() { function loop() {

View File

@ -22,7 +22,7 @@ export const skins = writable<number | undefined>(undefined);
export const osuStream = writable<string | undefined>(undefined); export const osuStream = writable<string | undefined>(undefined);
export const osuBuild = writable<string | undefined>(undefined); export const osuBuild = writable<string | undefined>(undefined);
export const currentSkin = writable<string>(""); export const currentSkin = writable<string>('');
let updateValues = true; let updateValues = true;
launching.subscribe((val) => (updateValues = !val)); launching.subscribe((val) => (updateValues = !val));

View File

@ -70,7 +70,8 @@ export const getSkin = async (folder: string) => {
}; };
export const runUpdater = async (folder: string) => await invoke('run_osu_updater', { folder }); export const runUpdater = async (folder: string) => await invoke('run_osu_updater', { folder });
export const runOsu = async (folder: string, patch: boolean) => await invoke('run_osu', { folder, patch }); export const runOsu = async (folder: string, patch: boolean) =>
await invoke('run_osu', { folder, patch });
export const getEZPPLauncherUpdateFiles = async (folder: string) => { export const getEZPPLauncherUpdateFiles = async (folder: string) => {
const result = await invoke('get_ezpp_launcher_update_files', { folder, updateUrl }); const result = await invoke('get_ezpp_launcher_update_files', { folder, updateUrl });

View File

@ -2,5 +2,5 @@ import { writable } from 'svelte/store';
import { Config } from './config'; import { Config } from './config';
import type { EZPPUser } from './types'; import type { EZPPUser } from './types';
export const userAuth = writable<Config>(new Config("user_auth", true)); export const userAuth = writable<Config>(new Config('user_auth', true));
export const currentUser = writable<EZPPUser | undefined>(undefined); export const currentUser = writable<EZPPUser | undefined>(undefined);

View File

@ -144,7 +144,7 @@
} }
}; };
const launch = async (offline: boolean) => { const launch = async () => {
const osuRunning = await isOsuRunning(); const osuRunning = await isOsuRunning();
if (osuRunning) { if (osuRunning) {
toast.error('Hold on a second!', { toast.error('Hold on a second!', {
@ -428,7 +428,7 @@
</div> </div>
</Select.Trigger> </Select.Trigger>
<Select.Content class="bg-theme-950 border border-theme-900 rounded-lg"> <Select.Content class="bg-theme-950 border border-theme-900 rounded-lg">
{#each validModeTypeCombinationsSorted as gamemode} {#each validModeTypeCombinationsSorted as gamemode (gamemode)}
{@const gamemod = getModeAndTypeFromGamemode(gamemode)} {@const gamemod = getModeAndTypeFromGamemode(gamemode)}
<Select.Item value={gamemode.toFixed()}> <Select.Item value={gamemode.toFixed()}>
<div class="flex flex-row gap-2 items-center"> <div class="flex flex-row gap-2 items-center">
@ -726,11 +726,11 @@
</div> </div>
<Button <Button
size="lg" size="lg"
disabled={$launching || $osuInstallationPath === ''} disabled={$launching || $osuInstallationPath === '' || $serverConnectionFails > 1}
onclick={() => launch($serverConnectionFails > 1)} onclick={launch}
> >
<Play /> <Play />
Launch {$serverConnectionFails > 1 ? 'offline' : ''} {$serverConnectionFails > 1 ? 'No connection' : 'Launch'}
</Button> </Button>
</div> </div>
<div <div

View File

@ -1,8 +1,8 @@
// Tauri doesn't have a Node.js server to do proper SSR // Tauri doesn't have a Node.js server to do proper SSR
// so we will use adapter-static to prerender the app (SSG) // so we will use adapter-static to prerender the app (SSG)
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
import adapter from "@sveltejs/adapter-static"; import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
@ -10,10 +10,10 @@ const config = {
kit: { kit: {
adapter: adapter(), adapter: adapter(),
alias: { alias: {
'@/*': "./src/lib/*", '@/*': './src/lib/*',
"$lib/*": "./src/lib/*", '$lib/*': './src/lib/*',
"$assets/*": "./src/assets/*" '$assets/*': './src/assets/*',
} },
}, },
}; };

View File

@ -9,8 +9,8 @@
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,
"strict": true, "strict": true,
"moduleResolution": "bundler", "moduleResolution": "bundler"
}, }
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files // except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
// //

View File

@ -1,5 +1,5 @@
import { defineConfig } from "vite"; import { defineConfig } from 'vite';
import { sveltekit } from "@sveltejs/kit/vite"; import { sveltekit } from '@sveltejs/kit/vite';
import devtoolsJson from 'vite-plugin-devtools-json'; import devtoolsJson from 'vite-plugin-devtools-json';
// @ts-expect-error process is a nodejs global // @ts-expect-error process is a nodejs global
@ -20,14 +20,14 @@ export default defineConfig(async () => ({
host: host || false, host: host || false,
hmr: host hmr: host
? { ? {
protocol: "ws", protocol: 'ws',
host, host,
port: 1421, port: 1421,
} }
: undefined, : undefined,
watch: { watch: {
// 3. tell vite to ignore watching `src-tauri` // 3. tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"], ignored: ['**/src-tauri/**'],
}, },
}, },
})); }));