Twin Helix
cellforge/cell-orbit-13FreeComponent
A circular-masked twin-helix: mirrored side strands weave inward and outward with intermittent interior bridge pulses.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-13.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 { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";9import { useSteppedCycle } from "@/components/ui/cellforge-hooks";10import type { DotAnimationResolver, CellForgeCommonProps } from "@/components/ui/cellforge-core";1112export type CellOrbit13Props = CellForgeCommonProps;1314const STEP_COUNT = 28;15const BASE_OPACITY = 0.07;16const STRAND_OPACITY = 0.95;17const NEAR_STRAND_OPACITY = 0.5;18const BRIDGE_OPACITY = 0.3;1920export function CellOrbit13({21 speed = 1.55,22 animated = true,23 hoverAnimated = false,24 ...rest25}: CellOrbit13Props) {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 step = useSteppedCycle({33 active: !reducedMotion && matrixPhase !== "idle",34 cycleMsBase: 1750,35 steps: STEP_COUNT,36 speed,37 });3839 const resolver = useMemo<DotAnimationResolver>(() => {40 return ({ row, col, phase }) => {41 if (!isWithinCircularMask(row, col)) {42 return { className: "dmx-inactive" };43 }4445 const x = col - 2;46 const y = row - 2;47 const t = reducedMotion || phase === "idle" ? 0 : (step / STEP_COUNT) * Math.PI * 2;4849 const strandOffset = Math.sin(y * 1.35 + t * 1.3) * 1.15;50 const leftStrand = -strandOffset;51 const rightStrand = strandOffset;52 const leftDistance = Math.abs(x - leftStrand);53 const rightDistance = Math.abs(x - rightStrand);54 const strandDistance = Math.min(leftDistance, rightDistance);55 const bridgeOn = Math.cos(y * 2 + t * 2.1) > 0.55;56 const isBetweenStrands = x > Math.min(leftStrand, rightStrand) && x < Math.max(leftStrand, rightStrand);5758 let opacity = BASE_OPACITY;59 if (strandDistance < 0.34) {60 opacity = STRAND_OPACITY;61 } else if (strandDistance < 0.8) {62 opacity = NEAR_STRAND_OPACITY;63 } else if (bridgeOn && isBetweenStrands) {64 opacity = BRIDGE_OPACITY;65 }6667 return { style: { opacity } };68 };69 }, [reducedMotion, step]);7071 return (72 <CellForgeBase73 {...rest}74 size={rest.size ?? 36}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 |
