const COL = createCols("https://coolors.co/2b2d42-8d99ae-f8f32b-ffffff-000000");
createCanvas(displayWidth, displayHeight);
ondas[0] = new Onda(random(10, 100), 5, 10, random(0.01, 0.3), 0.01);
ondas[1] = new Onda(random(10, 100), 5, 20, random(0.01, 0.3), -0.01);
drawingContext.shadowColor = color(0, 128);
drawingContext.shadowBlur = 15;
for (let d = width - 20; d > 0; d -= 50) {
drawingContext.setLineDash([30, 10]);
drawingContext.lineDashOffset = 1 * frameCount % 50 * (i % 2 == 0 ? -1 : 1);
rect((width - d) / 2, (height - d) / 2, d, d);
constructor(altura, resolucao_x, resolucao_y, frequencia, velocidade) {
this.resolucao_x = resolucao_x;
this.resolucao_y = resolucao_y;
this.frequencia = frequencia;
this.velocidade = velocidade;
for (let y = -this.altura; y < height + this.altura; y += this.resolucao_y) {
for (let x = 0; x < width + this.resolucao_x; x += this.resolucao_x) {
let y_sin = sin(comprimento + this.tempo) * this.altura + y;
comprimento += this.frequencia;
this.tempo += this.velocidade;
function mousePressed() {
ondas[0] = new Onda(random(10, 100), 5, 10, random(0.01, 0.3), 0.01);
ondas[1] = new Onda(random(10, 100), 5, 20, random(0.01, 0.3), -0.01);
function createCols(_url) {
let slash_index = _url.lastIndexOf('/');
let pallate_str = _url.slice(slash_index + 1);
let arr = pallate_str.split('-');
for (let i = 0; i < arr.length; i++) {