|
@@ -18,11 +18,10 @@ import Script from "next/script";
|
|
|
|
|
|
import { setupFontSize } from "@/utils";
|
|
|
import { Local } from "@/utils/storage";
|
|
|
-import { motion } from "framer-motion";
|
|
|
+import { AnimatePresence, motion } from "framer-motion";
|
|
|
|
|
|
import Image from "next/image";
|
|
|
import styles from "./style.module.scss";
|
|
|
-import PageTransitionEffect from "@/components/PageTransitionEffect";
|
|
|
|
|
|
export interface ProvidersProps {
|
|
|
children: ReactNode;
|
|
@@ -195,7 +194,7 @@ const GlobalNotify = () => {
|
|
|
alt={""}
|
|
|
width={750}
|
|
|
className={
|
|
|
- "animate-slow-bounce absolute -top-[0.5rem] left-0 h-[3.2rem]"
|
|
|
+ "absolute -top-[0.5rem] left-0 h-[3.2rem] animate-slow-bounce"
|
|
|
}
|
|
|
height={512}
|
|
|
/>
|
|
@@ -235,6 +234,7 @@ const GlobalNotify = () => {
|
|
|
|
|
|
const Layout = ({ children, themeProps }: ProvidersProps) => {
|
|
|
const pathname = usePathname();
|
|
|
+ const key = usePathname();
|
|
|
|
|
|
const { isCollapse, setCollapse } = useSystemStore((state) => ({
|
|
|
isCollapse: state.isCollapse,
|
|
@@ -297,7 +297,19 @@ const Layout = ({ children, themeProps }: ProvidersProps) => {
|
|
|
className={clsx(isShowBg && styles.homePage, "relative h-[100%]")}
|
|
|
ref={homeContainerRef}
|
|
|
>
|
|
|
- {children}
|
|
|
+ <AnimatePresence mode="popLayout">
|
|
|
+ <motion.div
|
|
|
+ layout
|
|
|
+ key={key}
|
|
|
+ initial={{ opacity: 0 }}
|
|
|
+ animate={{ opacity: 1 }}
|
|
|
+ exit={{ opacity: 0 }}
|
|
|
+ transition={{ type: "linear", duration: 0.5 }}
|
|
|
+ className={"h-[100%]"}
|
|
|
+ >
|
|
|
+ {children}
|
|
|
+ </motion.div>
|
|
|
+ </AnimatePresence>
|
|
|
</section>
|
|
|
</SwiperSlide>
|
|
|
</Swiper>
|