BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@cellforge/cell-angle-20

Twin Perimeter

cellforge/cell-angle-20
FreeComponent

Two stepped heads chase the outer perimeter path half a lap apart, each with its own tail; the heart cell stays quietly dim off the loop.

Install it

npx shadcn@latest add https://cellforge.dev/r/cell-angle-20.json

Source

components/ui/cell-angle-20.tsxcellforge.dev/r/cell-angle-20.json
1"use client";
2
3import type { CSSProperties } from "react";
4
5import { 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";
14
15export type CellAngle20Props = CellForgeCommonProps;
16
17const MATRIX_SIZE = 7;
18const BASE_OPACITY = 0.08;
19const HIGH_OPACITY = 0.94;
20const CENTER_DIM = 0.2;
21
22const 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]);
34
35/** Same perimeter ring as CellTriangle1 — center is not on this loop. */
36const PERIMETER_PATH: ReadonlyArray<readonly [number, number]> = [
37 [1, 3],
38 [2, 2],
39 [3, 1],
40 [4, 0],
41 [4, 2],
42 [4, 4],
43 [4, 6],
44 [3, 5],
45 [2, 4]
46];
47
48const PATH_LEN = PERIMETER_PATH.length;
49const TRAIL_SPAN = 3.35;
50const HALF = PATH_LEN / 2;
51
52function isWithinTriangleMask(row: number, col: number): boolean {
53 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {
54 return false;
55 }
56
57 return TRIANGLE_CELLS.has(`${row},${col}`);
58}
59
60function pathIndex(row: number, col: number): number | null {
61 for (let i = 0; i < PATH_LEN; i += 1) {
62 const [pr, pc] = PERIMETER_PATH[i]!;
63 if (pr === row && pc === col) {
64 return i;
65 }
66 }
67 return null;
68}
69
70function modF(n: number, m: number): number {
71 return ((n % m) + m) % m;
72}
73
74function behindAlongPath(s: number, i: number, L: number): number {
75 return modF(s - i, L);
76}
77
78function smoothstep01(edge0: number, edge1: number, x: number): number {
79 if (edge1 <= edge0) {
80 return x >= edge1 ? 1 : 0;
81 }
82 const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));
83 return t * t * (3 - 2 * t);
84}
85
86function glowAlongPath(s: number, idx: number | null, L: number): number {
87 if (idx === null) {
88 return BASE_OPACITY;
89 }
90 const d = behindAlongPath(s, idx, L);
91 const g = 1 - smoothstep01(0, TRAIL_SPAN, d);
92 return BASE_OPACITY + g * (HIGH_OPACITY - BASE_OPACITY);
93}
94
95/**
96// … truncated

Facts

Registry
@cellforge
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

cellforge.dev cellforge-dev/cellforge on GitHub Raw registry item This item as JSON

More from @cellforge

All 71 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
All CellForge Loadersall@cellforgeComponentsFreeno deps
Core Spokescell-angle-1@cellforgeComponentsFreeno deps
Column Rakecell-angle-10@cellforgeComponentsFreeno deps
Shelf Descentcell-angle-11@cellforgeComponentsFreeno deps
Skew Driftcell-angle-12@cellforgeComponentsFreeno deps
Serpent Zipcell-angle-13@cellforgeComponentsFreeno deps
Pillar Sweepcell-angle-14@cellforgeComponentsFreeno deps
Tripod Handoffcell-angle-15@cellforgeComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex