Braille Beat
cellforge/cell-angle-6FreeComponent
Triangle-masked braille dots fill down the left rail, then the right, then blink full and empty.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-6.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 CellAngle6Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;1819/** Unicode / ISO braille dot numbering (same as `CellSquare9`). */20const D1 = 0x01;21const D2 = 0x02;22const D3 = 0x04;23const D4 = 0x08;24const D5 = 0x10;25const D6 = 0x20;2627const LOW_OPACITY = 0.07;28const MID_OPACITY = 0.36;29const HIGH_OPACITY = 0.96;3031/** Half-width of the traveling ramp (larger = softer, more “gradient” overlap). */32const WAVE_HALF = 0.82;3334/** Phase splits (must sum to 1): smooth intro wave, blink, fade reset. */35const INTRO_PHASE = 0.52;36const BLINK_PHASE = 0.36;37const RESET_PHASE = 0.12;3839const TRIANGLE_CELLS = new Set([40 "1,3",41 "2,2",42 "2,4",43 "3,1",44 "3,3",45 "3,5",46 "4,0",47 "4,2",48 "4,4",49 "4,6"50]);5152function smoothstep01(edge0: number, edge1: number, x: number): number {53 if (edge1 <= edge0) {54 return x >= edge1 ? 1 : 0;55 }56 const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));57 return t * t * (3 - 2 * t);58}5960/** Six fills (D1..D6 order) from a single traveling wave front. */61function waveFills(introT: number): number[] {62 const waveCenter = -WAVE_HALF + introT * (5 + 2 * WAVE_HALF);63 return [0, 1, 2, 3, 4, 5].map((i) =>64 smoothstep01(i - WAVE_HALF, i + WAVE_HALF, waveCenter)65 );66}6768function isWithinTriangleMask(row: number, col: number): boolean {69 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {70 return false;71 }7273 return TRIANGLE_CELLS.has(`${row},${col}`);74}7576/** Map triangle cell → braille bit (ISO 2×3), or null for accent cells. */77function brailleBitForTriangle(row: number, col: number): number | null {78 if (row === 2 && col === 2) {79 return D1;80 }81 if (row === 3 && col === 1) {82 return D2;83 }84 if (row === 4 && col === 0) {85 return D3;86 }87 if (row === 2 && col === 4) {88// … 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 |
