waves

A static line pattern that morphs continuously from sharp zigzags to smooth sine waves to irregular flowing forms — fractional shape values blend between them.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

import { Waves } from '@devmischief/shaders-svelte';

<Waves
  width={1280}
  height={720}
  colorBack="#000000"
  colorFront="#ffbb00"
  shape={1}
  frequency={0.5}
  amplitude={0.5}
  spacing={1.2}
  proportion={0.1}
  softness={0}
  scale={0.6}
  rotation={0}
  offsetX={0}
  offsetY={0}
  fit="none"
/>
			
			

Shader Props

9
namedescriptiontypevalues
colorBackBackground color shown behind the waves.stringhex / rgba
colorFrontWave line color.stringhex / rgb
shapeWave shape morph. 0 = zigzag, 1 = sine, 2–3 = irregular waves. Fractional values blend between shapes.number0 → 3
frequencyWave frequency.number0 → 2
amplitudeWave amplitude.number0 → 1
spacingSpace between every two wavy lines.number0 → 2
proportionBlend point between front and back colors. 0.5 = equal distribution.number0 → 1
softnessColor transition sharpness. 0 = hard edge, 1 = smooth gradient.number0 → 1
fitHow the wave pattern is fit into the canvas.stringnone · cover · contain

Common Props

6
namedescriptiontypevalues
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
worldWidthVirtual width of the graphic before it's scaled to fit the canvas.number
worldHeightVirtual height of the graphic before it's scaled to fit the canvas.number
minPixelRatioMinimum pixel ratio used when rendering the shader (default 2).number
maxPixelCountMaximum pixel count the shader may process.number

built with mischief by devmischief

@devmischief/shaders-svelte