Three major operations for pixel level graphic manipulation using HTML Canvas.
This consists of two steps,
- Get a handle to the HTML Canvas Element;
- Retrieve "webgl2" context.
/**
* Params:
* canvas: canvas element or its selector.
*/
function getCtx(canvasOrSelector) {
let canvas = canvasOrSelector
if (canvas instanceof String)
canvas = document.querySelector(canvas)
return canvas.getContext('webgl2')
}
For further details please look at this javascript file.
- Install VSCode;
- Install Live Server Extension;
- As per official docs, "Launch a local development server with live reload feature for static & dynamic pages."
- Install BrowserSync,
- Descend into the directory and launch using:
browser-sync -w