-
Hey Swup folks, I've been a long-time user of barba.js, but I'm really digging swup and thinking of making the switch. Hoping to get it running smoothly for my next projects! I've encountered an issue with the animation sequences when navigating between pages. Situation: Problem: Expected Behavior: I believe there might be an underlying state management or event handling issue that's causing this behavior. Has anyone else experienced this, or can offer guidance on how to ensure the animations don't overlap or become out of sync when links are clicked mid-animation? Any insights or suggestions would be greatly appreciated. Thank you for your assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi @kkopp001 , thanks for bringing this up again. The promise-based nature of swup makes it very hard to exit/abort currently running page visits smoothly. It's a hard problem that probably would need a major overhaul of swup's internals. I'll create an issue so that we can think about this again. |
Beta Was this translation helpful? Give feedback.
-
@kkopp001 Out of curiosity, how does barba handle this scenario? When a new visit was just started and a new link is clicked in the meantime, how does barba ensure the current animation is ended correctly? Does it wait for the current visit to finish completely before starting the next visit? Is there a specific hook you can use to finish these types of animations? And what's the perfect scenario here? Finishing the current animation every time before starting the next one? Or finding a way to "short-circuit" the running animation and then immediately starting the next one? Or something else? |
Beta Was this translation helpful? Give feedback.
-
@daun In my experience with barba.js using JavaScript animations, it handles these scenarios by simply interrupting the current page transition animation and then starting the new one. There's no waiting for the current visit to finish completely before initiating the next; it's more about an immediate transition from one animation to the next. Regarding the ideal scenario, I believe it aligns with what I described in my initial message: "When a link is clicked during the animation:in:start phase, the current "in" animation should be properly interrupted or ended. The system should then start the "out" animation for the subsequent page request, ensuring the correct sequence of events: animation:out:start followed by animation:out:end." |
Beta Was this translation helpful? Give feedback.
-
@kkopp001 Rapid navigation has been greatly improved with swup 4.5. Could you install it and give us feedback here? 🙂 |
Beta Was this translation helpful? Give feedback.
@kkopp001 Rapid navigation has been greatly improved with swup 4.5. Could you install it and give us feedback here? 🙂