Checker Shift
dotmatrix/dotm-circular-17FreeComponent
Braille-biased checker phases alternate in stepped shifts, keeping rails pronounced while the center cross supports readability.
Install it
npx shadcn@latest add https://dotmatrix.zzzzshawn.cloud/r/dotm-circular-17.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 DotmCircular17Props = DotMatrixCommonProps;1314const BASE_OPACITY = 0.07;15const MID_OPACITY = 0.34;16const HIGH_OPACITY = 0.95;17/** Discrete checker frames per loop (must stay integer for `(row + col + t) % 2`). */18const CHECKER_STEPS = 4;1920export function DotmCircular17({21 speed = 1.55,22 animated = true,23 hoverAnimated = false,24 ...rest25}: DotmCircular17Props) {26 const reducedMotion = usePrefersReducedMotion();27 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useDotMatrixPhases({28 animated: Boolean(animated && !reducedMotion),29 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),30 speed31 });32 const animPhase = useCyclePhase({33 active: !reducedMotion && matrixPhase !== "idle",34 cycleMsBase: 1500,35 speed36 });3738 const resolver = useMemo<DotAnimationResolver>(() => {39 return ({ row, col, phase: dmxPhase }) => {40 if (!isWithinCircularMask(row, col)) {41 return { className: "dmx-inactive" };42 }4344 const holdStill = reducedMotion || dmxPhase === "idle";45 const t = holdStill46 ? 047 : Math.floor(animPhase * CHECKER_STEPS) % CHECKER_STEPS;48 const parity = (row + col + t) % 2;49 const brailleBias = col === 1 || col === 3;50 const centerBias = row === 2 || col === 2;5152 let opacity = BASE_OPACITY;53 if (parity === 0 && brailleBias) {54 opacity = HIGH_OPACITY;55 } else if (parity === 0 || centerBias) {56 opacity = MID_OPACITY;57 } else if (brailleBias) {58 opacity = 0.24;59 }6061 return { style: { opacity } };62 };63 }, [reducedMotion, animPhase]);6465 return (66 <DotMatrixBase67 {...rest}68 size={rest.size ?? 36}69 dotSize={rest.dotSize ?? 5}70 speed={speed}71 pattern="full"72 animated={animated}73 phase={matrixPhase}74 onMouseEnter={onMouseEnter}75 onMouseLeave={onMouseLeave}76 reducedMotion={reducedMotion}77 animationResolver={resolver}78 />79 );80}
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 |
