# Lava: Motion and the page

> How the wax moves, any moment drawn on its own, and how a lamp behaves on a page.

Source: https://cesarvenzac.com/lava/docs/motion-and-the-page

## The wax

Blobs climb out of the pool and sink back on slow cycles, none keeping time with another. Rising, a blob draws a thick neck out of the pool, which heaves up under it; the neck thins to a waist and parts while still thick, its upper half drawn up into the blob and its lower half slumping back. Freed, a blob eases from stretched to round. Sinking, it flattens as it presses into the pool.

- `speed` (1): a lamp's own unhurried pace is 1.
- `count`: how many blobs, up to 12. By default, more for a long box than a square one.
- `size` (1): how big the blobs are. Sizes follow the box's shorter side, so a banner and a tall column each get blobs in proportion.
- `pool` (0.12): how deep the pool on the bulb is, as a share of the shorter side. At 0 there's none, and blobs rise from below the box.
- `wobble` (1): how much slow waves run over the wax's surface.
- `seed` ("lava"): the same seed lays out the same lamp.

## Any moment

Every moment is worked out from the time alone, so any one can be drawn on its own, the same on every screen:

```typescript
const lamp = lava(element, { start: 30, paused: true });
lamp.seek(42); // seconds into its motion
lamp.play();
```

## On the page

- It moves only while it's on screen and the tab is shown.
- Under reduced motion it holds still, unless `reducedMotion` says otherwise.
- It's drawn at up to `maxPixels` (800,000) and scaled up to the screen's own pixels, which the soft picture hides. If frames come slowly it's drawn smaller, early and at most twice, never in the middle of watching.
- Its shaders are compiled without holding up the page. Until the wax is drawn, and where a browser can't draw it, the element shows the liquid lit from below, which `standInOf(colours)` gives as CSS for a server of your own.
- Each lamp has a WebGL 2 context of its own; a browser allows about sixteen on a page.

`destroy()` takes a lamp out of its element and gives back everything it changed there.

## Lava's docs

- [Overview](https://cesarvenzac.com/lava.md): A lava lamp for any box: thick 3D wax glowing in a dark liquid, shot through a long lens.
- [Getting started](https://cesarvenzac.com/lava/docs/getting-started.md): Install Lava and fill a box with a lava lamp: in React, or in any element, alone or behind content.
- [Colours and light](https://cesarvenzac.com/lava/docs/colours-and-light.md): The five palettes, colours of your own, and the light and lens a lamp is drawn with.
- [Motion and the page](https://cesarvenzac.com/lava/docs/motion-and-the-page.md): How the wax moves, any moment drawn on its own, and how a lamp behaves on a page.
- [API reference](https://cesarvenzac.com/lava/docs/api.md): Every function, option and type Lava exports.
