dot orbit

An animated dot field where each dot orbits its own grid cell. Dial in size variation and orbit spread for anything from quiet polka dots to swarming chaos.

Preview

live

Install

npm
npm i @devmischief/shaders-svelte

Code

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

<DotOrbit
  width={1280}
  height={720}
  colors={['#ff006e', '#ffbe0b', '#06d6a0', '#3a86ff']}
  colorBack="#000000"
  stepsPerColor={4}
  size={1}
  sizeRange={0}
  spreading={1}
  scale={1}
  rotation={0}
  offsetX={0}
  offsetY={0}
  speed={1.5}
  fit="none"
/>
			
			

Shader Props

8
namedescriptiontypevalues
colorsBase dot colors (up to 10).string[]hex / rgb
colorBackBackground color shown behind the dots.stringhex / rgba
stepsPerColorExtra interpolated colors generated between each pair of base colors. 1 = N colors, 4 = 4×N.number1 → 4
sizeDot radius relative to cell size.number0 → 1
sizeRangeRandom per-dot size variation. 0 = uniform, higher = more variation up to base size.number0 → 1
spreadingMaximum orbit distance around each cell center.number0 → 1
speedAnimation speed of the orbits.number0 → 3
fitHow the dot grid 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