ENGLISH·COURSE API
    Preparing search index...
    • Chooses the motion for a route change from the two routes it connects.

      Parameters

      • from: string

        The route being left

      • to: string

        The route being entered

      Returns
          | "none"
          | "slide-forward"
          | "slide-back"
          | "depth-in"
          | "depth-out"
          | "rise"
          | "sink"
          | "fade"

      The motion to play, or "none" when both are the same route

      The rule reads where each route sits in the app rather than which link was followed, because the same link component is rendered at different depths: a "Resume" tile goes deeper from My learning and sideways from another lesson.

      • Sections, course pages and onboarding steps slide in their own order.
      • A deeper level of the course tree goes in; a shallower one comes out.
      • Account pages rise when entered from the app and slide between each other.
      • Leaving the account or onboarding flow for the app sinks.
      • A route with no place — legal pages, unknown paths — fades.

      Locale prefixes, query strings, hashes and trailing slashes are ignored, so a raw location.pathname is as good an input as a locale-less href.

      routeMotion("/learning", "/courses");                    // "slide-forward"
      routeMotion("/courses", "/courses/basic-course/about"); // "depth-in"
      routeMotion("/es/profile", "/es/sign-in"); // "rise"
      routeMotion("/sign-in", "/sign-in?reset=done"); // "none"