Orbit Component
This interactive component displays elements orbiting around a central point on the screen, simulating a solar system. Using the Orbit
component in your application, you can adjust the radius
prop to control the distance of the orbit.
Decrypt
Usage
To use the Orbit
component in your project, simply import it and set the radius
prop as shown below:
Source Code
To implement the orbital animation, update your tailwind.config.js
as follows:
Then, create the Orbit
component in @/app/components/Orbit.tsx
with the following structure:
Props
Prop | Type | Description | Default |
---|---|---|---|
className | string | The class name for the component | "" |
children | React.ReactNode | The children nodes of the component | null |
reverse | boolean | If true, the animation plays in reverse | false |
duration | number | The duration of the animation in seconds | 20 |
delay | number | The delay before the animation starts in seconds | 10 |
radius | number | The radius of the orbit in pixels | 50 |