I'm trying to get frequent waves on the screen, as if your computer is about to explode. In Photoshop, the concept was created by a noise filter, and then by clicking on the wave filter through the noise to give it a look
I created the noise using an element <canvas>, but does anyone have ideas on how to click the waves through the noise or any other way to get this desired effect?
I have 4 jsfiddles examples that can be the starting point: Thanks Ken for these examples:
really close the starting point i found
JSfiddle color noise
JSFiddle bluescreen noise
JSFiddle flickering blue noise
JS:
var canvas = document.getElementById('canvas'),
ctx = canvas.getContext('2d');
canvas.width = canvas.height = 256;
function resize() {
canvas.style.width = window.innerWidth + 'px';
canvas.style.height = window.innerHeight + 'px';
}
resize();
window.onresize = resize;
function noise(ctx) {
var w = ctx.canvas.width,
h = ctx.canvas.height,
idata = ctx.getImageData(0, 0, w, h),
buffer32 = new Uint32Array(idata.data.buffer),
len = buffer32.length,
i = 0,
pr = 456 * Math.random(),
prs = 716 * Math.random();;
for(; i < len;) {
buffer32[i++] = ((pr % 255)|0) << 24;
pr += prs * 1.2;
}
ctx.putImageData(idata, 0, 0);
}
var toggle = true;
(function loop() {
toggle = !toggle;
if (toggle) {
requestAnimationFrame(loop);
return;
}
noise(ctx);
requestAnimationFrame(loop);
})();
HTML
<canvas id="canvas"></canvas>
CSS
html, body {
background:#0000cc;
margin:0;
}
#canvas {
position:fixed;
background:#0000dd;
opacity: .2;
}
reference question