Honey Gate
cellforge/cell-lattice-3FreeComponent
Two diagonal bands slide through the honeycomb from opposite sides, meeting in a bright center flash before opening again.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-lattice-3.jsonSource
1"use client";23import type { CSSProperties } from "react";45import { cx } from "@/components/ui/cellforge-core";6import { resolveDmxColorTokens } from "@/components/ui/cellforge-core";7import { styleOpacity, stylePx } from "@/components/ui/cellforge-core";8import { remapOpacityToTriplet } from "@/components/ui/cellforge-core";9import { dmxBloomRootActive, dmxDotBloomParts } from "@/components/ui/cellforge-core";10import { getPatternIndexes } from "@/components/ui/cellforge-core";11import { useCellForgePhases } from "@/components/ui/cellforge-hooks";12import { useCyclePhase } from "@/components/ui/cellforge-hooks";13import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";14import type { CellForgeCommonProps } from "@/components/ui/cellforge-core";1516export type CellLattice3Props = CellForgeCommonProps;1718const ROW_COUNTS = [3, 4, 5, 4, 3] as const;19const BASE_OPACITY = 0.08;20const HIGH_OPACITY = 0.96;21const HEX_ROW_PITCH_RATIO = Math.sqrt(3) / 2;2223function hexPatternIndex(row: number, rowCount: number, col: number): number {24 return row * ROW_COUNTS[2] + Math.floor((ROW_COUNTS[2] - rowCount) / 2) + col;25}26const BAND_WIDTH = 0.55;2728function clamp01(n: number | undefined) {29 if (n == null || !Number.isFinite(n)) {30 return;31 }32 return Math.min(1, Math.max(0, n));33}3435function pointForCell(row: number, col: number): { x: number; y: number } {36 const count = ROW_COUNTS[row] ?? 1;37 return {38 x: col - (count - 1) / 2,39 y: (row - 2) * HEX_ROW_PITCH_RATIO40 };41}4243function triangularWave(n: number): number {44 const wrapped = ((n % 1) + 1) % 1;45 return 1 - Math.abs(wrapped * 2 - 1);46}4748function bandGlow(distance: number): number {49 return Math.max(0, 1 - Math.abs(distance) / BAND_WIDTH);50}5152function opacityForCell(row: number, col: number, phase: number): number {53 const { x, y } = pointForCell(row, col);54 const sweep = triangularWave(phase) * 3.9 - 1.95;55 const diagA = x * 0.86 + y * 0.5;56 const diagB = x * -0.86 + y * 0.5;57 const gateA = bandGlow(diagA - sweep);58 const gateB = bandGlow(diagB + sweep);59 const centerDistance = Math.sqrt(x * x + y * y);60 const centerFlash = Math.max(0, 1 - Math.abs(sweep) / 0.68) * Math.max(0, 1 - centerDistance / 1.9);61 const wake = 0.16 * Math.max(0, 1 - Math.abs(y - sweep * 0.22) / 1.2);6263 return Math.min(HIGH_OPACITY, BASE_OPACITY + gateA * 0.7 + gateB * 0.7 + centerFlash * 0.42 + wake);64}6566export function CellLattice3({67 size = 34,68 dotSize = 5,69 color = "currentColor",70 colorPreset,71// … 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 |
