Radar Arc
dotmatrix/dotm-circular-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://dotmatrix.zzzzshawn.cloud/r/dotm-circular-4.jsonSource
1"use client";23import { useMemo } from "react";45import { DotMatrixBase } from "@/components/ui/dotmatrix-core";6import { useDotMatrixPhases } from "@/components/ui/dotmatrix-hooks";7import { isWithinCircularMask } from "@/components/ui/dotmatrix-core";8import { useCyclePhase } from "@/components/ui/dotmatrix-hooks";9import { usePrefersReducedMotion } from "@/components/ui/dotmatrix-hooks";10import type { DotAnimationResolver, DotMatrixCommonProps } from "@/components/ui/dotmatrix-core";1112export type DotmCircular4Props = DotMatrixCommonProps;1314const BASE_OPACITY = 0.08;15const SWEEP_OPACITY = 0.96;16const NEAR_SWEEP_OPACITY = 0.36;17const RING_OPACITY = 0.22;1819export function DotmCircular4({20 speed = 1.55,21 animated = true,22 hoverAnimated = false,23 ...rest24}: DotmCircular4Props) {25 const reducedMotion = usePrefersReducedMotion();26 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useDotMatrixPhases({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 <DotMatrixBase74 {...rest}75 size={rest.size ?? 36}76 dotSize={rest.dotSize ?? 5}77 speed={speed}78 pattern="full"79 animated={animated}80// … truncated
More from @dotmatrix
All 91 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| All Dot Matrix Loadersall | @dotmatrix | Components | Free | no deps | |
| Square Spiraldotm-3x3-1 | @dotmatrix | Components | Free | no deps | |
| Frame Chasedotm-3x3-10 | @dotmatrix | Components | Free | no deps | |
| Glyph Pulsedotm-3x3-11 | @dotmatrix | Components | Free | no deps | |
| Drop Rippledotm-3x3-12 | @dotmatrix | Components | Free | no deps | |
| Right Surgedotm-3x3-13 | @dotmatrix | Components | Free | no deps | |
| Comet Traildotm-3x3-14 | @dotmatrix | Components | Free | no deps | |
| Echo Ringsdotm-3x3-15 | @dotmatrix | Components | Free | no deps |
