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(windowWidth,windowWidth);
colorMode(HSB, 360, 100, 100, 100);
rectMode(CENTER);
noFill();
stroke(255);
strokeWeight(20);
inc = TWO_PI / 250.0;
}
function draw(){
background(0);
drawingContext.shadowBlur = color(320, 100, 99,0);
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)/TWO_PI);
rect(0+sin(a) * 140.0,0, 200, 80,20);
rect(0,0+ sin(a) * 140.0, 200, 80,20);
rect(0-sin(a) * 240.0,0, 200, 80,20);
rect(0-sin(a) * 140.0,0, 60, 380,20);
rect(0,0-sin(a) * 140.0, 60, 380,20);
rect(0+sin(a) * 240.0,0, 60, 380,20);
pop();
a = a + inc;
}