diff --git a/bun.lockb b/bun.lockb index 6480ec87..232920a2 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index cb3d499c..ed884f52 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "@sveltejs/vite-plugin-svelte": "^4.0.0", "@tailwindcss/container-queries": "^0.1.1", "@tailwindcss/postcss": "^4.1.8", - "@types/nprogress": "^0.2.0", "@types/ua-parser-js": "^0.7.39", "eslint": "^9.28.0", "eslint-plugin-svelte": "^3.9.1", @@ -23,7 +22,6 @@ "linkify-it": "^5.0.0", "marked": "7.0.5", "marked-linkify-it": "^3.1.10", - "nprogress": "^0.2.0", "postcss": "^8.4.30", "prettier": "^3.3.3", "prettier-plugin-svelte": "^3.2.7", diff --git a/src/lib/components/lemmy/post/media/PostImage.svelte b/src/lib/components/lemmy/post/media/PostImage.svelte index b50c2735..99c8b0a9 100644 --- a/src/lib/components/lemmy/post/media/PostImage.svelte +++ b/src/lib/components/lemmy/post/media/PostImage.svelte @@ -24,7 +24,7 @@ showImage(bestImageURL(post, false, -1, null))} diff --git a/src/lib/components/ui/Expandable.svelte b/src/lib/components/ui/Expandable.svelte index 8da23450..5976e4bd 100644 --- a/src/lib/components/ui/Expandable.svelte +++ b/src/lib/components/ui/Expandable.svelte @@ -39,7 +39,7 @@ size="16" micro class={[ - open && 'rotate-90', + open && 'rotate-180', 'transition-transform duration-300 ease-out', ]} /> diff --git a/src/lib/components/ui/layout/NavigationProgress.svelte b/src/lib/components/ui/layout/NavigationProgress.svelte new file mode 100644 index 00000000..b88178da --- /dev/null +++ b/src/lib/components/ui/layout/NavigationProgress.svelte @@ -0,0 +1,48 @@ + + +
0 && 'use-transition', + ]} + style="width: {progress}%;" + id="progress-bar" +>
+ + diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 0ed3d9ef..80895789 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -13,25 +13,17 @@ import { inDarkColorScheme, rgbToHex, theme } from '$lib/ui/colors.svelte.js' import { getDefaultColors } from '$lib/ui/presets' import { Button, ModalContainer, Spinner, ToastContainer } from 'mono-svelte' - import nProgress from 'nprogress' - import 'nprogress/nprogress.css' import { onMount } from 'svelte' import { Forward, Icon } from 'svelte-hero-icons' import '../style/app.css' + import NavigationProgress from '$lib/components/ui/layout/NavigationProgress.svelte' interface Props { children?: import('svelte').Snippet } let { children }: Props = $props() - nProgress.configure({ - minimum: 0.4, - trickleSpeed: 200, - easing: 'ease-out', - speed: 300, - showSpinner: false, - }) - + let progressBar = $state<{ start: () => void; stop: () => void }>() onMount(() => { if (browser) { if (window.location.hash == 'main') { @@ -71,12 +63,12 @@ document.documentElement.dir = ($locale == 'he' || $locale == 'ar') && settings.useRtl ? 'rtl' : 'ltr' }) - } - $effect(() => { - if (navigating.to) nProgress.start() - else nProgress.done() - }) + $effect(() => { + if (navigating.to) progressBar?.start() + else progressBar?.stop() + }) + } @@ -104,6 +96,7 @@ + +