← Portfolio

Route transition

The part of a page transition that is the same whatever it looks like: cover, ask the router for the page, wait for it, uncover. From components/motion/useRouteTransition.tsx. The second site covers the screen with twenty-one bars and the fourth with its navigation; both now run on this.

const { go } = useRouteTransition({
  root: "/",
  leave: () => cover.animate(up, timing).finished,
  enter: () => cover.animate(away, timing).finished,
});

<RouteTransitionProvider go={go}>
  <TransitionLink href="/about">About</TransitionLink>
</RouteTransitionProvider>
A tall block, so there is somewhere to scroll from.