xxxxxxxxxx
85
let myFont;
function preload() {
myFont = loadFont('LidoSTF.otf');
}
let x, y;
let noiseX = 0;
let noiseY = 10;
let x1, y1;
let noiseX1 = 0;
let noiseY1 = 10;
function setup() {
pixelDensity(1);
createCanvas(1080, 1920);
background(50);
frameRate(30);
// Reduce size of preview
let cnv = document.getElementById('defaultCanvas0');
cnv.style.width = width / 3 + "px";
cnv.style.height = height / 3 + "px";
x = width / 2;
y = height / 2;
x1 = width / 2;
y1 = height / 2;
textFont(myFont);
textSize(350);
textAlign(CENTER, CENTER);
VideoRecorder.record();
}
function draw() {
if (frameCount == 1000) {
VideoRecorder.stop();
}
//x += random(-10, 10);
//y += random(-10, 10);
noiseX += 0.01;
noiseY += 0.01;
noiseX1 += 0.02;
noiseY1 += 0.02;
let speed = 30;
x += (noise(noiseX) - 0.5) * speed;
y += (noise(noiseY) - 0.5) * speed;
x1 += (noise(noiseX1) - 0.5) * speed;
y1 += (noise(noiseY1) - 0.5) * speed;
// Faire revenir vers le centre
let recallForce = speed / 5;
x += (width / 2 - x) / 2000 * recallForce;
y += (height / 2 - y) / 3000 * recallForce;
x1 += (width / 2 - x1) / 1000 * recallForce;
y1 += (height / 2 - y1) / 2000 * recallForce;
//background(220);
fill(0, 4);
noStroke();
rect(0, 0, width, height);
//textSize(350);
//textAlign(CENTER, CENTER);
noFill();
stroke(255, 60);
strokeWeight(10);
//textFont(myFont);
let lines = 'Upon\n Time';
text(lines, x, y)
let lines2 = 'and\nEternity';
text(lines2, x1, y1);
}