Checker Shift
cellforge/cell-orbit-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://cellforge.dev/r/cell-orbit-17.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 CellOrbit17Props = CellForgeCommonProps;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 CellOrbit17({21 speed = 1.55,22 animated = true,23 hoverAnimated = false,24 ...rest25}: CellOrbit17Props) {26 const reducedMotion = usePrefersReducedMotion();27 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({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 <CellForgeBase67 {...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 @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 |
