Gate Shift
dotmatrix/dotm-circular-7FreeComponent
A scanning gate flips between vertical and horizontal sweeps, producing a crisp alternating shutter rhythm in the circular grid.
Install it
npx shadcn@latest add https://dotmatrix.zzzzshawn.cloud/r/dotm-circular-7.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 DotmCircular7Props = DotMatrixCommonProps;1314const BASE_OPACITY = 0.08;15const GATE_OPACITY = 0.92;1617export function DotmCircular7({18 speed = 1.8,19 animated = true,20 hoverAnimated = false,21 ...rest22}: DotmCircular7Props) {23 const reducedMotion = usePrefersReducedMotion();24 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useDotMatrixPhases({25 animated: Boolean(animated && !reducedMotion),26 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),27 speed28 });29 const phase = useCyclePhase({30 active: !reducedMotion && matrixPhase !== "idle",31 cycleMsBase: 1600,32 speed33 });3435 const resolver = useMemo<DotAnimationResolver>(() => {36 return ({ row, col, phase: p }) => {37 if (!isWithinCircularMask(row, col)) {38 return { className: "dmx-inactive" };39 }4041 const x = col - 2;42 const y = row - 2;43 const t = reducedMotion || p === "idle" ? 0 : (phase) * Math.PI * 2;44 const ring = Math.sqrt(x * x + y * y);45 const angle = Math.atan2(y, x);4647 const petalWave = 0.5 + 0.5 * Math.cos(5 * angle - t * 1.7);48 const ringWave = 0.5 + 0.5 * Math.cos(ring * 3.3 - t * 1.2);49 const chordWave = 0.5 + 0.5 * Math.cos((x + y) * 1.6 + t * 1.35);5051 // Sharpen contrast so lit cells form clear, visible groups.52 const petalGate = Math.pow(petalWave, 2.2);53 const blend = 0.68 * petalGate + 0.22 * ringWave + 0.1 * chordWave;54 const opacity = BASE_OPACITY + (GATE_OPACITY - BASE_OPACITY) * blend;5556 return { style: { opacity } };57 };58 }, [reducedMotion, phase]);5960 return (61 <DotMatrixBase62 {...rest}63 size={rest.size ?? 36}64 dotSize={rest.dotSize ?? 5}65 speed={speed}66 pattern="full"67 animated={animated}68 phase={matrixPhase}69 onMouseEnter={onMouseEnter}70 onMouseLeave={onMouseLeave}71 reducedMotion={reducedMotion}72 animationResolver={resolver}73 />74 );75}
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 |
