Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New loading spinner #457

Merged
merged 4 commits into from
Nov 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update RotatingLoader.component.tsx
w3bdesign committed Nov 10, 2024
commit a38bb74b6fff56065880d3dd472c57e04bcc9bfb
71 changes: 28 additions & 43 deletions src/components/Animations/RotatingLoader.component.tsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,39 @@
import { motion } from "framer-motion";


/**
* RotatingLoader component
* Renders a rotating loader animation with four circular elements
* Renders a rotating loader animation with Matrix theme
* @returns {JSX.Element} The rendered RotatingLoader component
*/
export default function RotatingLoader() {
const rotateVariants = {
rotate: {
rotate: 360,
transition: {
duration: 1.5,
repeat: Infinity,
ease: "linear",
},
},
};

export default function RotatingLoader() {
return (
<div className="flex items-center justify-center">
<motion.div
className="relative h-12 w-12"
variants={rotateVariants}
animate="rotate"
<div className="grid min-h-[140px] w-full place-items-center overflow-x-scroll rounded-lg p-6 lg:overflow-visible">
<svg
className="animate-spin"
viewBox="0 0 64 64"
fill="none"
xmlns="http://www.w3.org/2000/svg"
width="64"
height="64"
style={{ filter: 'drop-shadow(0 0 10px #00FF00)' }}
>
<motion.div
className="absolute left-0 top-0 h-4 w-4 rounded-full bg-green-500"
initial="initial"
animate="animate"
transition={{ delay: 0 }}
></motion.div>
<motion.div
className="absolute right-0 top-0 h-4 w-4 rounded-full bg-green-500"
initial="initial"
animate="animate"
transition={{ delay: 0.2 }}
></motion.div>
<motion.div
className="absolute bottom-0 left-0 h-4 w-4 rounded-full bg-green-500"
initial="initial"
animate="animate"
transition={{ delay: 0.4 }}
></motion.div>
<motion.div
className="absolute bottom-0 right-0 h-4 w-4 rounded-full bg-green-500"
initial="initial"
animate="animate"
transition={{ delay: 0.6 }}
></motion.div>
</motion.div>
<path
d="M32 3C35.8083 3 39.5794 3.75011 43.0978 5.20749C46.6163 6.66488 49.8132 8.80101 52.5061 11.4939C55.199 14.1868 57.3351 17.3837 58.7925 20.9022C60.2499 24.4206 61 28.1917 61 32C61 35.8083 60.2499 39.5794 58.7925 43.0978C57.3351 46.6163 55.199 49.8132 52.5061 52.5061C49.8132 55.199 46.6163 57.3351 43.0978 58.7925C39.5794 60.2499 35.8083 61 32 61C28.1917 61 24.4206 60.2499 20.9022 58.7925C17.3837 57.3351 14.1868 55.199 11.4939 52.5061C8.801 49.8132 6.66487 46.6163 5.20749 43.0978C3.7501 39.5794 3 35.8083 3 32C3 28.1917 3.75011 24.4206 5.2075 20.9022C6.66489 17.3837 8.80101 14.1868 11.4939 11.4939C14.1868 8.80099 17.3838 6.66487 20.9022 5.20749C24.4206 3.7501 28.1917 3 32 3L32 3Z"
stroke="#00FF00"
strokeWidth="3"
strokeLinecap="round"
strokeLinejoin="round"
></path>
<path
d="M32 3C36.5778 3 41.0906 4.08374 45.1692 6.16256C49.2477 8.24138 52.7762 11.2562 55.466 14.9605C58.1558 18.6647 59.9304 22.9531 60.6448 27.4748C61.3591 31.9965 60.9928 36.6232 59.5759 40.9762"
stroke="#00FF00"
strokeWidth="3"
strokeLinecap="round"
strokeLinejoin="round"
style={{ filter: 'brightness(1.5)' }}
></path>
</svg>
</div>
);
}