-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add orbiting circles for community section on landing page
- Loading branch information
1 parent
49e1b60
commit e5317de
Showing
3 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from 'react'; // Ensure you have this import | ||
import { cn } from "@/lib/utils"; | ||
|
||
export interface OrbitingCirclesProps { | ||
className?: string; | ||
children?: React.ReactNode; | ||
reverse?: boolean; | ||
duration?: number; | ||
delay?: number; | ||
radius?: number; | ||
path?: boolean; | ||
} | ||
|
||
export function OrbitingCircles({ | ||
className, | ||
children, | ||
reverse, | ||
duration = 20, | ||
delay = 10, | ||
radius = 50, | ||
path = true, | ||
}: OrbitingCirclesProps) { | ||
return ( | ||
<> | ||
{path && ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
version="1.1" | ||
className="pointer-events-none absolute inset-0 size-full" | ||
> | ||
<circle | ||
className="stroke-black stroke-2 dark:stroke-black/40 invisible" | ||
cx="50%" | ||
cy="50%" | ||
r={radius} | ||
fill="none" | ||
/> | ||
</svg> | ||
)} | ||
|
||
<div | ||
style={{ | ||
"--duration": duration, | ||
"--radius": radius, | ||
"--delay": -delay, | ||
} as React.CSSProperties} | ||
className={cn( | ||
"absolute flex size-full transform-gpu animate-orbit items-center justify-center rounded-full border bg-black/10 [animation-delay:calc(var(--delay)*1000ms)] dark:bg-white/10", | ||
{ "[animation-direction:reverse]": reverse }, | ||
className, | ||
)} | ||
> | ||
{children} | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters