diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 3a50068..1fa26d5 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,6 +1,5 @@ export { useAutoStartPatcher } from "./useAutoStartPatcher"; export { useClickOutside } from "./useClickOutside"; -export { usePageTransition } from "./usePageTransition"; export { usePlatformSupport } from "./usePlatformSupport"; export { usePrevious } from "./usePrevious"; export { useReducedMotion } from "./useReducedMotion"; diff --git a/src/hooks/usePageTransition.ts b/src/hooks/usePageTransition.ts deleted file mode 100644 index 660c321..0000000 --- a/src/hooks/usePageTransition.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { useLocation } from "@tanstack/react-router"; -import { useCallback, useEffect, useRef, useState } from "react"; - -import { useReducedMotion } from "./useReducedMotion"; - -/** - * Detects route changes and returns a CSS class name to apply - * a brief enter transition. Does not force unmount/remount. - */ -export function usePageTransition() { - const { pathname } = useLocation(); - const prevPathname = useRef(pathname); - const [transitioning, setTransitioning] = useState(false); - const reducedMotion = useReducedMotion(); - - useEffect(() => { - if (pathname !== prevPathname.current) { - prevPathname.current = pathname; - if (reducedMotion) return; - - setTransitioning(true); - } - }, [pathname, reducedMotion]); - - const onAnimationEnd = useCallback(() => { - setTransitioning(false); - }, []); - - return { - className: transitioning ? "page-enter" : undefined, - onAnimationEnd, - }; -} diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index 071bd13..a6064f9 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -4,7 +4,7 @@ import { Loader2 } from "lucide-react"; import { useEffect } from "react"; import { useHotkeys } from "react-hotkeys-hook"; -import { useAutoStartPatcher, usePageTransition, useReducedMotion } from "@/hooks"; +import { useAutoStartPatcher, useReducedMotion } from "@/hooks"; import { ProtocolInstallDialog, useDeepLinkListener } from "@/modules/deep-link"; import { useLibraryWatcher } from "@/modules/library"; import { useAppInfo, useCheckSetupRequired, useSettings } from "@/modules/settings"; @@ -22,7 +22,6 @@ function RootLayout() { const zoomLevel = useDisplayStore((s) => s.zoomLevel); const isReducedMotion = useReducedMotion(); - const pageTransition = usePageTransition(); useDevLogStream(); useDeepLinkListener(); @@ -79,10 +78,7 @@ function RootLayout() {
-
+
diff --git a/src/styles/animations.css b/src/styles/animations.css index c929e45..6251d37 100644 --- a/src/styles/animations.css +++ b/src/styles/animations.css @@ -132,24 +132,11 @@ --stagger-index: 7; } -@keyframes page-enter { - from { - opacity: 0.6; - } - to { - opacity: 1; - } -} - /* Utility classes for consuming keyframes */ .animate-fade-in { animation: fade-in var(--duration-004) var(--ease-out); } -.page-enter { - animation: page-enter 400ms ease-out both; -} - .animate-slide-down { animation: slide-down var(--duration-005) var(--ease-out); }