DitherGlobe

An orthographic globe dithered from a bundled land mask.

Preview

Installation

pnpm add astro-dither

Or copy the source into your project: npx astro-dither add globe

Usage

---
import { DitherGlobe } from "astro-dither";
---

<DitherGlobe />

The globe effect with the land mask bundled as an asset. lat and lon rotate the view; the palette styles the land.

Props

PropTypeDefaultDescription
latnumber20Latitude facing the viewer.
lonnumber48Longitude facing the viewer.
srcstring | ImageMetadatabundled land maskOverride the mask.
palettestring[]the effect's2 to 8 colours, paper first, brightest last. transparent works.
cellnumber2Size of one dither cell in CSS pixels, 1 to 8.
matrix2 | 4 | 8 | "noise"8The Bayer threshold size, or noise for a random look.
speednumber1Playback speed. 0 draws one still frame.
classstringundefinedClasses on the surface element, for size and position.

Notes

  • Decorative surfaces render aria-hidden. Put real text on top, not inside them.
  • With reduced motion it draws one still frame and stops.
  • It pauses when scrolled out of view or when the tab is hidden.