Hello! i'm trying to use barbajs + gsap for page transitions, I followed the barba js docs and tried to implemet the basic fade example importing them in the in my Layout.astro file, but only the fade out workds the fade in doesn't work.
What could be wrong?
---
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>blog</title>
</head>
<body
class="h-screen flex flex-col justify-between bg-zinc-50 dark:bg-onyx-900"
data-barba="wrapper"
>
<main
class="flex-1 flex flex-col w-full mx-auto max-w-screen-2xl px-4"
data-barba="container"
>
<Header />
<slot />
</main>
<Footer />
</body>
</html>
<script>
import barba from "@barba/core";
import { gsap } from "gsap";
barba.init({
transitions: [
{
name: "opacity-transition",
leave(data) {
return gsap.to(data.current.container, {
opacity: 0,
});
},
enter(data) {
return gsap.from(data.next.container, {
opacity: 0,
});
},
},
],
});
</script>