xxxxxxxxxx
72
var waveFunction = function(p){
const noiseScale = 0.04;
var pos = [];
const count = 100;
var noisePos = 1;
p.setup = function() {
p.createCanvas(400, 200);
p.noiseDetail(2, 0.2);
p.frameRate(30);
p.textSize(p.width/100);
p.textAlign(p.CENTER, p.CENTER);
}
p.draw = function() {
p.background('#6C757D');
p.strokeWeight(0);
for(var i = 0; i < count; i++){
pos[i] = p.noise((noisePos + i )* noiseScale, noiseScale);
}
p.fill("#B0B4B9");
p.push();
p.translate(p.width/2, p.height/2);
p.scale(1.5 ,1);
p.translate(-p.width/2, -p.height/2);
p.beginShape();
for(var j = 0; j < pos.length; j++){
p.curveVertex((p.width/count)*j, p.height-(pos[j]*300));
}
p.vertex(p.width, p.height-pos[pos.length -1]);
p.vertex(p.width, p.height);
p.vertex(0, p.height);
p.vertex(0, pos[0]);
p.endShape();
p.pop();
p.fill('#000000');
p.text("© McpeCommander" + p.year(), p.width/2, p.height - p.height/30);
noisePos-=0.5;
}
}
var blobFunction = function(p){
p.setup = function() {
p.createCanvas(225, 225);
}
p.draw = function() {
p.background("#343A40");
p.fill("#B0B4B9");
p.translate(p.width/2, p.height/2);
p.rotate(p.millis() / 700);
p.scale(p.map(p.sin(p.millis()/800), 0, 1, 0.55, 0.65));
p.translate(-p.width/2, -p.height/2);
p.beginShape();
p.curveVertex(10, p.map(p.cos(p.millis()/800), 0, 1, 0, 30));
p.curveVertex(p.width + p.map(p.sin(p.millis()/1000), 0, 1, -20, 20), 0);
p.curveVertex(p.width-p.map(p.sin(p.millis()/500), 0, 1, 0, 50), p.height-30);
p.curveVertex(50, p.height+p.map(p.sin(p.millis()/400), 0, 1, 0, 50));
p.curveVertex(10, 10);
p.curveVertex(p.width + p.map(p.sin(p.millis()/1000), 0, 1, -20, 20), 0);
p.curveVertex(p.width-p.map(p.sin(p.millis()/500), 0, 1, -30, 30), p.height-30);
p.endShape();
}
}
var blob = new p5(blobFunction);
var wave = new p5(waveFunction);