Animation

Waves

Wave-field background — a grid of lines drifting on perlin noise, nudged by the pointer. Line colour follows the theme out of the box. Use behind hero copy or section content.

Angular adaptation of an effect by David Haz / reactbits.dev.

Import

import { WrWaves } from 'ngwr/waves';

Playground

Content above the waves

<section style="position: relative">
  <wr-waves [waveAmpX]="32" [waveAmpY]="16" [xGap]="10" [yGap]="32" />
  <h1>Content above the waves</h1>
</section>

Customize

Amp X
32
Amp Y
16
X Gap
10
Y Gap
32

API

NameDescriptionTypeDefault
lineColorLine stroke colour.stringtheme-aware (dark tint on light, white-alpha on dark)
backgroundColorFill behind the lines.string'transparent'
waveSpeedXHorizontal noise drift per ms.number0.0125
waveSpeedYVertical noise drift per ms.number0.005
waveAmpXHorizontal wave amplitude (px).number32
waveAmpYVertical wave amplitude (px).number16
xGapGap between lines (px).number10
yGapGap between points on a line (px).number32
frictionCursor-spring damping, 0..1.number0.925
tensionCursor-spring pull-back strength.number0.005
maxCursorMoveMax px a point drags from rest.number100