Canvas lightning app
Canvas lightning generator.
See the example.
Installation
Run command:
npm i canvas-lightning
Usage
import canvasLightning from 'canvas-lightning';
const canvasEl = document.querySelector('canvas');
const app = canvasLightning(canvasEl, {
WIDTH: 100,
HEIGHT: 200
});
app.start();
window.addEventListener('resize', start);
app.stop();
Configuration
{
MIN_X: 1,
MAX_X: 10,
MIN_Y: 2,
MAX_Y: 10,
LOOP_INTERVAL: 100,
LINE_WIDTH: 3,
LINE_BLUR: 10,
LINE_JOIN: 'miter',
COLOR_LIGHT: '#fff',
COLOR_BLUR: '#0ff',
COLOR_BG: 'transparent',
CACHE_COUNT: 10,
WIDTH: 2,
HEIGHT: 2
}