liquid metal

A futuristic flowing-metal material applied to a logo, silhouette, or built-in shape. Animated stripe pattern with chromatic dispersion.

Preview

live
Upload your own logo or silhouette — or delete the image to use the built-in shape.

Install

npm
npm i @devmischief/shaders-svelte

Code

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

<LiquidMetal
  width={1280}
  height={720}
  colorBack="#aaaaac"
  colorTint="#ffffff"
  shape="diamond"
  repetition={2}
  softness={0.1}
  shiftRed={0.3}
  shiftBlue={0.3}
  distortion={0.07}
  contour={0.4}
  angle={70}
  scale={0.6}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={1}
  fit="contain"
/>
			
			

Shader Props

13
namedescriptiontypevalues
imageOptional source image used as the metal mask. When omitted, the chosen shape is used.stringurl
colorBackBackground color shown behind the metal.stringhex / rgba
colorTintOverlay color blended onto the metal using colour-burn blending.stringhex / rgb
shapeBuilt-in fallback shape used when no image is provided.stringnone · circle · daisy · diamond · metaballs
repetitionDensity of the animated stripe pattern.number1 → 10
softnessColor transition sharpness. 0 = hard edge, 1 = smooth gradient.number0 → 1
shiftRedR-channel chromatic dispersion.number−1 → 1
shiftBlueB-channel chromatic dispersion.number−1 → 1
distortionNoise distortion applied to the stripe pattern.number0 → 1
contourStrength of the distortion at the shape edges.number0 → 1
angleDirection of the pattern animation.number0 → 360°
speedAnimation speed of the metal flow.number0 → 3
fitHow the source image is fit into the canvas.stringcover · contain

Common Props

8
namedescriptiontypevalues
scaleOverall zoom level of the graphics.number0.01 → 4
rotationOverall rotation angle of the graphics.number0 → 360
offsetXHorizontal offset of the graphics.number−1 → 1
offsetYVertical offset of the graphics.number−1 → 1
originXReference point for positioning width in the canvas.number0 → 1
originYReference point for positioning height in the canvas.number0 → 1
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