xxxxxxxxxx
75
let fontExtraLight;
let s = 0;
let growAmount = 1;
let grow = true;
function preload() {
fontExtraLight = loadFont("assets/Identidad-ExtraLight.otf");
}
function setup() {
createCanvas(600, 850);
let color1 = color(255); // Start color (red)
let color2 = color(247, 57, 228); // End color (blue)
// Define the number of steps for the gradient
let steps = 850;
// Create a gradient array of colors
let gradient = [];
for (let i = 0; i <= steps; i++) {
let interColor = lerpColor(color1, color2, i / steps);
gradient.push(interColor);
}
// Set the background to a linear gradient
setGradient(0, 0, width, height, gradient);
}
function draw() {
// Your drawing code here
textFont(fontExtraLight);
textSize(20);
stroke(255);
fill(255);
textAlign(CORNER);
text(" 7th Annual International", 22, 100);
text(" BubbleGum Festival 2023", 22, 120);
text(" 23 December 2023", 22, 140);
text(" 1234 Lollipop Lane, Candyland", 22, 160);
text(" Things to bring", 425, 250);
text(" Absolutely Nothing", 389, 270);
text(" Enjoy your time", 422 ,290);
rect(100, 350, 700, 150, 90);
rect(500, 500, 100, 450);
ellipse(350, 780, 450, s);
fill(255);
noStroke();
if (s > 450) {
grow = false;
}
if (s < 0) {
grow = true;
}
if (grow == true) {
s += growAmount;
} else {
s -= growAmount;
}
}
// Function to set a linear gradient background
function setGradient(x, y, w, h, colors) {
noFill();
for (let i = 0; i < colors.length - 1; i++) {
let interColor = lerpColor(colors[i], colors[i + 1], 1);
stroke(interColor);
line(x, y + i, x + w, y + i);
}
}