-
-
Notifications
You must be signed in to change notification settings - Fork 433
Element transitions between pages #778
Comments
To make it work, I guess the sapper router would check if there are any keyed elements inside the current page (and layout) component, see if there are any matching keyed elements on the new page (or layout) component, and then create a FLIP transition between them. |
Looks like @Rich-Harris already thought of that as "Scenario 3" in this issue sveltejs/svelte#1431 ... But this hasn't been implemented, right? |
Okay, I figured it out how to do this without modifying the Svelte source code except for a tiny tweak: sveltejs/svelte#3175 updated my blog post, too: https://dev.to/buhrmi/svelte-component-transitions-5ie |
hmmmm...sorry if my question is simple but how can I do a simple fade-out-and-in between two routes in sapper? I’m Vie there is a simple wrapper component, and that’s it. Haven’t figured it out in svelte/sapper yet, however. |
@rchrdnsh you could wrap your page in |
…e titles and images when transitioning routes. The biggest sticking point was that I wanted to be able to (for this first pass), keep the word "Ouroboros" on-screen when transitioning back-and-forth between the "projects" page and `routes/ouroboros/index.svelte`. The key seems to be making sure that every component involved in animations gets its _entire_ contents wrapped in a `div.route-animation-container`. Maybe this is why @buhrmi chose <main> as the place to hook `position:absolute` in the example I used to work this out: sveltejs/sapper#778 Should I follow suit? TBD.
@buhrmi So how did you solve the old page not being removed? I can see that the code from your post works, but when I try to add animations myself that same issue arises. If I am to build my own site with this, I'd rather not depend on some unknown magic in your code, haha. |
Here is an interesting site demonstrating element transitions when navigating between pages. I thought it would be cool if sapper could do something like this natively with the
animate
directive. So, for example:index.html:
detail.html:
And between navigation, sapper would find the element with the same ID or key, and automatically apply a flip animation.
The text was updated successfully, but these errors were encountered: