xxxxxxxxxx
81
let font;
let fontSize = 150;
let textToDisplay = "S";
let growthRate = 3; // Rate of size change
let maxSize = 250;
let minSize = 100;
let sizeIncreasing = true;
function preload() {
font = loadFont("Summer Dream Sans DEMO .ttf");
}
function setup() {
createCanvas(540, 540);
textFont(font);
textAlign(CENTER, CENTER);
textSize(fontSize);
}
function draw() {
background(0);
fill(255);
push();
s();
pop();
our();
push()
translate(-100, -90)
filter(BLUR,frameCount%2)
push()
s();
pop();
our();
pop()
push()
translate(-340, -450)
push()
s();
pop();
our();
pop()
}
function s() {
translate((frameCount*3) % 450, height/2);
// rotate(frameCount * 0.05);
fill(255, 143, 0);
blendMode(SCREEN);
text("r", 0, 0);
if (sizeIncreasing) {
fontSize += growthRate;
} else {
fontSize -= growthRate;
}
if (fontSize >= maxSize) {
sizeIncreasing = false;
} else if (fontSize <= minSize) {
sizeIncreasing = true;
}
textSize(fontSize);
}
function our() {
blendMode(LIGHTEST); // Reset blending mode to default
translate(240, height/2);
fill(255);
text("sou", 0, 0);
}
function keyPressed() {
if (key === 's' || key === 'S') {
saveCanvas('sour_', 'png'); // Save the canvas as a png file with the filename 'sour_'
}
}