Page slide transition

On navigation the current view slides out to the left and fades while the next view slides in from the right.

TransitionRoute change Pure CSS time-based Targets: Web · App All modern browsers; see notes for the View Transitions API variant
Inbox
Message
Target
Implement the "Page slide transition" effect in vanilla HTML/CSS/JS.

Context: On navigation the current view slides out to the left and fades while the next view slides in from the right.
Trigger: the route/page changes.
Timeline: time-based (duration + easing).

Motion tokens (normal):
- translateX (leaving): 0 → -30%
- opacity (leaving): 1 → 0
- translateX (entering): 100% → 0
- duration: 320ms
- easing: cubic-bezier(0.2, 0.8, 0.2, 1)
- note: back navigation mirrors the direction

Motion tokens (prefers-reduced-motion):
- opacity (leaving): 1 → 0
- opacity (entering): 0 → 1
- duration: 200ms
- easing: ease-out

Technique: prefer pure CSS transitions/animations; use JS only to toggle classes.

Acceptance:
- animate only transform and opacity unless the spec lists other properties
- no layout shift; content is visible without the animation
- when prefers-reduced-motion is set, use the reduced tokens only
- both views are position-absolute in a clipped container during the transition
- the leaving view is removed (or inert) after the animation ends

Generated from the spec. Prompts differ by target name only; the tokens are the source of truth.