Radar Arc
cellforge/cell-orbit-4FreeComponent
A rotating radar arm scans the circular grid with a bright beam front, soft wake, and faint perimeter ring echo.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-4.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 CellOrbit4Props = CellForgeCommonProps;1314const BASE_OPACITY = 0.08;15const SWEEP_OPACITY = 0.96;16const NEAR_SWEEP_OPACITY = 0.36;17const RING_OPACITY = 0.22;1819export function CellOrbit4({20 speed = 1.55,21 animated = true,22 hoverAnimated = false,23 ...rest24}: CellOrbit4Props) {25 const reducedMotion = usePrefersReducedMotion();26 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({27 animated: Boolean(animated && !reducedMotion),28 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),29 speed30 });31 const phase = useCyclePhase({32 active: !reducedMotion && matrixPhase !== "idle",33 cycleMsBase: 1800,34 speed35 });3637 const resolver = useMemo<DotAnimationResolver>(() => {38 return ({ row, col, phase: p }) => {39 if (!isWithinCircularMask(row, col)) {40 return { className: "dmx-inactive" };41 }4243 const centerRow = row - 2;44 const centerCol = col - 2;45 const radius = Math.hypot(centerRow, centerCol);46 const theta = (reducedMotion || p === "idle" ? 0 : phase) * Math.PI * 2;47 const sweepX = Math.cos(theta);48 const sweepY = Math.sin(theta);49 const projection = centerCol * sweepX + centerRow * sweepY;50 const perpendicular = Math.abs(centerCol * sweepY - centerRow * sweepX);5152 if (radius < 0.5) {53 return { style: { opacity: 0.62 } };54 }5556 if (projection > 0.3 && perpendicular < 0.55) {57 return { style: { opacity: SWEEP_OPACITY } };58 }5960 if (projection > 0 && perpendicular < 1.15) {61 return { style: { opacity: NEAR_SWEEP_OPACITY } };62 }6364 if (radius > 1.6 && radius < 2.3) {65 return { style: { opacity: RING_OPACITY } };66 }6768 return { style: { opacity: BASE_OPACITY } };69 };70 }, [reducedMotion, phase]);7172 return (73 <CellForgeBase74 {...rest}75 size={rest.size ?? 36}76 dotSize={rest.dotSize ?? 5}77 speed={speed}78 pattern="full"79 animated={animated}80// … 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 |
