xxxxxxxxxx
50
let spacemono;
function preload() {
spacemono = loadFont('assets/SpaceMono-Regular.ttf');
}
let a = ['N', 'G', 'C'];
function setup() {
createCanvas(900, 900);
textFont(spacemono);
textSize(100);
textAlign(CENTER, CENTER);
}
let t = 0;
let size = 1;
let offset;
let cells = 30;
let tx = cells;
let ty = cells;
//let tw = width / tx;
//let th = height / ty;
function draw() {
let gx = width/ cells;
let margin = gx /2;
background(0);
fill(255);
translate(width/2,height/2);
scale(0.7);
translate(margin-width/2, 0);
for (let i = 0; i < cells; i++) {
offset = i * map(mouseX, 0, width, 0, 0.5);
let r = random(2);
let size1 = map(cos(t + offset), -1, 1, 0, 50);
let size2 = map(cos(t + offset), -1, 1, 50, 0);
textSize(size1);
text(a[i%3], gx * i, sin(t + offset)*map(mouseY, 0, width, 0, height/2));
textSize(size2);
text(a[i%3], gx * i, -sin(t + offset)*map(mouseY, 0, width, 0, height/2));
//text(gx * i, -sin(t + offset)*150, size2, size2);
}
t += 0.05;
}