Rung Shift
cellforge/cell-orbit-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://cellforge.dev/r/cell-orbit-14.jsonSource
1"use client";23import { useMemo } from "react";45import { CellForgeBase } from "@/components/ui/cellforge-core";6import { useCellForgePhases } from "@/components/ui/cellforge-hooks";7import { isWithinCircularMask } from "@/components/ui/cellforge-core";8import { useCyclePhase } from "@/components/ui/cellforge-hooks";9import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";10import type { DotAnimationResolver, CellForgeCommonProps } from "@/components/ui/cellforge-core";1112export type CellOrbit14Props = CellForgeCommonProps;1314const BASE_OPACITY = 0.07;15const RUNG_OPACITY = 0.95;16const SIDE_OPACITY = 0.56;17const GHOST_OPACITY = 0.28;1819export function CellOrbit14({20 speed = 1.75,21 animated = true,22 hoverAnimated = false,23 ...rest24}: CellOrbit14Props) {25 const reducedMotion = usePrefersReducedMotion();26 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({27 animated: Boolean(animated && !reducedMotion),28 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),29 speed30 });31 const animPhase = useCyclePhase({32 active: !reducedMotion && matrixPhase !== "idle",33 cycleMsBase: 1650,34 speed35 });3637 const resolver = useMemo<DotAnimationResolver>(() => {38 return ({ row, col, phase }) => {39 if (!isWithinCircularMask(row, col)) {40 return { className: "dmx-inactive" };41 }4243 const x = col - 2;44 const y = row - 2;45 const phaseStep = reducedMotion || phase === "idle" ? 0 : Math.floor((animPhase) * 10);46 const activeRow = (phaseStep + 5) % 5;47 const rowDistance = Math.abs(row - activeRow);48 const swing = Math.sin((phaseStep / 10) * Math.PI * 2 + y * 0.9);49 const leftAnchor = Math.round(1 + swing);50 const rightAnchor = 4 - leftAnchor;5152 let opacity = BASE_OPACITY;53 if (row === activeRow && col >= leftAnchor && col <= rightAnchor) {54 opacity = RUNG_OPACITY;55 } else if ((col === leftAnchor || col === rightAnchor) && rowDistance <= 1) {56 opacity = SIDE_OPACITY;57 } else if ((col === leftAnchor || col === rightAnchor) && rowDistance === 2) {58 opacity = GHOST_OPACITY;59 }6061 if (x === 0 && y === 0 && rowDistance <= 1) {62 return { style: { opacity: Math.max(opacity, SIDE_OPACITY) } };63 }6465 return { style: { opacity } };66 };67 }, [reducedMotion, animPhase]);6869 return (70 <CellForgeBase71 {...rest}72 size={rest.size ?? 36}73 dotSize={rest.dotSize ?? 5}74 speed={speed}75// … truncated
More from @cellforge
All 71 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| All CellForge Loadersall | @cellforge | Components | Free | no deps | |
| Core Spokescell-angle-1 | @cellforge | Components | Free | no deps | |
| Column Rakecell-angle-10 | @cellforge | Components | Free | no deps | |
| Shelf Descentcell-angle-11 | @cellforge | Components | Free | no deps | |
| Skew Driftcell-angle-12 | @cellforge | Components | Free | no deps | |
| Serpent Zipcell-angle-13 | @cellforge | Components | Free | no deps | |
| Pillar Sweepcell-angle-14 | @cellforge | Components | Free | no deps | |
| Tripod Handoffcell-angle-15 | @cellforge | Components | Free | no deps |
