MCPcopy Create free account
hub / github.com/SyntaxUI/syntaxui / SpiralLoader

Function SpiralLoader

src/showcase/components/loaders/SpiralLoader.tsx:6–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { motion } from 'framer-motion'
5
6const SpiralLoader = () => {
7 const dots = 8
8 const radius = 20
9
10 return (
11 <div className="relative h-16 w-16">
12 {[...Array(dots)].map((_, index) => {
13 const angle = (index / dots) * (2 * Math.PI)
14 const x = radius * Math.cos(angle)
15 const y = radius * Math.sin(angle)
16
17 return (
18 <motion.div
19 key={index}
20 className="absolute h-3 w-3 rounded-full bg-red-500"
21 style={{
22 left: `calc(50% + ${x}px)`,
23 top: `calc(50% + ${y}px)`,
24 }}
25 animate={{
26 scale: [0, 1, 0],
27 opacity: [0, 1, 0],
28 }}
29 transition={{
30 duration: 1.5,
31 repeat: Infinity,
32 delay: (index / dots) * 1.5,
33 ease: 'easeInOut',
34 }}
35 />
36 )
37 })}
38 </div>
39 )
40}
41
42export default SpiralLoader

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected