Corona Tier
cellforge/cell-angle-9FreeComponent
Eight-connected distance rings from the heart cell: a bright corona sweeps outward through discrete tiers then back, so depth reads as concentric energy shells.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-9.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 CellAngle9Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;1819const BASE_OPACITY = 0.14;20const HIGH_OPACITY = 0.96;2122const TRIANGLE_CELLS = new Set([23 "1,3",24 "2,2",25 "2,4",26 "3,1",27 "3,3",28 "3,5",29 "4,0",30 "4,2",31 "4,4",32 "4,6"33]);3435const DELTAS_8: ReadonlyArray<readonly [number, number]> = [36 [-1, -1],37 [-1, 0],38 [-1, 1],39 [0, -1],40 [0, 1],41 [1, -1],42 [1, 0],43 [1, 1]44];4546function buildBfsRingFromCenter(): Map<string, number> {47 const dist = new Map<string, number>();48 const start = "3,3";49 if (!TRIANGLE_CELLS.has(start)) {50 return dist;51 }5253 const queue: [number, number][] = [[3, 3]];54 dist.set(start, 0);55 let head = 0;5657 while (head < queue.length) {58 const [r, c] = queue[head]!;59 head += 1;60 const d = dist.get(`${r},${c}`)!;6162 for (const [dr, dc] of DELTAS_8) {63 const nr = r + dr;64 const nc = c + dc;65 const key = `${nr},${nc}`;66 if (TRIANGLE_CELLS.has(key) && !dist.has(key)) {67 dist.set(key, d + 1);68 queue.push([nr, nc]);69 }70 }71 }7273 return dist;74}7576const BFS_RING = buildBfsRingFromCenter();77const MAX_RING = Math.max(0, ...BFS_RING.values());7879function isWithinTriangleMask(row: number, col: number): boolean {80 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {81 return false;82 }8384 return TRIANGLE_CELLS.has(`${row},${col}`);85}8687function smoothstep01(edge0: number, edge1: number, x: number): number {88 if (edge1 <= edge0) {89 return x >= edge1 ? 1 : 0;90 }91 const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));92 return t * t * (3 - 2 * t);93}9495/**96 * Concentric tiers from the heart (8-connected). One soft bright band travels outward/inward;97// … 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 |
