xxxxxxxxxx
//https://github.com/Creativeguru97/YouTube_tutorial/blob/master/p5_hacks/Glow_effect/glowing_shapes/sketch.js by Kazuki Umeda
let a = 0.0;
let inc;
function setup(){
createCanvas(960, 540);
colorMode(HSB, 360, 100, 100, 100);
rectMode(CENTER);
noFill();
stroke(255);
strokeWeight(20);
inc = TWO_PI / 250.0;
}
function draw(){
background(0);
drawingContext.shadowBlur = 'blue';
drawingContext.shadowColor = color(320, 100, 99,0);
let sx= sin(millis*0.008)*100;
push();
translate(width/2+ sin(a) * 40.0, height/2);
rotate(sin(sx)*100);
rect(0,0, 200, 80,20);
rect(0,0, 200, 80,20);
rect(0,0, 200, 80,20);
rect(0,0, 100, 180,20);
rect(0,0, 100, 180,20);
rect(0,0, 100, 180,20);
pop();
a = a + inc;
}