Waves
Web (React)
A reactive background of flowing lines driven by Perlin noise and cursor physics.
A physics-based line wave background that utilizes Perlin noise and cursor proximity to disturb the wave field dynamically.
Wave Dynamics
Move your mouse around to physically disturb the Perlin noise wave field.
Installation
CLI
npx @modus-ui/cli add wavesManual
- Copy the code from the component tab.
- Create a file at
components/ui/waves.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
lineColor | string | "rgba(0, 0, 0, 0.2)" | Colour of the wave lines. |
backgroundColor | string | "transparent" | Background colour behind the lines. |
waveSpeedX | number | 0.0125 | Horizontal speed of the noise field. |
waveSpeedY | number | 0.005 | Vertical speed of the noise field. |
waveAmpX | number | 32 | Horizontal amplitude of the waves. |
waveAmpY | number | 16 | Vertical amplitude of the waves. |
xGap | number | 10 | Horizontal gap between lines in pixels. |
yGap | number | 32 | Vertical gap between points in pixels. |
friction | number | 0.925 | How quickly cursor-induced motion settles. |
tension | number | 0.005 | How strongly points spring back to rest. |
maxCursorMove | number | 100 | Maximum displacement caused by the cursor in pixels. |
style | React.CSSProperties | {} | Inline styles for the container. |
Comments