gem smoke

A glassy gem with animated smoke flowing inside and around it. Up to six smoke colors, configurable distortion, and built-in fallback shapes.

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 { GemSmoke } from '@devmischief/shaders-svelte';

<GemSmoke
  width={1280}
  height={720}
  colors={['#1f1147', '#5b1d9b', '#a04ad9', '#ff7eb0']}
  colorBack="#f0efea"
  colorInner="#fafaf5"
  shape="diamond"
  innerDistortion={0.8}
  outerDistortion={0.6}
  outerGlow={0.55}
  innerGlow={1}
  offset={0}
  angle={0}
  size={0.8}
  scale={0.6}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={1}
  fit="contain"
/>
			
			

Shader Props

14
namedescriptiontypevalues
imageOptional source image used as the gem mask. When omitted, the chosen shape is used.stringurl
colorsSmoke gradient colors (up to 6).string[]hex / rgb
colorBackBackground color shown behind the shape.stringhex / rgba
colorInnerAdditional color mixed into the smoke inside the shape.stringhex / rgb
shapeBuilt-in fallback shape used when no image is provided.stringnone · circle · daisy · diamond · metaballs
innerDistortionPower of smoke distortion inside the shape.number0 → 1
outerDistortionPower of smoke distortion outside the shape.number0 → 1
outerGlowVisibility of smoke outside the shape.number0 → 1
innerGlowVisibility of smoke inside the shape.number0 → 1
offsetVertical drift of the smoke inside the shape.number−1 → 1
angleDirection of the flowing smoke.number0 → 360°
sizeSize of the smoke shape relative to the image box.number0 → 1
speedAnimation speed of the smoke.number0 → 3
fitHow the source image is fit into the canvas.stringcover · contain

Common Props

4
namedescriptiontypevalues
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