Tri Orbit
cellforge/cell-orbit-2FreeComponent
Three luminous heads orbit the circular ring at equal offsets, creating a triad chase that never overlaps into the old snake rhythm.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-2.jsonSource
1"use client";23import type { CSSProperties } from "react";45import { CellForgeBase } from "@/components/ui/cellforge-core";6import { useCellForgePhases } from "@/components/ui/cellforge-hooks";7import { isWithinCircularMask } from "@/components/ui/cellforge-core";8import { rowMajorIndex } from "@/components/ui/cellforge-core";9import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";10import type { DotAnimationResolver, CellForgeCommonProps } from "@/components/ui/cellforge-core";1112export type CellOrbit2Props = CellForgeCommonProps;1314const RING_PATH: readonly number[] = [15 rowMajorIndex(0, 1),16 rowMajorIndex(0, 2),17 rowMajorIndex(0, 3),18 rowMajorIndex(1, 4),19 rowMajorIndex(2, 4),20 rowMajorIndex(3, 4),21 rowMajorIndex(4, 3),22 rowMajorIndex(4, 2),23 rowMajorIndex(4, 1),24 rowMajorIndex(3, 0),25 rowMajorIndex(2, 0),26 rowMajorIndex(1, 0)27];2829const LOOP_LEN = RING_PATH.length;30const BASE_OPACITY = 0.08;3132export function CellOrbit2({33 speed = 1.8,34 animated = true,35 hoverAnimated = false,36 ...rest37}: CellOrbit2Props) {38 const reducedMotion = usePrefersReducedMotion();39 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({40 animated: Boolean(animated && !reducedMotion),41 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),42 speed43 });44 const resolver: DotAnimationResolver = ({ index, row, col, phase }) => {45 if (!isWithinCircularMask(row, col)) {46 return { className: "dmx-inactive" };47 }4849 const onRing = RING_PATH.indexOf(index);50 if (onRing === -1) {51 return { style: { opacity: row === 2 && col === 2 ? 0.18 : BASE_OPACITY } };52 }5354 if (reducedMotion || phase === "idle") {55 return { style: { opacity: 0.28 + (onRing / (LOOP_LEN - 1)) * 0.58 } };56 }5758 return {59 className: "dmx-circular2-ring",60 style: { "--dmx-ring-order": onRing } as CSSProperties61 };62 };6364 return (65 <CellForgeBase66 {...rest}67 size={rest.size ?? 36}68 dotSize={rest.dotSize ?? 5}69 speed={speed}70 pattern="full"71 animated={animated}72 phase={matrixPhase}73 onMouseEnter={onMouseEnter}74 onMouseLeave={onMouseLeave}75 reducedMotion={reducedMotion}76 animationResolver={resolver}77 />78 );79}
More from @cellforge
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| All CellForge Loadersall | @cellforge | Components | Free | no deps | |
| Core Spokescell-angle-1 | @cellforge | Components | Free | no deps | |
| Column Rakecell-angle-10 | @cellforge | Components | Free | no deps | |
| Shelf Descentcell-angle-11 | @cellforge | Components | Free | no deps | |
| Skew Driftcell-angle-12 | @cellforge | Components | Free | no deps | |
| Serpent Zipcell-angle-13 | @cellforge | Components | Free | no deps | |
| Pillar Sweepcell-angle-14 | @cellforge | Components | Free | no deps | |
| Tripod Handoffcell-angle-15 | @cellforge | Components | Free | no deps |
