Duck Pond
The water is your page, black or white with the theme; only the ducks and their ripples are printed. Each duck keeps its own moods: paddling about, upending to feed, preening, dozing with its head tucked. Ducklings trail their mother and a drake stays near his hen, and they all keep clear of your text. A quick hand scatters them, a still one draws a curious few, and a click throws bread they race for. Put it behind your page like any background and give the headline's selector to avoid.
Needs: None. A 2D canvas.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| pairs | number | 2 | How many mallard pairs, a drake and a hen each. |
| ducklings | number | 5 | Ducklings trailing a hen of their own. 0 for none. |
| cell | number | 3 | Size of one dither cell in px. Bigger cells, bigger ducks. |
| ink | string | – | The ripples' ink. The theme foreground by default. |
| damping | number | 0.982 | How long ripples last: the share of each wave kept per step. |
| speed | number | 1 | Time scale. 0 holds the moment. |
| interactive | boolean | true | A quick pointer scares them, a still one makes them curious, a click throws bread. Read on the window. |
| avoid | string | – | CSS selector for elements the ducks keep clear of, like a headline. |
| seed | number | 4 | Picks the ducks' places and moods. |
| opacity | number | 1 | Opacity of the whole scene. |
| dpr | number | null | Device pixel ratio to render at. Math.min(devicePixelRatio, 2) when unset. |
| className | string | – | Class on the root element, which fills its parent. |
| style | CSSProperties | – | Style on the root element. Theme it through the --mlui-* variables. |