Lunar Breathe
cellforge/cell-orbit-11FreeComponent
A rotating crescent moon silhouette: bright lunar body, soft rim, and faint directional halo moving around the circular mask.
Install it
npx shadcn@latest add https://cellforge.dev/r/cell-orbit-11.jsonSource
1"use client";23import { useMemo } from "react";45import { CellForgeBase } from "@/components/ui/cellforge-core";6import { useCellForgePhases } from "@/components/ui/cellforge-hooks";7import { isWithinCircularMask } from "@/components/ui/cellforge-core";8import { useCyclePhase } from "@/components/ui/cellforge-hooks";9import { usePrefersReducedMotion } from "@/components/ui/cellforge-hooks";10import type { DotAnimationResolver, CellForgeCommonProps } from "@/components/ui/cellforge-core";1112export type CellOrbit11Props = CellForgeCommonProps;1314const BASE_OPACITY = 0.07;15const MID_OPACITY = 0.3;16const HIGH_OPACITY = 0.95;1718export function CellOrbit11({19 speed = 1.65,20 animated = true,21 hoverAnimated = false,22 ...rest23}: CellOrbit11Props) {24 const reducedMotion = usePrefersReducedMotion();25 const { phase: matrixPhase, onMouseEnter, onMouseLeave } = useCellForgePhases({26 animated: Boolean(animated && !reducedMotion),27 hoverAnimated: Boolean(hoverAnimated && !reducedMotion),28 speed29 });30 const phase = useCyclePhase({31 active: !reducedMotion && matrixPhase !== "idle",32 cycleMsBase: 1850,33 speed34 });3536 const resolver = useMemo<DotAnimationResolver>(() => {37 return ({ row, col, phase: p }) => {38 if (!isWithinCircularMask(row, col)) {39 return { className: "dmx-inactive" };40 }4142 const x = col - 2;43 const y = row - 2;44 const ring = Math.sqrt(x * x + y * y);45 const t = reducedMotion || p === "idle" ? 0 : (phase) * Math.PI * 2;46 const angle = Math.atan2(y, x);47 const moonCenterX = Math.cos(t) * 0.7;48 const moonCenterY = Math.sin(t) * 0.7;49 const body = Math.hypot(x - moonCenterX, y - moonCenterY);50 const cutCenterX = moonCenterX + Math.cos(t) * 0.82;51 const cutCenterY = moonCenterY + Math.sin(t) * 0.82;52 const cut = Math.hypot(x - cutCenterX, y - cutCenterY);53 const rim = Math.max(0, 1 - Math.abs(body - 1.55) / 0.35);54 const halo = Math.max(0, 1 - Math.acos(Math.cos(angle - t)) / 0.9);5556 let opacity = BASE_OPACITY;57 if (body < 1.55 && cut > 1.05) {58 opacity = HIGH_OPACITY;59 } else if (rim > 0.5) {60 opacity = MID_OPACITY + rim * 0.22;61 } else if (halo > 0.68 && ring > 1.2) {62 opacity = MID_OPACITY;63 }6465 return { style: { opacity: Math.min(HIGH_OPACITY, opacity) } };66 };67 }, [reducedMotion, phase]);6869 return (70 <CellForgeBase71 {...rest}72 size={rest.size ?? 36}73 dotSize={rest.dotSize ?? 5}74// … 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 |
