This demo shows how to create a glowing button effect using simple HTML and CSS transitions.
function generateWhiteNoise()
{
const imgData = ctx.createImageData(canvas.width, canvas.height);
const data = imgData.data;
// Generate random grayscale color for each pixel
for (let i = 0; i < data.length; i += 4)
{
const color = Math.random() * 255;
data[i] = color; // R
data[i + 1] = color; // G
data[i + 2] = color; // B
data[i + 3] = 255; // alpha
}
ctx.putImageData(imgData, 0, 0);
}
// Repaint the canvas every frame
function animate()
{
generateWhiteNoise();
requestAnimationFrame(animate);
}
animate();