feat: add support for view transitions#1532
Closed
marvinhagemeister wants to merge 8 commits into
Closed
Conversation
Contributor
Author
|
Updated video: fresh-view_ransitions_3.mp4(I know it's not the prettiest animation, it's just to show that it works) |
This was referenced Aug 8, 2023
4 tasks
4 tasks
|
Dear Santa... really looking forward to it! |
Contributor
|
Do you think this will eventually work with partials? |
|
still on cards? |
bartlomieju
added a commit
that referenced
this pull request
Mar 26, 2026
Integrates the View Transitions API into Fresh's existing partials
system. When enabled via the `f-view-transition` attribute, partial
updates are wrapped in `document.startViewTransition()` for smooth
animated transitions between pages.
Usage:
<body f-client-nav f-view-transition>
The API is opt-in and progressive:
- Only activates when `f-view-transition` attribute is present
- Falls back to regular updates when the View Transitions API
is not supported by the browser
- Works with all navigation types: link clicks, popstate, and
form submissions
Users can customize animations via standard CSS:
::view-transition-old(root) { animation: ... }
::view-transition-new(root) { animation: ... }
Supersedes #1532
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
Contributor
|
Closing in favor of #3708 which integrates View Transitions into Fresh 2.x's existing partials system. Instead of a parallel navigation system, the new approach wraps partial updates in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is a very rough draft for natively supporting view transitions in Fresh. It's inspired by the recent astro announcement. I quite like the way they handle the CSS generation via attributes.
Keep in mind that this is a very early prototype.
Rough demo:
fresh-view-transitions.mp4
TODO: