Pivot Ray
cellforge/cell-angle-19FreeComponent
A Gaussian wedge of brightness rotates around the heart cell using each dot’s polar angle — a clear pivoting searchlight, not a cosine-product moiré field.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-19.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 { dmxBloomRootActive, dmxDotBloomParts } from "@/components/ui/cellforge-core";11import { useCyclePhase } from "@/components/ui/cellforge-hooks";12import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";13import type { CellForgeCommonProps } from "@/components/ui/cellforge-core";1415export type CellAngle19Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;1819const BASE_OPACITY = 0.08;20const MID_OPACITY = 0.38;21const HIGH_OPACITY = 0.96;2223const CENTER_ROW = 3;24const CENTER_COL = 3;2526const TRIANGLE_CELLS = new Set([27 "1,3",28 "2,2",29 "2,4",30 "3,1",31 "3,3",32 "3,5",33 "4,0",34 "4,2",35 "4,4",36 "4,6"37]);3839/** Wider wedge core (radians) for smoother rotation like Braille ramps. */40const BEAM_SIGMA = 0.58;4142function isWithinTriangleMask(row: number, col: number): boolean {43 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {44 return false;45 }4647 return TRIANGLE_CELLS.has(`${row},${col}`);48}4950function angleDiff(a: number, b: number): number {51 let d = a - b;52 while (d > Math.PI) {53 d -= Math.PI * 2;54 }55 while (d < -Math.PI) {56 d += Math.PI * 2;57 }58 return d;59}6061function smoothstep01(edge0: number, edge1: number, x: number): number {62 if (edge1 <= edge0) {63 return x >= edge1 ? 1 : 0;64 }65 const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));66 return t * t * (3 - 2 * t);67}6869/**70 * A soft **rotating wedge** from the heart cell: brightness peaks where polar angle matches the71 * spinning phase — reads as a searchlight pivot, not a cosine product field.72 */73function opacityForCell(row: number, col: number, phase: number): number {74 if (row === CENTER_ROW && col === CENTER_COL) {75 const hub = 0.5 + 0.5 * Math.sin(phase * Math.PI * 2);76 const hubSoft = smoothstep01(0.12, 0.9, hub);77 return MID_OPACITY + hubSoft * 0.22;78 }7980 const t = phase * Math.PI * 2;81 const ang = Math.atan2(row - CENTER_ROW, col - CENTER_COL);82 const d = angleDiff(ang, t);83 const beamRaw = Math.exp(-(d * d) / (BEAM_SIGMA * BEAM_SIGMA));84 const beam = smoothstep01(0.05, 0.98, beamRaw);85// … 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 |
