Glyph Flip
cellforge/cell-lattice-8FreeComponent
Crisp symbolic masks flip between stars, chevrons, and rails for a snappy pixel-glyph loader.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-lattice-8.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 { dmxBloomHaloSpreadClass, dmxBloomRootActive, dmxDotBloomParts } from "@/components/ui/cellforge-core";10import { getPatternIndexes } from "@/components/ui/cellforge-core";11import { useCellForgePhases } from "@/components/ui/cellforge-hooks";12import { useSteppedCycle } from "@/components/ui/cellforge-hooks";13import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";14import type { CellForgeCommonProps } from "@/components/ui/cellforge-core";1516export type CellLattice8Props = CellForgeCommonProps;1718const ROW_COUNTS = [3, 4, 5, 4, 3] as const;19const BASE_OPACITY = 0.2;20const MID_OPACITY = 0.46;21const HIGH_OPACITY = 0.98;22const HEX_ROW_PITCH_RATIO = Math.sqrt(3) / 2;2324function hexPatternIndex(row: number, rowCount: number, col: number): number {25 return row * ROW_COUNTS[2] + Math.floor((ROW_COUNTS[2] - rowCount) / 2) + col;26}27const FRAMES: readonly Readonly<Record<string, "x" | "o">>[] = [28 { "0,1": "x", "1,1": "o", "1,2": "o", "2,0": "x", "2,2": "x", "2,4": "x", "3,1": "o", "3,2": "o", "4,1": "x" },29 { "0,0": "x", "0,2": "x", "1,0": "o", "1,3": "o", "2,1": "x", "2,2": "o", "2,3": "x", "3,0": "o", "3,3": "o", "4,0": "x", "4,2": "x" },30 { "0,1": "o", "1,0": "x", "1,3": "x", "2,0": "o", "2,2": "x", "2,4": "o", "3,0": "x", "3,3": "x", "4,1": "o" },31 { "0,0": "o", "0,2": "o", "1,1": "x", "1,2": "x", "2,1": "o", "2,3": "o", "3,1": "x", "3,2": "x", "4,0": "o", "4,2": "o" }32];3334function clamp01(n: number | undefined) {35 if (n == null || !Number.isFinite(n)) return;36 return Math.min(1, Math.max(0, n));37}3839export function CellLattice8({40 size = 34,41 dotSize = 5,42 color = "currentColor",43 colorPreset,44 ariaLabel = "Loading",45 className,46 muted = false,47 bloom = false,48 halo = 0,49 dotClassName,50 dotShape = "circle",51 speed = 1.35,52 animated = true,53 hoverAnimated = false,54 pattern = "full",55 cellPadding,56 boxSize,57 minSize,58 opacityBase,59 opacityMid,60 opacityPeak61}: CellLattice8Props) {62 const reducedMotion = usePrefersReducedMotion();63// … 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 |
