Binary Bloom
cellforge/cell-orbit-10FreeComponent
Binary-style opacity tiers pulse in modular steps so only a few cells peak at once while others stay low, producing a crisp coded bloom.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-10.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 CellOrbit10Props = CellForgeCommonProps;1314const BASE_OPACITY = 0.06;15const LOW_OPACITY = 0.2;16const MID_OPACITY = 0.48;17const HIGH_OPACITY = 0.94;1819function moduloDistance(a: number, b: number, mod: number): number {20 const raw = Math.abs(a - b);21 return Math.min(raw, mod - raw);22}2324export function CellOrbit10({25 speed = 1.75,26 animated = true,27 hoverAnimated = false,28 ...rest29}: CellOrbit10Props) {30 const reducedMotion = usePrefersReducedMotion();31 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({32 animated: Boolean(animated && !reducedMotion),33 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),34 speed35 });36 const animPhase = useCyclePhase({37 active: !reducedMotion && matrixPhase !== "idle",38 cycleMsBase: 1600,39 speed40 });4142 const resolver = useMemo<DotAnimationResolver>(() => {43 return ({ row, col, phase }) => {44 if (!isWithinCircularMask(row, col)) {45 return { className: "dmx-inactive" };46 }4748 const x = col - 2;49 const y = row - 2;50 const ring = Math.round(Math.sqrt(x * x + y * y));51 const tick = reducedMotion || phase === "idle" ? 0 : Math.floor((animPhase) * 10);52 const cellCode = (row * 3 + col * 5 + ring * 2) % 10;53 const d = moduloDistance(cellCode, tick, 10);54 const parityGate = (row + col + tick) % 2 === 0;5556 let opacity = BASE_OPACITY;57 if (d === 0) {58 opacity = HIGH_OPACITY;59 } else if (d === 1) {60 opacity = MID_OPACITY;61 } else if (d === 2 || parityGate) {62 opacity = LOW_OPACITY;63 }6465 if (x === 0 && y === 0) {66 return { style: { opacity: Math.max(opacity, MID_OPACITY) } };67 }6869 return { style: { opacity } };70 };71 }, [reducedMotion, animPhase]);7273 return (74 <CellForgeBase75 {...rest}76 size={rest.size ?? 36}77 dotSize={rest.dotSize ?? 5}78 speed={speed}79 pattern="full"80 animated={animated}81 phase={matrixPhase}82// … 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 |
