Phase Orb
cellforge/cell-orbit-6FreeComponent
An off-center orbiting energy point traces a phase-shifted loop, creating a drifting orbital glow inside the circular matrix.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-6.jsonSource
1"use client";23import { useMemo } from "react";45import { CellForgeBase } from "@/components/ui/cellforge-core";6import { useCellForgePhases } from "@/components/ui/cellforge-hooks";7import { isWithinCircularMask } from "@/components/ui/cellforge-core";8import { useCyclePhase } from "@/components/ui/cellforge-hooks";9import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";10import type { DotAnimationResolver, CellForgeCommonProps } from "@/components/ui/cellforge-core";1112export type CellOrbit6Props = CellForgeCommonProps;1314const BASE_OPACITY = 0.08;15const ORBIT_OPACITY = 0.96;16const NEAR_ORBIT_OPACITY = 0.34;1718export function CellOrbit6({19 speed = 1.6,20 animated = true,21 hoverAnimated = false,22 ...rest23}: CellOrbit6Props) {24 const reducedMotion = usePrefersReducedMotion();25 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({26 animated: Boolean(animated && !reducedMotion),27 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),28 speed29 });30 const phase = useCyclePhase({31 active: !reducedMotion && matrixPhase !== "idle",32 cycleMsBase: 1700,33 speed34 });3536 const resolver = useMemo<DotAnimationResolver>(() => {37 return ({ row, col, phase: p }) => {38 if (!isWithinCircularMask(row, col)) {39 return { className: "dmx-inactive" };40 }4142 const x = col - 2;43 const y = row - 2;44 const t = reducedMotion || p === "idle" ? 0 : (phase) * Math.PI * 2;45 const angle = Math.atan2(y, x);46 const ring = Math.sqrt(x * x + y * y);4748 const angularPhase = ((angle - t * 0.95 + Math.PI * 4) % (Math.PI * 2)) / ((Math.PI * 2) / 3);49 const sectorPos = angularPhase - Math.floor(angularPhase);50 const sectorPulse = Math.max(0, 1 - Math.abs(sectorPos - 0.5) * 2);51 const ringPhase = 0.5 + 0.5 * Math.cos(ring * 3.2 + t * 1.7);52 const score = 0.74 * sectorPulse + 0.26 * ringPhase;5354 let opacity = BASE_OPACITY;55 if (score > 0.84) {56 opacity = ORBIT_OPACITY;57 } else if (score > 0.63) {58 opacity = 0.62;59 } else if (score > 0.44) {60 opacity = NEAR_ORBIT_OPACITY;61 }6263 if (x === 0 && y === 0) {64 return { style: { opacity: Math.max(opacity, NEAR_ORBIT_OPACITY) } };65 }66 return { style: { opacity } };67 };68 }, [reducedMotion, phase]);6970 return (71 <CellForgeBase72 {...rest}73 size={rest.size ?? 36}74 dotSize={rest.dotSize ?? 5}75 speed={speed}76 pattern="full"77// … truncated
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 |
