Phase Orb
dotmatrix/dotm-circular-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://dotmatrix.zzzzshawn.cloud/r/dotm-circular-6.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 DotmCircular6Props = DotMatrixCommonProps;1314const BASE_OPACITY = 0.08;15const ORBIT_OPACITY = 0.96;16const NEAR_ORBIT_OPACITY = 0.34;1718export function DotmCircular6({19 speed = 1.6,20 animated = true,21 hoverAnimated = false,22 ...rest23}: DotmCircular6Props) {24 const reducedMotion = usePrefersReducedMotion();25 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useDotMatrixPhases({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 <DotMatrixBase72 {...rest}73 size={rest.size ?? 36}74 dotSize={rest.dotSize ?? 5}75 speed={speed}76 pattern="full"77// … 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 |
