PageTransition is a wrapper component that plays a short Framer Motion animation whenever a page enters or exits the viewport. It accepts a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/artisan-developer/llms.txt
Use this file to discover all available pages before exploring further.
children prop and wraps the rendered output in a motion.div that fades, de-blurs, and scales content into view on entry, then reverses the effect on exit. The result is a navigation experience that feels polished and cohesive — each page transition reinforces the artisan theme’s sense of craft — while keeping individual transition durations short enough that no visitor has to wait for content.
Design principle
The Artisan Developer theme treats motion as a quality signal rather than entertainment. Page transitions are intentionally short: motion should make the site feel polished but never slow the visitor down or make the interface feel heavy. This philosophy drives every timing decision in PageTransition. The 0.6-second duration is long enough for the eye to register the transition as smooth, and short enough that fast-clicking visitors will not perceive it as a delay.Animation behaviour
PageTransition wraps its children in amotion.div with the following enter, active, and exit states:
[0.22, 1, 0.36, 1] — a fast-out-slow-in easing that mimics the natural deceleration of a physical object settling into place. The total duration is 0.6 seconds.
A second motion.div child renders a full-viewport overlay using .tie-dye-bg:
mix-blend-overlay, painting a brief wash of tie-dye colour across the transition. The rounded leading edge (50% border-radius) gives it an organic, brush-stroke quality that then flattens to a straight edge as it accelerates across the screen. This overlay is z-40 and pointer-events-none, so it never blocks interaction.
AnimatePresence from Framer Motion manages the lifecycle of both the entering and exiting pages. It keeps the outgoing page mounted and animating out while the incoming page begins its entry animation, ensuring the two animations overlap smoothly rather than cutting between them.
The component reads useLocation() from React Router and passes pathname as the key prop to the motion.div. This tells Framer Motion to treat each route as a distinct element, triggering full enter and exit sequences on every navigation event.
Usage
PageTransition wraps the content of every route registered inassets/main.js. All nine portfolio pages use it:
- Home
- About
- Projects
- Skills
- Work experience
- Case studies
- Blog
- Contact
- Testimonials
min-h-screen w-full pt-24 pb-12 px-4 md:px-8 directly to the motion.div, page-level padding and minimum height are also handled by the component. Individual page components do not need to re-declare these layout constraints.