mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: use a lighter loading indicator
This commit is contained in:
parent
df12731026
commit
feebdfcfe9
1 changed files with 42 additions and 31 deletions
|
|
@ -7,44 +7,55 @@ const variants = {
|
||||||
exit: { opacity: 0, x: 0, y: 0 },
|
exit: { opacity: 0, x: 0, y: 0 },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Animation variants for the dots
|
||||||
|
const dotVariants = {
|
||||||
|
initial: { scale: 0.8, opacity: 0.4 },
|
||||||
|
animate: (i: number) => ({
|
||||||
|
scale: [0.8, 1.2, 0.8],
|
||||||
|
opacity: [0.4, 1, 0.4],
|
||||||
|
transition: {
|
||||||
|
duration: 1.5,
|
||||||
|
repeat: Infinity,
|
||||||
|
delay: i * 0.2,
|
||||||
|
ease: "easeInOut"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function PageLoading() {
|
function PageLoading() {
|
||||||
return (
|
return (
|
||||||
<motion.main
|
<motion.main
|
||||||
variants={variants} // Pass the variant object into Framer Motion
|
variants={variants}
|
||||||
initial="hidden" // Set the initial state to variants.hidden
|
initial="hidden"
|
||||||
animate="enter" // Animated state to variants.enter
|
animate="enter"
|
||||||
exit="exit" // Exit state (used later) to variants.exit
|
exit="exit"
|
||||||
transition={{ type: 'linear' }} // Set the transition to linear
|
transition={{ type: 'linear' }}
|
||||||
className=""
|
className=""
|
||||||
>
|
>
|
||||||
<div className="max-w-7xl mx-auto px-4 py-20 transition-all">
|
<div className="max-w-7xl mx-auto px-4 py-20 transition-all">
|
||||||
<div className="animate-pulse mx-auto flex space-x-4">
|
<div className="flex flex-col items-center justify-center h-40">
|
||||||
<svg
|
{/* Animated dots */}
|
||||||
className="mx-auto"
|
<div className="flex space-x-4">
|
||||||
width="295"
|
{[0, 1, 2, 3, 4].map((i) => (
|
||||||
height="295"
|
<motion.div
|
||||||
viewBox="0 0 295 295"
|
key={i}
|
||||||
fill="none"
|
custom={i}
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
variants={dotVariants}
|
||||||
|
initial="initial"
|
||||||
|
animate="animate"
|
||||||
|
className="w-4 h-4 rounded-full bg-gray-500 dark:bg-gray-400"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<motion.p
|
||||||
|
className="mt-6 text-sm text-gray-500 dark:text-gray-400"
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: [0, 1, 0] }}
|
||||||
|
transition={{ duration: 2, repeat: Infinity }}
|
||||||
>
|
>
|
||||||
<rect
|
Loading...
|
||||||
opacity="0.51"
|
</motion.p>
|
||||||
x="6.5"
|
|
||||||
y="6.5"
|
|
||||||
width="282"
|
|
||||||
height="282"
|
|
||||||
rx="78.5"
|
|
||||||
stroke="#454545"
|
|
||||||
strokeOpacity="0.46"
|
|
||||||
strokeWidth="13"
|
|
||||||
strokeDasharray="11 11"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M135.8 200.8V130L122.2 114.6L135.8 110.4V102.8L122.2 87.4L159.8 76V200.8L174.6 218H121L135.8 200.8Z"
|
|
||||||
fill="#454545"
|
|
||||||
fillOpacity="0.13"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</motion.main>
|
</motion.main>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue