Halo Drift
cellforge/cell-orbit-1FreeComponent
A circular-masked half-helix that travels diagonally from top-left to bottom-right with a bright strand and soft adjacent trail.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-1.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 CellOrbit1Props = CellForgeCommonProps;1314const BASE_OPACITY = 0.08;15const STRAND_OPACITY = 1;16const NEAR_STRAND_OPACITY = 0.24;17const STEP_COUNT = 20;18const HELIX_LOOP_RADIANS = (Math.PI * 2) / (STEP_COUNT - 1);1920export function CellOrbit1({21 speed = 2.5,22 animated = true,23 hoverAnimated = false,24 ...rest25}: CellOrbit1Props) {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: 1700,35 speed36 });3738 const animationResolver = useMemo<DotAnimationResolver>(() => {39 return ({ row, col, phase }) => {40 if (!isWithinCircularMask(row, col)) {41 return { className: "dmx-inactive" };42 }4344 const t = reducedMotion || phase === "idle" ? 0 : animPhase * STEP_COUNT;45 const diagonalAxis = row + col;46 const phaseOffset = t * HELIX_LOOP_RADIANS + diagonalAxis * 0.82;47 const strandPerpendicular = Math.round(2 * Math.sin(phaseOffset));48 const cellPerpendicular = col - row;49 const distanceFromStrand = Math.abs(cellPerpendicular - strandPerpendicular);5051 if (distanceFromStrand === 0) {52 return { style: { opacity: STRAND_OPACITY } };53 }5455 if (distanceFromStrand === 1) {56 return { style: { opacity: NEAR_STRAND_OPACITY } };57 }5859 return { style: { opacity: BASE_OPACITY } };60 };61 }, [reducedMotion, animPhase]);6263 return (64 <CellForgeBase65 {...rest}66 size={rest.size ?? 36}67 dotSize={rest.dotSize ?? 5}68 speed={speed}69 pattern="full"70 animated={animated}71 phase={matrixPhase}72 onMouseEnter={onMouseEnter}73 onMouseLeave={onMouseLeave}74 reducedMotion={reducedMotion}75 animationResolver={animationResolver}76 />77 );78}
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 |
