feat: animate canvas backdrop changes
This commit is contained in:
1 file changed
+11
-2
@@ -1,3 +1,4 @@
|
|||||||
|
import { AnimatePresence, motion } from "motion/react";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useShallow } from "zustand/shallow";
|
import { useShallow } from "zustand/shallow";
|
||||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||||
@@ -17,7 +18,14 @@ export default function Backdrop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="app-backdrop-container">
|
<AnimatePresence mode="sync">
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
key={backdropHash}
|
||||||
|
exit={{ opacity: 0 }}
|
||||||
|
className="app-backdrop-container"
|
||||||
|
>
|
||||||
<BlurhashCanvas
|
<BlurhashCanvas
|
||||||
blurhashString={backdropHash}
|
blurhashString={backdropHash}
|
||||||
width={300}
|
width={300}
|
||||||
@@ -32,6 +40,7 @@ export default function Backdrop() {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user