Row Sweep
cellforge/cell-angle-5FreeComponent
A reflected scanline sweeps from apex to base and back, animating only opacity bands across triangle rows.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-5.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 CellAngle5Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;18const STEP_COUNT = 42;19const BASE_OPACITY = 0.06;20const MID_OPACITY = 0.3;21const HIGH_OPACITY = 0.92;2223const TRIANGLE_CELLS = new Set([24 "1,3",25 "2,2",26 "2,4",27 "3,1",28 "3,3",29 "3,5",30 "4,0",31 "4,2",32 "4,4",33 "4,6"34]);3536function isWithinTriangleMask(row: number, col: number): boolean {37 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {38 return false;39 }4041 return TRIANGLE_CELLS.has(`${row},${col}`);42}4344export function CellAngle5({45 size = 30,46 dotSize = 6.5,47 color = "currentColor",48 colorPreset,49 ariaLabel = "Loading",50 className,51 muted = false,52 bloom = false,53 halo = 0,54 dotClassName,55 dotShape = "circle",56 speed = 1.8,57 animated = true,58 hoverAnimated = false,59 cellPadding,60 opacityBase,61 opacityMid,62 opacityPeak63}: CellAngle5Props) {64 const reducedMotion = usePrefersReducedMotion();65 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({66 animated: Boolean(animated && !reducedMotion),67 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),68 speed69 });70 const step = useSteppedCycle({71 active: !reducedMotion && matrixPhase !== "idle",72 cycleMsBase: 1700,73 steps: STEP_COUNT,74 speed,75 });7677 const frame = reducedMotion || matrixPhase === "idle" ? 0 : step;78 const progress = frame / STEP_COUNT;79 const pingPong = 0.5 - 0.5 * Math.cos(progress * Math.PI * 2);80 const scanRow = 1 + pingPong * 3;8182 const gap =83 cellPadding ?? Math.max(1, Math.floor((size - dotSize * MATRIX_SIZE) / (MATRIX_SIZE - 1)));84 const matrixSize = dotSize * MATRIX_SIZE + gap * (MATRIX_SIZE - 1);85 const { resolvedColor, dotFill } = resolveDmxColorTokens(color, colorPreset);86// … 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 |
