Pulse Pair
dotmatrix/dotm-circular-18FreeComponent
Mirrored braille dot pairs pulse from top and bottom toward the center, with a connective center-column accent.
Install it
npx shadcn@latest add https://dotmatrix.zzzzshawn.cloud/r/dotm-circular-18.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 DotmCircular18Props = DotMatrixCommonProps;1314const BASE_OPACITY = 0.07;15const MID_OPACITY = 0.33;16const HIGH_OPACITY = 0.95;1718export function DotmCircular18({19 speed = 1.75,20 animated = true,21 hoverAnimated = false,22 ...rest23}: DotmCircular18Props) {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 animPhase = useCyclePhase({31 active: !reducedMotion && matrixPhase !== "idle",32 cycleMsBase: 1550,33 speed34 });3536 const resolver = useMemo<DotAnimationResolver>(() => {37 return ({ row, col, phase }) => {38 if (!isWithinCircularMask(row, col)) {39 return { className: "dmx-inactive" };40 }4142 const t = reducedMotion || phase === "idle" ? 0 : Math.floor((animPhase) * 6);43 const pulseRow = t % 3; // 0..244 const topRow = pulseRow;45 const bottomRow = 4 - pulseRow;46 const pairCols = [1, 3];4748 let opacity = BASE_OPACITY;49 if ((row === topRow || row === bottomRow) && pairCols.includes(col)) {50 opacity = HIGH_OPACITY;51 } else if ((row === topRow || row === bottomRow) && col === 2) {52 opacity = 0.58;53 } else if ((row === 2 || col === 2) && pairCols.includes(col) === false) {54 opacity = MID_OPACITY;55 } else if (pairCols.includes(col)) {56 opacity = 0.22;57 }5859 return { style: { opacity } };60 };61 }, [reducedMotion, animPhase]);6263 return (64 <DotMatrixBase65 {...rest}66 size={rest.size ?? 36}67 dotSize={rest.dotSize ?? 5}68 speed={speed}69 pattern="full"70 animated={animated}71 phase={matrixPhase}72 onMouseEnter={onMouseEnter}73 onMouseLeave={onMouseLeave}74 reducedMotion={reducedMotion}75 animationResolver={resolver}76 />77 );78}
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 |
