Rail Scan
cellforge/cell-orbit-16FreeComponent
A braille rail scanline sweeps row-by-row between left and right cells, with near-column accents and soft trail falloff.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-16.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 CellOrbit16Props = CellForgeCommonProps;1314const STEP_COUNT = 25;15const BASE_OPACITY = 0.07;16const MID_OPACITY = 0.32;17const HIGH_OPACITY = 0.95;1819export function CellOrbit16({20 speed = 1.1,21 animated = true,22 hoverAnimated = false,23 ...rest24}: CellOrbit16Props) {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: 1700,34 speed35 });3637 const resolver = useMemo<DotAnimationResolver>(() => {38 return ({ row, col, phase }) => {39 if (!isWithinCircularMask(row, col)) {40 return { className: "dmx-inactive" };41 }4243 // Discrete steps: animPhase is continuous in [0, 1); fractional `t` breaks row === checks.44 const t =45 reducedMotion || phase === "idle" ? 0 : Math.floor(animPhase * STEP_COUNT) % STEP_COUNT;46 const activeRow = t % 5;47 const activeBrailleCol = Math.floor((t / 5) * 2) % 2; // left or right cell rail48 const railCol = activeBrailleCol === 0 ? 1 : 3;49 const nearCol = activeBrailleCol === 0 ? 2 : 2;50 const rowDistance = Math.abs(row - activeRow);5152 let opacity = BASE_OPACITY;53 if (col === railCol && rowDistance === 0) {54 opacity = HIGH_OPACITY;55 } else if (col === railCol && rowDistance === 1) {56 opacity = MID_OPACITY;57 } else if (col === nearCol && rowDistance === 0) {58 opacity = 0.52;59 } else if ((col === 1 || col === 3) && rowDistance === 2) {60 opacity = 0.24;61 }6263 return { style: { opacity } };64 };65 }, [reducedMotion, animPhase]);6667 return (68 <CellForgeBase69 {...rest}70 size={rest.size ?? 36}71 dotSize={rest.dotSize ?? 5}72 speed={speed}73 pattern="full"74 animated={animated}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 |
