Modus UI

Moon Lattice

Web (React)

A centred WebGL globe of noise-carved points, tilted and threaded with thin rings, inked in the theme colours.

A Three.js point globe carved by noise and tilted on its axis, wrapped in six thin rings that drift in opposite directions. Colours come from the theme: --primary for the bright points and nodes, --muted-foreground for the dim ones and --foreground for the rings. In light mode it is drawn as ink on paper; in dark mode it glows additively. It follows palette and mode changes live. It fills its positioned parent, pauses when off screen and renders a still frame when the user prefers reduced motion.

Modus / Moon Lattice

Installation

CLI

npx @modus-ui/cli add moon-lattice

Manual

  1. Install three.
  2. Copy the code from the component tab.
  3. Create a file at components/ui/moon-lattice.tsx.
  4. Paste the code.

Usage

tsx
import { MoonLattice } from "@/components/ui/moon-lattice";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <MoonLattice />
      <div className="relative z-10 p-8">
        <h1>Content over the effect</h1>
      </div>
    </div>
  );
}

Props

PropTypeDefaultDescription
speednumber1Rotation speed multiplier.
particleSizenumber0.022Size of each particle.
particleOpacitynumber0.8Opacity of the particles.
orbitOpacitynumber0.35Opacity of the rings.
scalenumber1Scale of the whole sphere.
haloOpacitynumber0.2Opacity of the glow around each node.
huenumber0Hue rotation in degrees.
particleColorstringtheme --primaryColour of the bright particles.
particleDimColorstringtheme --muted-foregroundColour of the dim particles.
orbitColorstringtheme --foregroundColour of the orbit rings.
nodeColorstringtheme --primaryColour of the orbiting nodes.
haloColorstringtheme --primaryColour of the node halos.
backgroundColorstringtheme --backgroundBackground behind the sphere.

Comments

  • No comments yet.