-
Notifications
You must be signed in to change notification settings - Fork 715
[css-view-transitions-2] Should ViewTransition on cross-document navigations allow entry animations #8791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In case of transitioning-from-blank, what's the advantage of view transitions? There's no detailed "old" state which is where VT can do things regular css animations can't. The developer can use regular keyframe animations, and reuse animation names with VT. |
Fair point, if you want to do an animation with the root content of the new Document, that can be done with CSS animations itself. I'm good with not doing a ViewTransition unless both Documents opt-in. @vmpstr was curious about this use-case. |
Generally, the answer is simplicity. It's a similar answer to why have SPA view transitions. Entry animation with only "opt in to view transitions" is easier than any particular keyframe / animation set up that the developer could do. I'm also fine with not doing the transition, if that's easier, I was mostly wondering if there is a use-case here that could be easily solved. |
What would you be opting in to? Entry animations don't have an "old" state so they're inherently different in most cases than the old->new animations. To make them meaningful, you'd have to define keyframes especially for this case, e.g. to slide-in an element from "somewhere" rather than from the previous location. If you do that, why not just set those keyframes on the element itself rather than rely on captures and a new syntax?
Do you have an existing page to play with a use-case? I want to see if the current solution is lacking (applying keyframes on the actual element when there is no view-transition). |
In single-page-app view transitions, the default entry animation is to transition opacity from 0 to 1 while keeping the position/size at their destination values. Whereas I agree with you that one can design better animations, that seems to be a reasonable default that looks sufficiently different from not having an animation whatsoever |
I don't have a page in mind. There may be two reasons for the fact that these pages don't seem to be prevalent: either developers don't want an entry animation, or the entry animation is sufficiently difficult to make that it's not worth the effort. I don't know which it is. If it's the former, then let's not do an animation here, but if it's the latter, it seems a fairly easy capability to add in this feature |
Summarizing a conversation today:
Proposed Resolution: View Transition is only triggered when both the old/new Document opt-in. |
I believe that's what the current spec dictates, right? If so, this is close, no change |
#8048 details the syntax for a Document to opt-in to ViewTransitions on cross-document navigations. What happens if the old Document doesn't have this opt-in but the new Document does.
This could be used to do entry animations, like fading in the content of the new Document.
The text was updated successfully, but these errors were encountered: