Motion Blocks

Canvas

Globe

A Fresnel-lit globe with rim glow, haloed atmosphere, land mesh detail, and marker layers for data storytelling.

  • lit Preview of https://lit.devLitSimple. Fast. Web Components.
  • ogl Preview of https://github.com/oframe/oglOGLMinimal WebGL framework.
  • gsap Preview of https://gsap.comGSAPAnimate anything. Silky-smooth performance.

Preview

Navigation

A Fresnel globe with halo atmosphere, land-point sampling, draggable rotation, and projected marker labels.
Attributes

Installation

pnpm dlx motion-blocks add globe

Usage

---import "@/components/motion-blocks/globe-element.ts"; const markers = [  { location: [40.7128, -74.006], label: "New York" },  { location: [51.5074, -0.1278], label: "London" },  { location: [35.6762, 139.6503], label: "Tokyo" }]; const fresnelConfig = {  color: "#0F3161",  rimColor: "#6FD3FF",  rimPower: 12,  rimIntensity: 0.95}; const atmosphereConfig = {  color: "#5AC8FA",  scale: 1.22,  power: 19.5,  coefficient: 1.05,  intensity: 0.72};--- <motion-globe  radius={2.15}  scale={1}  markers={markers}  fresnel-config={JSON.stringify(fresnelConfig)}  atmosphere-config={JSON.stringify(atmosphereConfig)}  point-count={21500}  point-size={0.06}  auto-rotate={true}  class="w-full h-[600px]"/>

API Reference

Attribute Type Default
radius Base radius of the globe sphere. number 2.15
scale Display scale of the globe. number 1
offset-x Horizontal offset of the globe center. number 0
offset-y Vertical offset of the globe center. number 0
rotation Initial rotation angle in degrees. number 0
fresnel-config JSON object with color, rimColor, rimPower, and rimIntensity for the fresnel rim lighting. object (JSON) {}
atmosphere-config JSON object with color, scale, power, coefficient, and intensity for the atmospheric glow. object (JSON) {}
point-count Number of dots representing the land surface. number 21500
point-size Size of individual land surface dots. number 0.06
land-point-color Color of the dots representing land masses. string "#f77114"
auto-rotate Whether the globe automatically rotates. boolean true
locked-polar-angle Whether to lock the polar angle (prevents flipping upside down). boolean true
markers Array of marker objects with location [lat, lon], optional size, color, and label. array []
focus-on Location [lat, lon] to smoothly rotate the globe toward. array null