1
import { useSpring, animated } from "motion/react";
2
3
type OrbitProps = {
4
radius?: number;
5
speed?: number;
6
};
7
8
export function Orbit({ radius = 120, speed = 1 }: OrbitProps) {
9
const angle = useSpring(0, { stiffness: 80, damping: 20 });
10
11
const x = Math.cos(angle.get()) * radius;
12
const y = Math.sin(angle.get()) * radius;
13
14
return (
15
<animated.div
16
style={{ x, y }}
17
className="size-4 rounded-full bg-current"
18
/>
19
);
20
}