Rung Shift
dotmatrix/dotm-circular-14FreeComponent
A shifting DNA ladder where a bright horizontal rung steps row-by-row while side anchors sway and leave soft ghost echoes.
Install it
npx shadcn@latest add https://dotmatrix.zzzzshawn.cloud/r/dotm-circular-14.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 DotmCircular14Props = DotMatrixCommonProps;1314const STEP_COUNT = 30;15const BASE_OPACITY = 0.07;16const RUNG_OPACITY = 0.95;17const SIDE_OPACITY = 0.56;18const GHOST_OPACITY = 0.28;1920export function DotmCircular14({21 speed = 1.75,22 animated = true,23 hoverAnimated = false,24 ...rest25}: DotmCircular14Props) {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: 1650,35 speed36 });3738 const resolver = useMemo<DotAnimationResolver>(() => {39 return ({ row, col, phase }) => {40 if (!isWithinCircularMask(row, col)) {41 return { className: "dmx-inactive" };42 }4344 const x = col - 2;45 const y = row - 2;46 const phaseStep = reducedMotion || phase === "idle" ? 0 : Math.floor((animPhase) * 10);47 const activeRow = (phaseStep + 5) % 5;48 const rowDistance = Math.abs(row - activeRow);49 const swing = Math.sin((phaseStep / 10) * Math.PI * 2 + y * 0.9);50 const leftAnchor = Math.round(1 + swing);51 const rightAnchor = 4 - leftAnchor;5253 let opacity = BASE_OPACITY;54 if (row === activeRow && col >= leftAnchor && col <= rightAnchor) {55 opacity = RUNG_OPACITY;56 } else if ((col === leftAnchor || col === rightAnchor) && rowDistance <= 1) {57 opacity = SIDE_OPACITY;58 } else if ((col === leftAnchor || col === rightAnchor) && rowDistance === 2) {59 opacity = GHOST_OPACITY;60 }6162 if (x === 0 && y === 0 && rowDistance <= 1) {63 return { style: { opacity: Math.max(opacity, SIDE_OPACITY) } };64 }6566 return { style: { opacity } };67 };68 }, [reducedMotion, animPhase]);6970 return (71 <DotMatrixBase72 {...rest}73 size={rest.size ?? 36}74// … 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 |
