xxxxxxxxxx
let customFont;
let colors;
function preload() {
customFont = loadFont('Verve.ttf'); // Load the custom font
}
function setup() {
createCanvas(600, 800);
colors = [
color(255, 64, 128), // Pink
color(64, 192, 224), // Cyan
color(255, 224, 0), // Yellow
color(64, 64, 128), // Dark Blue
color(255, 255, 255), // White
color(224, 128, 255) // Light Purple
];
noLoop();
}
function draw() {
background(255); // White background
drawStripes();
drawShapes();
drawText();
}
function drawStripes() {
let stripeWidth = width / 12; // Adjust the number of stripes
// Draw vertical stripes
for (let i = 0; i < width; i += stripeWidth) {
fill(random(colors));
noStroke();
rect(i, 0, stripeWidth, height);
}
}
function drawShapes() {
// Semi-transparent overlapping shapes
blendMode(MULTIPLY); // Blend mode to create overlapping effect
fill(colors[1]); // Cyan
ellipse(width * 0.3, height * 0.4, 500, 500);
fill(colors[0]); // Pink
ellipse(width * 0.6, height * 0.6, 450, 450);
fill(colors[3]); // Dark Blue
arc(width * 0.5, height * 0.5, 600, 600, PI, TWO_PI);
fill(colors[5]); // Light Purple
arc(width * 0.4, height * 0.8, 500, 500, PI + QUARTER_PI, HALF_PI);
blendMode(BLEND); // Reset blend mode to default
}
function drawText() {
textFont(customFont);
textAlign(LEFT, TOP);
fill(0); // Black text color
// Main Title
textSize(72);
text("Trieste", 40, 40);
text("Estate", 40, 120);
// Year
textSize(48);
text("20", width - 80, 60);
text("21", width - 80, 120);
// Footer Text
textSize(16);
textAlign(LEFT, BOTTOM);
text("Da giugno a settembre\nuna grande stagione di spettacoli", 40, height - 80);
text("triestestate.it", width - 160, height - 40);
}
function keyPressed() {
if(key == 's') {
saveCanvas("azra-computational_poster.jpg");
}
}