Skew Drift
cellforge/cell-angle-12FreeComponent
Traveling harmonics on `row - col` so bright ridges move along NE–SW obliques, orthogonal in feel to diagonal loaders that use `row + col`.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-angle-12.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 CellAngle12Props = CellForgeCommonProps;1617const MATRIX_SIZE = 7;1819const BASE_OPACITY = 0.06;20const MID_OPACITY = 0.34;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]);3536function isWithinTriangleMask(row: number, col: number): boolean {37 if (row < 0 || row >= MATRIX_SIZE || col < 0 || col >= MATRIX_SIZE) {38 return false;39 }4041 return TRIANGLE_CELLS.has(`${row},${col}`);42}4344function smoothstep01(edge0: number, edge1: number, x: number): number {45 if (edge1 <= edge0) {46 return x >= edge1 ? 1 : 0;47 }48 const t = Math.max(0, Math.min(1, (x - edge0) / (edge1 - edge0)));49 return t * t * (3 - 2 * t);50}5152/**53 * Anti-diagonal harmonics on `row - col`: bands glide along NE–SW lines through the mask,54 * opposite oblique motion to loaders keyed on `row + col`.55 */56function opacityForCell(row: number, col: number, phase: number): number {57 const skew = row - col;58 const t = phase * Math.PI * 2;59 const u = skew * 0.62 - t * 1.45;60 const primary = 0.5 + 0.5 * Math.cos(u);61 const harmonic = 0.5 + 0.5 * Math.cos(u * 2 - 0.55);62 const pSoft = smoothstep01(0.12, 0.95, primary);63 const hSoft = smoothstep01(0.38, 0.92, harmonic);64 const crest = pSoft * pSoft * 0.88 + Math.max(0, hSoft - 0.42) * 0.32;65 let opacity = BASE_OPACITY + crest * (HIGH_OPACITY - BASE_OPACITY);6667 if (row === 3 && col === 3) {68 opacity = Math.max(opacity, MID_OPACITY + (crest - 0.22) * 0.4);69 }7071 return Math.min(HIGH_OPACITY, opacity);72}7374export function CellAngle12({75 size = 30,76 dotSize = 6.5,77 color = "currentColor",78 colorPreset,79 ariaLabel = "Loading",80 className,81 muted = false,82 bloom = false,83 halo = 0,84 dotClassName,85 dotShape = "circle",86 speed = 1.5,87// … 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 | |
| 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 | |
| Updraftcell-angle-16 | @cellforge | Components | Free | no deps |
