#Page exit animation with motion (framer)

1 messages · Page 1 of 1 (latest)

broken geyserBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

onyx ridge
#

Heres my Page as well ```"use client";
import Project from "@/components/Project";
import projectData from "@/utils/projectData.json";
import AnimText from "@/components/AnimText";
import NavBar from "@/components/NavBar";

export default function ProjectsPage() {
return (
<main className="flex min-h-screen flex-col items-center justify-center p-24">
<NavBar />
<h1 className="text-4xl md:text-6xl lg:text-8xl text-center">
<AnimText text="PROJECTS" offset={0.55} />
</h1>
<div className="mt-10 w-full max-w-4xl">
{projectData.map((project, index) => (
<Project key={project.id} project={project} index={index} />
))}
</div>
</main>
);
}

#

should the page not be waiting on exit and fading out? im a little confused

#

im realizing now that next app router is internal and different from the og page router

#

any help navigating this is still appreciated

onyx ridge
#

for example why wouldt something like this: ```"use client";

import { usePathname } from "next/navigation";
import { AnimatePresence, motion } from "framer-motion";
// import type { Metadata } from 'next';
import { Inter } from "next/font/google";
import "./globals.css";

const inter = Inter({
variable: "--font-inter",
subsets: ["latin"],
});

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const pathname = usePathname();

return (
<html lang="en">
<body className={${inter.variable} antialiased}>
<AnimatePresence mode="wait" initial={false}>
<motion.div
key={pathname}
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -20 }}
transition={{ duration: 0.3 }}
>
{children}
</motion.div>
</AnimatePresence>
</body>
</html>
);
}