page transition a-la-darkroom #87
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new GSAP-powered page transition feature, allowing for smooth, customizable transitions between pages using the
TransitionLinkcomponent and related utilities. The feature is opt-in via environment variables and includes comprehensive documentation and demo pages to showcase its usage and benefits compared to alternatives like the View Transitions API. The implementation is modular, with state management handled by Zustand and animation logic encapsulated in a reusable overlay component.New GSAP Page Transition Feature
Feature Implementation:
page-transitionmodule (components/layout/page-transition/) including the mainPageTransitionoverlay component, transition state management with Zustand (store.ts), theTransitionLinkcomponent for navigation, and supporting styles (page-transition.module.css). This enables GSAP-powered transitions such as fade, slide, and reveal, with programmatic and declarative APIs. [1] [2] [3] [4]Demo and Example Pages:
app/(examples)/transitions/) to showcase transition types and usage, includingTransitionDemo,BackLink, and example transition routes. These demonstrate how to use the new transition API in practice. [1] [2] app/(examples)/transitions/[type]/page.tsxR1-R38, app/(examples)/transitions/[type]/_components/back-link.tsxR1-R37)Documentation Updates:
README.mdandcomponents/README.mdto document the new feature, its environment variable toggles, usage examples, and a comparison with other transition solutions. [1] [2]Environment Variable Configuration:
.env.examplefor easy configuration.Summary:
This PR adds a robust, opt-in page transition system using GSAP, complete with documentation, demo pages, and configuration options, making it easy to add smooth, customizable transitions to the app.