Corner Bounce
cellforge/cell-angle-3FreeComponent
A single head bounces between triangle corners along the perimeter path with a short fading tail.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-3.jsonSource
1"use client";23import type { CSSProperties } from "react";45import { cx } from "@/components/ui/cellforge-core";6import { resolveDmxColorTokens } from "@/components/ui/cellforge-core";7import { useCellForgePhases } from "@/components/ui/cellforge-hooks";8import { styleOpacity, stylePx } from "@/components/ui/cellforge-core";9import { remapOpacityToTriplet } from "@/components/ui/cellforge-core";10import { dmxBloomHaloSpreadClass, dmxBloomRootActive, dmxDotBloomParts } from "@/components/ui/cellforge-core";11import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";12import { useSteppedCycle } from "@/components/ui/cellforge-hooks";13import type { CellForgeCommonProps } from "@/components/ui/cellforge-core";1415export type CellAngle3Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;18const STEP_COUNT = 36;19const BASE_OPACITY = 0.03;20const MID_OPACITY = 0.07;21const HIGH_OPACITY = 0.94;22const FAR_OPACITY = 0.15;2324const TRIANGLE_CELLS = new Set([25 "1,3",26 "2,2",27 "2,4",28 "3,1",29 "3,3",30 "3,5",31 "4,0",32 "4,2",33 "4,4",34 "4,6"35]);3637function isWithinTriangleMask(row: number, col: number): boolean {38 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {39 return false;40 }4142 return TRIANGLE_CELLS.has(`${row},${col}`);43}4445export function CellAngle3({46 size = 30,47 dotSize = 6.5,48 color = "currentColor",49 colorPreset,50 ariaLabel = "Loading",51 className,52 muted = false,53 bloom = false,54 halo = 0,55 dotClassName,56 dotShape = "circle",57 speed = 1.45,58 animated = true,59 hoverAnimated = false,60 cellPadding,61 opacityBase,62 opacityMid,63 opacityPeak64}: CellAngle3Props) {65 const reducedMotion = usePrefersReducedMotion();66 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({67 animated: Boolean(animated && !reducedMotion),68 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),69 speed70 });71 const step = useSteppedCycle({72 active: !reducedMotion && matrixPhase !== "idle",73 cycleMsBase: 1650,74 steps: STEP_COUNT,75 speed,76 });7778 const frame = reducedMotion || matrixPhase === "idle" ? 0 : step;79 const theta = (frame / STEP_COUNT) * Math.PI * 2;80 const sweepX = Math.cos(theta);81 const sweepY = Math.sin(theta);82 const ambientPulse = 0.5 - 0.5 * Math.cos(theta);8384 const gap =85 cellPadding ?? Math.max(1, Math.floor((size - dotSize * MATRIX_SIZE) / (MATRIX_SIZE - 1)));86 const matrixSize = dotSize * MATRIX_SIZE + gap * (MATRIX_SIZE - 1);87// … 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 |
