Tripod Handoff
cellforge/cell-angle-15FreeComponent
Brightness hands off smoothly among the three silhouette vertices (apex, left base, right base) with Manhattan falloff — a corner-to-corner orbit, not a mod-3 lattice.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-15.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 CellAngle15Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;1819const BASE_OPACITY = 0.08;20const MID_OPACITY = 0.38;21const HIGH_OPACITY = 0.96;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]);3536/** Apex and the two base corners — the three natural vertices of the silhouette. */37const HUBS: ReadonlyArray<readonly [number, number]> = [38 [1, 3],39 [4, 0],40 [4, 6]41];4243function isWithinTriangleMask(row: number, col: number): boolean {44 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {45 return false;46 }4748 return TRIANGLE_CELLS.has(`${row},${col}`);49}5051function manhattan(aRow: number, aCol: number, bRow: number, bCol: number): number {52 return Math.abs(aRow - bRow) + Math.abs(aCol - bCol);53}5455function smoothstep01(edge0: number, edge1: number, x: number): number {56 if (edge1 <= edge0) {57 return x >= edge1 ? 1 : 0;58 }59 const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));60 return t * t * (3 - 2 * t);61}6263function falloffFromHub(row: number, col: number, hub: readonly [number, number]): number {64 const d = manhattan(row, col, hub[0], hub[1]);65 return 1 - smoothstep01(0, 5.4, d);66}6768/**69 * Energy orbits the three triangle vertices (apex → left base → right base) on a continuous phase,70 * with soft Manhattan falloff — no lattice mod groups.71 */72function opacityForCell(row: number, col: number, phase: number): number {73 const t = phase * Math.PI * 2;74 const sharp = 4;75 const u0 = Math.max(0, Math.cos(t)) ** sharp;76 const u1 = Math.max(0, Math.cos(t - (Math.PI * 2) / 3)) ** sharp;77 const u2 = Math.max(0, Math.cos(t - (Math.PI * 4) / 3)) ** sharp;78 const sum = u0 + u1 + u2 + 1e-4;7980// … 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 | |
| Updraftcell-angle-16 | @cellforge | Components | Free | no deps |
