PImage backgroundImg;
PImage bottomLeftImage;
PImage bottomRightImage;
int[] colors = {
color(255, 0, 0), // Red
color(255, 127, 0), // Orange
color(255, 255, 0), // Yellow
color(0, 255, 0), // Green
color(0, 0, 255), // Blue
color(139, 0, 255) // Purple
};
int currentColorIndex = 0;
String line1 = "HYDRATE";
String line2 = "YOURSELF";
float textSizeBase = 100; // Base size of the text
float textSizeMultiplier = 1.0; // Multiplier to scale text size with canvas size
float textY1, textY2; // Y-coordinates of the text lines
int numDroplets = 100; // Number of droplets
Droplet[] droplets = new Droplet[numDroplets]; // Array to hold droplets
float poolThreshold; // Y-coordinate threshold where droplets start pooling
// Add gray-tinted overlay
fill(50,100); // Semi-transparent gray fill
rect(0, 0, width, height); // Draw a gray-tinted overlay
// Update and display droplets
for (int i = 0; i < numDroplets; i++) {
droplets[i].fall();
droplets[i].display();
}
// Display bottom left image
image(bottomLeftImage, 20, height - bottomLeftImage.height - 20); // Adjust position as needed
// Display bottom right image
image(bottomRightImage, width - bottomRightImage.width - 20, height - bottomRightImage.height - 20); // Adjust position as needed
// Blinking and cycling text color
if (frameCount % 30 == 0) { // Change color every 30 frames (approximately every half second)
currentColorIndex = (currentColorIndex + 1) % colors.length;
}
// Display text with thick black outline and cycling colors
textAlign(CENTER, CENTER);
textSize(textSizeBase * textSizeMultiplier);
// Class to represent a droplet
class Droplet {
float x, y; // Position of the droplet
float speed; // Speed of the droplet
boolean pooling; // Flag to indicate if droplet is pooling
Droplet() {
reset(); // Initialize droplet position and speed
}
// Method to update position
void fall() {
if (!pooling) {
y += speed;
if (y > poolThreshold) { // Start pooling at the threshold
y = poolThreshold; // Set y to the threshold
pooling = true; // Set pooling flag
}
} else {
// If pooling, reset droplet above canvas after reaching the bottom
y = random(-height, 0);
pooling = false; // Reset pooling flag to restart falling
}
}
// Method to display the droplet
void display() {
fill(150, 200, 255); // Light blue color for water droplets
ellipse(x, y, 5, 5); // Draw a small ellipse as the droplet
}
// Method to reset droplet position and speed
void reset() {
x = random(width); // Random horizontal position
y = random(-height, 0); // Start above the canvas
speed = random(2, 6); // Random falling speed (double the previous speed range)
pooling = false; // Initially not pooling
}
}
background black
rotate
scale 0.5
noStroke
fill yellow
ball
move 0.7
scale 0.1
fill red
ball
move 1.4
scale 2
fill orange
ball
move 1
scale 1
fill blue
ball
move 1
scale 1
fill red
ball
move 2
scale 4
fill green
ball
move 1
scale 1
fill orange
ball
move 1
scale 0.7
fill purple
ball
move 1
scale 0.7
fill
ball