npm.io
0.1.5 • Published 8 years ago

triangles-canvas

Licence
MIT
Version
0.1.5
Deps
2
Size
30 kB
Vulns
0
Weekly
0
Stars
3

Triangles Background Animation using Canvas

Installation

npm install trianglescanvas

Usage


import trianglesCanvas from 'triangles-canvas'

trianglesCanvas({
  id, // the id where the canvas should be drawn
  cb, // a callback to be run when the rendering is done
  dark = 20, // darkest color in rgba
  light = 45, // lightest color in rgba
  darkColor = 'rgba(255, 122, 5, 0.3)', // darkest color to be highlighted when mousemove
  lightColor = 'rgba(246, 90, 90, 0.3)', // lightest color to be highlighted when mousemove
  size = 25, // amount of squares to be drawn on the canvas (in px)
  refreshTime = 50 // time in ms to draw each set of triangles
})

Keywords