xxxxxxxxxx
67
let font;
function preload() {
font = loadFont("DelaGothicOne-Regular.ttf");
}
function setup() {
createCanvas(1080, 1080);
textFont(font);
}
function draw() {
let c = color(223,225,224);
background(c);
let t1 = "FRAGILE";
let n = 50;
let txtH = 48;
let txtW = textWidth(t1);
let spacing = txtW / t1.length;
for (let i = 0; i < t1.length; i++) {
let c = t1.charAt(i);
// let offsetX = random(-spacing / 2.0, spacing / 1.0);
// let offsetY = random(-spacing / 20.0, spacing / 1.0);
let min1 = 4;
let max1 = 20;
let intensity = mouseIsPressed ? max1 : min1;
let offsetX = random(-1, 1) * intensity;
let offsetY = random(-1, 1) * intensity;
let a1 = map(offsetY,min1,max1,255,25);
let startX = (width - txtW) / 2 + spacing / 2;
let y = height / 2; // + textHeight / 2;
push();
fill(255,0,24,a1);
textSize(180);
textLeading(180 + sin(frameCount * 0.1) * 8);
translate(70 + tan(frameCount * 0.01), 800);
rotate(QUARTER_PI * 7.4);
text(t1, 0 + spacing + offsetX, -500 + y + offsetY);
pop();
}
// strokes
push();
for (let i = 0; i < n; i++) {
noStroke();
fill(c);
rotate(80);
rect(
45 + i * 25 + 5 * sin(frameCount * 0.1),
0,
8 + sin(frameCount * 0.1) * 8,
windowHeight
);
}
pop();
stroke(90,0,255);
strokeWeight(8);
line(mouseX, mouseY, pmouseX, pmouseY);
}