kaleidos
v2.0.3
Published
canvas kaleidoscope
Downloads
47
Readme
Kaleidos
<canvas>
kaleidoscope node module for use with browserify, webpack, etc.
Usage:
Install:
npm i kaleidos --save
Require the module:
const Kaleidos = require('kaleidos')
Instantiate with values:
// create image
const image = new Image()
image.src = 'http://i.imgur.com/YaZJZac.jpg'
// create a canvas
const canvas = document.createElement('canvas')
// instantiate
const kaleidos = new Kaleidos(canvas, {
src: image // pass above image as source
})
Append to DOM and initialize on image load:
image.addEventListener('load', function () {
document.body.appendChild(kaleidos.canvas)
kaleidos.initialize()
})
Result:
Check the /examples
Try them out
TODO:
~~Add tests~~
Add more tests
Add more examples
~~Make examples better on mobile~~
~~Fix webcam example in Firefox~~
~~Update src to be image or video~~
~~Cleanup~~